supabase-rls-writer

supabase-rls-writer is an agent for Claude Code from luanpdd/kit-mcp. It costs 53 tokens per session (3,104 once invoked), scanned A, original, MIT.

A Supabase assistant for writing row-level security policies, which control which database rows each user may read or change. It also prepares related permissions, indexes, and safer views.

In plain words
What is it for?
It creates separate read and write policies, grants permissions before enabling protection, adds required indexes, and stops when it finds unsafe user-metadata authorization.
Why use it?
It reduces common authorization mistakes such as overly broad policies, slow user checks, and using editable profile metadata to grant access.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: mentions Claude Code; mentions Codex; mentions Gemini CLI.

Good fit It creates separate read and write policies, grants permissions before enabling protection, adds required indexes, and stops when it finds unsafe user-metadata authorization.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/luanpdd/kit-mcp/supabase-rls-writer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/luanpdd/kit-mcp

Made for: Claude Code.

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-rls-writer

README.md
[![agentmods](https://agentmods.dev/badge/agents/luanpdd/kit-mcp/supabase-rls-writer.svg)](https://agentmods.dev/agents/luanpdd/kit-mcp/supabase-rls-writer)
Your own site
<a href="https://agentmods.dev/agents/luanpdd/kit-mcp/supabase-rls-writer"><img src="https://agentmods.dev/badge/agents/luanpdd/kit-mcp/supabase-rls-writer.svg" alt="Measured on agentmods" height="20"></a>
Per session 53 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,104 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00053 $0.03104
Opus 5 $0.00026 $0.01552
Sonnet 5 $0.00011 $0.00621
Haiku 4.5 $0.00005 $0.00310

Measured 4d ago against content hash 04742fdb8646, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

supabase-rls-writer scanned grade A with 0 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 4d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

kit/agents/supabase-rls-writer.md · 315 lines

How it starts

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

Você é o RLS-writer Supabase. Recebe nome de tabela e descrição de quem deve ler/escrever (ou draft SQL via Task() upstream context — handoff cooperativo v1.23), e produz policies RLS granulares + GRANTs antes de ENABLE RLS + indexes obrigatórios. ABORTA com erro explícito se detecta user_metadata em policy de autorização (privilege escalation B5).

Princípio canônico v1.23: Agents externos pensam/planejam; você materializa preservando intent. Quando há ambiguidade, peça clarificação via diff — não assume.

Compat: Full em Claude Code + Cursor (com Supabase MCP); Partial em Codex + Gemini CLI; Offline-only em Windsurf/Antigravity/Copilot/Trae. Veja COMPATIBILITY.md.

Por que existe

RLS policies são a primeira linha de defesa de qualquer projeto Supabase — e também a fonte mais comum de bugs sutis (sem (select) wrapper = lentidão; user_metadata em autorização = privilege escalation; for all = controle frouxo). Este agent escreve policies padronizadas com checks anti-pitfall built-in.

Inputs esperados (do caller)

  • table_name: nome da tabela (ex: public.tasks)
  • access_pattern: descrição de quem pode ler/escrever, ex:
    • "users só veem suas próprias tasks (user_id = auth.uid())"
    • "admins (app_metadata role=admin) leem tudo, users só as próprias"
    • "members de org (org_id in jwt.app_metadata.orgs) leem"
  • (Opcional) operations: SELECT/INSERT/UPDATE/DELETE — se omitido, gera todas as 4
  • (Opcional) tier: aal2_required: true para enforcement de MFA
  • (Opcional, v1.23) include_is_not_null_check (bool, default true) — adiciona auth.uid() IS NOT NULL AND ... antes do match (anti silent-fail anônimo). Default true em v1.23+
  • (Opcional, v1.23) generate_view — se caller indica que precisa de view sobre a tabela, gera com with (security_invoker = true) (Postgres 15+) ou em schema privado (pré-15)
  • (Opcional, v1.23 — handoff cooperativo) upstream_intent — quando invocado via Task() de outro agent (multi-tenant-rls-writer, audit-log-implementer, etc.), recebe contexto upstream (caller name + goal + business rules) para preservar intent

Read the full file on GitHub · 315 lines

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. 4d ago First seen · 315 lines · 53 tokens per session scan A 04742fdb8646

Subscribe to this mod's changes

supabase-rls-writer is an agent published in the GitHub repository luanpdd/kit-mcp (1 stars, last pushed yesterday), licensed MIT. It adds 53 tokens to every session and 3,104 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other agents, from other repositories

PostgreSQL Database Administrator

Work with PostgreSQL databases using the PostgreSQL extension.

github/awesome-copilot · 17 tokens

supabase-substrate-explorer

Specialist research agent for discovering creative, non-obvious applications of the Supabase SUBSTRATE dimension (Postgres Database, Storage object store, pgvector) to Thoughtbox's reasoning-persistence surfaces. Use proactively when exploring how substrate-layer primitives could become new "organs" for Thoughtbox…

Kastalien-Research/thoughtbox · 117 tokens

database-reviewer

PostgreSQL specialist for query performance, schema design, security/RLS, and migration safety. Use PROACTIVELY when writing SQL, creating migrations, designing schemas, or troubleshooting database performance.

sjarmak/coding-agent-workflows · 43 tokens

doctor-strange

Senior DBA / Database Architect — PostgreSQL, schemas, migrations, query optimization, multi-tenancy, backups. Call for anything related to data structure, performance, and integrity.

CohesiumAI/assemble · 39 tokens

dba

A read-only database expert for SQL Server, SQLite, and PostgreSQL, with guidance on table design, SQL differences, migrations, indexes, and query performance.

SatoruoGojoo/octopus · 70 tokens

neon-drizzle-expert

Expert in Neon PostgreSQL (v17), Drizzle ORM (v0.44.4), and Zod (v4.0.17) schema validation for production memory systems. Specializes in serverless PostgreSQL patterns with @neondatabase/serverless (v1.0.1), type-safe database operations, and migration strategies.

Matt-Dionis/claude-code-configs · 77 tokens