audit_supabase_rls
Audit Supabase/Postgres access control via catalog metadata: find tables with RLS off, always-true policies, tenant leaks, exposed views and SECURITY DEFINER risks. Read-only role suffices.
Instructions
Audit a Supabase/Postgres database's access control and return a human-readable report (use get_findings for JSON). Covers: tables with RLS off; permissive policies (USING (true) or anything that reduces to always-true); anon/authenticated policies that do not scope rows to the caller (tenant leaks) for SELECT, INSERT, UPDATE and DELETE; policies that trust user-editable user_metadata; Storage (public buckets and storage.objects policies, reported as storage_); SECURITY DEFINER functions (callable by anon, search_path not pinned, reading user_metadata); views that run as their owner and skip RLS; exposed materialized views; Realtime publications streaming anon-readable rows; default privileges that grant future tables to the API roles; roles with BYPASSRLS; and tables owned by a client role without FORCE RLS. Reads ONLY catalog metadata, never row data, so a read-only role is enough; a check the role cannot read is reported as check_skipped. Not covered: Auth settings and Edge Functions code, which are not in the database catalog.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"db_url": "<db_url>"
},
"name": "audit_supabase_rls"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| allow | No | Policy names that are intentionally permissive (e.g. a public status page). Prefer the qualified form "table.policy". | |
| db_url | Yes | Postgres connection string for the project to audit (e.g. postgresql://... — get it from `supabase status` locally or your project's connection settings). A read-only role is enough. | |
| schema | No | Schema to audit (default: public). | public |