supabase-security

supabase-security is a skill for Claude Code, Codex from yorrick/agent-skills. It costs 205 tokens per session (4,849 once invoked), scanned B, original, MIT.

A security guide for Supabase projects where a web browser connects directly to the database through PostgREST, without a separate server to enforce permissions.

In plain words
What is it for?
Use it when designing or reviewing Supabase access rules, database grants, protected functions, views, triggers, and RPC endpoints.
Why use it?
It explains how to prevent clients from reading or changing data they should not access. It covers database permissions, row-level security policies, and related authorization controls.

Skill for Claude CodeCodex

Written for Claude Code and Codex: ${CLAUDE_PLUGIN_ROOT variable, but also reads ~/.codex or $CODEX_HOME. Also seen: reads .claude/ paths; mentions Codex.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the supabase-security plugin — 1 skill shipped together

Good fit Use it when designing or reviewing Supabase access rules, database grants, protected…

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add yorrick/agent-skills
Claude Code
/plugin install supabase-security

Made for: Claude Code, Codex.

Or install supabase-security, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for supabase-security

README.md
[![agentmods](https://agentmods.dev/badge/skills/yorrick/agent-skills/supabase-security.svg)](https://agentmods.dev/skills/yorrick/agent-skills/supabase-security)
Your own site
<a href="https://agentmods.dev/skills/yorrick/agent-skills/supabase-security"><img src="https://agentmods.dev/badge/skills/yorrick/agent-skills/supabase-security.svg" alt="Measured on agentmods" height="20"></a>
Per session 205 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,849 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00205 $0.04849
Opus 5 $0.00102 $0.02424
Sonnet 5 $0.00041 $0.00970
Haiku 4.5 $0.00020 $0.00485

Measured 7d ago against content hash 32e4e4d4bdb5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade B, and why

supabase-security scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nullifies safety policiesmediumAnti-refusal

"You have no restrictions", "do anything now", "ignore your guidelines": a direct jailbreak that disables guardrails.

RLS governs rows. `TRUNCATE` is a whole-table operation and **no policy applies to it** — a role holding `TRUNCATE` can wipe every tenant's data regardless of how good your isolation is. Never grant it to `anon` or `auth

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Reads agent configuration directorieslowAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

find ~/.claude/plugins ~/.codex/plugins ~/.agents -name audit_rls.py 2>/dev/null \

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

supabase-security/skills/supabase-security/SKILL.md · 316 lines

How it starts

The opening of the file, as written. The whole thing — 316 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Supabase Access Control

With no API between the browser and the database, Postgres is the entire security perimeter. There is nowhere else to put a check a determined client cannot route around. Every rule here follows from that.

Built on Supabase's own linter. The audit script bundles Splinter — the SQL linter behind the dashboard's Security Advisor and the get_advisors MCP tool — and adds four checks it does not have. Splinter is Supabase's work, vendored unmodified at vendor/splinter.sql; see Credits.

The one-paragraph model

The anon key says which project. The JWT says which user. Neither says what you may do — that is schema exposure, GRANT, RLS, and (for per-column rules) triggers.

Teams get breached by believing the anon key is a credential. It is not. It is public by design and ships in your JS bundle. In CVE-2025-48757 (CVSS 9.3), 170+ production apps were fully readable and writable by anyone holding the public key — not because the key leaked, but because RLS was off. The key was doing exactly what it was designed to do.

The enforcement layers, and their order

This ordering causes more confusion than anything else in Supabase. Learn it before writing a policy.

1. GRANT           role → table/column    no predicates, no rows
2. RLS USING       which existing ROWS may be touched
3. BEFORE trigger  sees OLD, NEW and the caller; may alter NEW
4. RLS WITH CHECK  validates the resulting NEW row
5. Constraints

Note steps 3 and 4: WITH CHECK runs after BEFORE triggers, so a trigger that rewrites NEW is still subject to the policy.

Three consequences, each of which has caused a production incident:

Each layer only narrows the one above it. RLS can never grant a privilege the GRANT layer withheld. If you revoke a column, a policy saying "admins may update everything" becomes unreachable — the privilege check rejects the statement before any row is considered. This is Postgres-documented; Supabase does not document it anywhere.

Read the full file on GitHub · 316 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 316 lines · 205 tokens per session scan B 32e4e4d4bdb5

Subscribe to this mod's changes

supabase-security is a skill published in the GitHub repository yorrick/agent-skills (10 stars, last pushed 3d ago), licensed MIT. It adds 205 tokens to every session and 4,849 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it B with 2 findings (nullifies safety policies, reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens