When to use it
- Before launching to real users
- After a scare about leaked data
- Regular security reviews
What it looks like
Is our Supabase project safe to launch?
get_advisorslist_tablesexecute_sqllist_extensions+3 more2 critical issues: webhook_events has no RLS and is readable through the API, and the "avatars" bucket is public with no size limit. 3 high: profiles uses (true) for UPDATE, plus 2 security-definer functions in public. 6 performance warnings (unindexed foreign keys). Fix SQL for each is below.
The SKILL.md file
name: supabase-security-auditAudit a Supabase project's security and performance by checking RLS coverage and policies, exposed schemas, risky functions, extensions, storage buckets and Supabase advisors, then prioritising the fixes. Use when the user asks if their Supabase project is secure, wants a security review before launch, or asks about RLS gaps.
Read-only. Every execute_sql call here is a SELECT. Fixes are proposed, and are applied only after the user approves each one.
Checks
- Run
get_advisorsfor both security and performance, and take its findings as the backbone of the report, with their remediation links. - RLS: from
list_tables, list tables in exposed schemas without RLS. With a read-onlyexecute_sqlonpg_policies, flag policies that are always true, such asusing (true)for anon or authenticated on sensitive tables, and tables that have RLS on but no policies. - Functions: find
security definerfunctions in exposed schemas, which bypass RLS, with a read-only query onpg_proc. - Extensions:
list_extensions, and flag extensions installed in the public schema. - Storage:
list_storage_bucketsandget_storage_config. Flag public buckets that hold user files and missing size or type limits. - Keys: check that the app only uses the publishable or anon key, from
get_publishable_keys, in client code when the repo is open.
Report
A prioritised list: critical (data readable or writable by anyone), high, medium and low. Each item gives the finding, evidence and the exact fix SQL. Offer to apply the fixes through the schema-change flow, one approved migration at a time.
Supabase tools it uses
get_advisorslist_tablesexecute_sqlAsks firstlist_extensionslist_storage_bucketsget_storage_configget_publishable_keys
Tool list from supabase-community/supabase-mcp source.
FAQ
Does it change anything?
No. The audit is read-only; fixes are separate, approved migrations.
What are Supabase advisors?
Supabase's built-in security and performance linter. The audit starts from its findings and adds RLS, function and storage checks.