db-rls-audit

Audits PostgreSQL tables for RLS coverage and lists all row-level security policies.

3|Updated Feb 7, 2026
One-click install
npx skills add https://github.com/gabrielnsmnto/kord-aios --skill db-rls-audit-gabrielnsmnto
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: db-rls-audit
Source: https://github.com/gabrielnsmnto/kord-aios/tree/main/src/features/builtin-skills/kord-aios/database/db-rls-audit
Command: npx skills add https://github.com/gabrielnsmnto/kord-aios --skill db-rls-audit-gabrielnsmnto

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Supabase and PostgreSQL applications risk exposing sensitive data when tables lack Row Level Security or have incomplete policies. This Skill runs a comprehensive audit that reports which tables have RLS enabled, which do not, and exactly what policies exist on each table. ## Core Features & Use Cases - RLS Coverage Report: Lists every public-schema table with its RLS status (enabled or disabled) and a JSON summary of all attached policies. - Policy Gap Detection: Identifies tables with RLS enabled but zero policies, tables with incomplete granular coverage, and tables with no RLS at all. - Remediation Guidance: Provides ready-to-use SQL for KISS policies, public-read policies, and multi-tenant organization isolation patterns. - Use Case: After running a database migration, execute this audit to confirm every new table has RLS enabled and appropriate policies before deploying to production. ## Quick Start Ask the agent to run an RLS audit on your Supabase database to list all tables without row level security and their existing policies.

Frequently Asked Questions about db-rls-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check which PostgreSQL tables have RLS enabled?▼

Query pg_tables for the rowsecurity flag filtered by schema, then join pg_policies to list attached policies. This audit runs that query via psql and outputs enabled, disabled, and policy-count summaries for every public table.

How to audit Supabase row level security policies?▼

Run the provided psql script against your SUPABASE_DB_URL connection string. It reports tables without RLS, tables with RLS but no policies, and per-table policy coverage across SELECT, INSERT, UPDATE, and DELETE commands.

What happens if RLS is enabled but no policies exist?▼

The table becomes inaccessible to all users because RLS denies everything by default. Fix it by creating a policy, such as a KISS FOR ALL policy scoped to auth.uid(), or disable RLS if the table is intentionally public.

Does this work with multi-tenant Supabase databases?▼

Yes, the audit covers all public-schema tables regardless of tenancy model, and the documentation includes an organization-isolation policy pattern using the org_id claim from the JWT for multi-tenant access control.

Why does my RLS policy block some operations but not others?▼

Granular policies covering only one to three commands leave the remaining operations denied. Either add policies for the missing commands or consolidate into a single FOR ALL policy to cover every operation uniformly.