Supabase security audit skill for Claude Code, Codex and Cursor
The supabase-security-audit agent skill checks whether the anon key can read tables with Row Level Security off, and writes the RLS fixes.
supabase-security-audit is an Agent Skills SKILL.md from squirrelscan: a Supabase RLS checker and exposed-key audit for coding agents. It uses the squirrel CLI or the hosted squirrelscan MCP server in Claude Code, Codex, Cursor and other agents. It checks whether the public anon key can read tables with Row Level Security off. It also checks whether a secret key shipped to the browser. It then writes the RLS SQL fixes.
New to skills? Start with the skills overview.
What it does
- Reads the repo first, with no network: secret keys in client code, every table the client queries and the migrations that enable RLS.
- Confirms ownership before probing: “Is this your Supabase project, or are you authorized to test it?” If not, it stops.
- Runs the
security/supabase-rlsaudit rule, which sends oneHEADrequest per table withPrefer: count=exact. It never reads a row. - Probes only tables the website’s own code names, and never uses a secret key to probe.
- Reports skipped probes as not checked, not clean.
- Says that a count of zero cannot tell RLS hiding every row from an empty table.
- Writes
alter table ... enable row level securityandcreate policySQL, and puts it insupabase/migrations/. - Treats exposed rows as already read, and tells you to rotate anything sensitive and any exposed secret key.
- Waives a table that is public by design with an
[[ignore]]entry and a reason.
Questions it answers
- Is my Supabase app leaking data?
- Audit my Supabase RLS
- Check if my secret key is exposed
- Is Row Level Security turned on for every table?
- Can the anon key read my tables?
- Did my service role key end up in the browser bundle?
- Does my Lovable or Bolt app have tables with no RLS?
- What RLS policy should I write for a profiles table?
Install
Works with any Agent Skills tool (Claude Code, Codex, Cursor, Gemini CLI, Amp and others):
npx skills add squirrelscan/skills --skill supabase-security-auditThe plugin installs all the skills and the hosted squirrelscan MCP server:
/plugin marketplace add squirrelscan/skills/plugin install squirrelscan@squirrelscannpx skills add puts the skill in .agents/skills/. To add the MCP server too, configure it in ~/.codex/config.toml. See squirrelscan for Codex.
Run npx skills add, then use the Cursor plugin from the skills repository or the one-click MCP link. See squirrelscan for Cursor.
Gemini CLI, GitHub Copilot, Amp and other Agent Skills tools: run npx skills add, then add the MCP server. See coding agents.
Requirements
The squirrel CLI installed and in your PATH, or the hosted squirrelscan MCP server connected (https://mcp.squirrelscan.com/mcp). Check the CLI with squirrel --version. Setup steps are in install and MCP clients.
Install the CLI on macOS or Linux:
curl -fsSL https://install.squirrelscan.com | bashExample prompts
Paste one of these into your coding agent:
Is my Supabase app leaking data? Audit https://app.example.comAudit my Supabase RLS and write the migration to fix itCheck if my service role key is exposed in the frontend codeThe agent searches the repo, asks about ownership, runs the probe, reads each table’s result and writes the SQL and key-rotation steps.
How it works
- Confirm you own the Supabase project, or stop.
- Read the code: secret keys, queried tables and RLS in migrations.
- Run
squirrel auditwith--aggressive --probe-budget 1mand thesecurity/supabase-rlsandsecurity/leaked-secretsrules. - Read the answer per table: fail, pass or skipped, with the reason for any skip.
- Enable RLS, add policies, move secret keys to a server and rotate them. Stop when a re-run passes, or skips only for reasons you explained.
Related skills
security-audit: headers, exposed files, cookies and the rest of the website.security-headers: CSP and header config.audit-website: non-security findings.
Related rules and guides
Source on GitHub
skills/supabase-security-audit: the skill folder- README.md
- SKILL.md