/squirrelscan:supabase-security-auditfrom squirrelscan
Audits a Supabase app for RLS misconfigurations and exposed secret keys using squirrelscan. Detects tables readable by the public anon key and writes SQL fixes.
Ships in squirrelscan. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Check whether a Supabase app lets the public anon key read tables it should not, and whether any secret key reached the browser.
A Supabase app ships its project URL and anon (publishable) key to every visitor on purpose. That is safe only when every table in an exposed schema has Row Level Security (RLS) turned on with policies that grant just what each role needs. Supabase's own docs warn that a table in an exposed schema without RLS is readable and writable by any role with a grant on it, and that a secret (service role) key bypasses RLS and must never leave your control.
Run squirrel --version. If it fails, install the CLI from squirrelscan.com/download (the squirrelscan skill has references/install.md). Then run squirrel auth status:
--offline: the audit runs on this machine, is free, and nothing is published.squirrel credits) and get a yes. Offer --offline or --no-publish. For a site the user does not own, add --ephemeral: nothing is added to the dashboard, scheduled or published.Every flag below is checked against the squirrel CLI docs (https://docs.squirrelscan.com/cli/audit). Rule docs: https://docs.squirrelscan.com/rules/{category}/{rule_id}.
The probe sends the site's public anon key to the site's Supabase project, from the user's machine. Ask: "Is this your Supabase project, or are you authorized to test it?" If not, stop: do not run the probe. You can still read the code and report leaked-secrets passively.
If the repo is available, search it before auditing:
service_role, sb_secret_, SUPABASE_SERVICE_ROLE_KEY used in a file that ships to the browser (NEXT_PUBLIC_*, Vite VITE_*, PUBLIC_*, anything under src/ of an SPA). A secret key in the browser is an incident: rotate it first..from("<table>"), /rest/v1/<table>. This is the list the audit will probe.alter table ... enable row level security for each of those tables, and create policy statements.squirrel audit https://app.example.com --level surface --aggressive --probe-budget 1m \
--rule-include security/supabase-rls,security/leaked-secrets --format json -o supabase.json
How the rule works (https://docs.squirrelscan.com/rules/security/supabase-rls):
HEAD /rest/v1/<table> each and Prefer: count=exact. It never reads a row; it reads only the status and the Content-Range total.--aggressive, only online (not --offline, external link checking on) and inside the probe budget. A hosted audit of an unverified site stays passive and skips it.security/leaked-secrets reports those if they are in the scripts.| Result | Meaning | Action |
|---|---|---|
| Fail, table listed with a row count | The anon key can see that many rows: RLS is off, or a policy lets anyone read | Fix below, or waive if the table is public by design |
| Pass | Every table the code names got a definite answer and none reported rows | Not proof for tables the code never names, views or RPC functions |
Skipped probe-incomplete | Some tables were throttled, capped or unanswered | Not clean. Say how many were unchecked and re-run narrower or later |
Skipped probing-not-aggressive, probing-passive, external-requests-off, no-tables-in-code, not-applicable | Nothing was sent | Explain which, do not report it as clean |
A count of zero cannot tell RLS hiding every row from an empty table. An empty table with RLS off becomes exposed when rows arrive, so check the migration, not only the result.
Turn on RLS for every table in an exposed schema, then add policies:
alter table public.profiles enable row level security;
create policy "Users read their own profile"
on public.profiles for select
using (auth.uid() = id);
With RLS on and no policy, the anon key reads nothing. Check each exposed table in Supabase's dashboard Security Advisor for others. Then:
posts table) still fails, because a count cannot tell a deliberate policy from RLS left off. Confirm with the user, then waive it:[[ignore]]
rule = "security/supabase-rls"
items = ["posts"]
reason = "posts is public by design"
Supabase SQL editor or the repo's supabase/migrations/ folder (a fix applied only in the dashboard is lost on the next migration reset, so commit it), the Auth and API settings pages for keys, framework env files (Next.js .env*, Vite .env) for what ships to the browser, and AI app builders' generated code (Lovable, Bolt and similar), which often creates tables with no RLS.
Stop when a re-run shows security/supabase-rls passing or skipped only for reasons you explained, no secret key in any shipped script (security/leaked-secrets clean), exposed keys rotated (ask the user to confirm), and every waived table has a reason.
Everything else on the site (headers, exposed files, cookies): security-audit. Non-security findings: audit-website.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
supabase-security, rls-audit, secret-detection, squirrelscan
13 skills in this plugin
/accessibility-auditAudit a site with squirrelscan's accessibility audit rules via the squirrel CLI or hosted squirrelscan MCP server in Claude Code, GitHub Copilot, Codex, Cursor, and other coding agents, checking accessible names, labels, ARIA, headings, landmarks, contrast, language, zoom, and target sizes. It supports an optional WCAG level filter and checklist, fixes issues by component and template, and says plainly that automated checks cover only part of WCAG and what a person must still check. Use when asked "check my site's accessibility" or "run a WCAG audit"./agent-experience-auditEvaluate your site's agent experience with squirrelscan audit rules via the squirrel CLI or hosted squirrelscan MCP server in Claude Code, GitHub Copilot, Codex, Cursor, and other coding agents, checking robots.txt bot access, content present without JavaScript, llms.txt, AGENTS.md, markdown responses, API discovery, and machine-readable policies. It leaves allow or block bot decisions to the site owner and focuses on how AI agents and crawlers read the site rather than visibility in AI answers. Use when asked "how well does my site work for AI agents" or "audit my llms.txt"./audit-websiteAudit a website with the squirrelscan CLI or the hosted squirrelscan MCP server and fix the findings in code. Runs SEO, performance, security, technical, content, accessibility, and 16 other rule categories (350+ rules), returns an LLM-optimized report, then drives an iterative fix loop, mapping findings to source files, applying fixes, and re-auditing until the site scores well. Use to discover and assess website or webapp issues and drive them to fixed.npx claudepluginhub squirrelscan/skills --plugin squirrelscanOther plugins' skills for the same job