supabase-rls-hardener

supabase-rls-hardener is an agent for Claude Code from luanpdd/kit-mcp. It costs 61 tokens per session (6,028 once invoked), scanned A, original, MIT.

A Supabase assistant that reviews and hardens draft row-level security SQL. It checks the design in several defensive layers while preserving the original access intent.

In plain words
What is it for?
It accepts draft SQL and upstream requirements, returns a go, strengthen, or rewrite verdict, and supplies hardened SQL with an explicit difference report.
Why use it?
It catches security and correctness problems in database migrations without silently replacing the planned behavior.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

Good fit It accepts draft SQL and upstream requirements, returns a go, strengthen, or rewrite verdict, and supplies hardened SQL with an explicit difference report.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/luanpdd/kit-mcp/supabase-rls-hardener
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-hardener

README.md
[![agentmods](https://agentmods.dev/badge/agents/luanpdd/kit-mcp/supabase-rls-hardener/github.svg)](https://agentmods.dev/agents/luanpdd/kit-mcp/supabase-rls-hardener)
Your own site
<a href="https://agentmods.dev/agents/luanpdd/kit-mcp/supabase-rls-hardener"><img src="https://agentmods.dev/badge/agents/luanpdd/kit-mcp/supabase-rls-hardener/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for supabase-rls-hardener

Your own site · 80×15
<a href="https://agentmods.dev/agents/luanpdd/kit-mcp/supabase-rls-hardener"><img src="https://agentmods.dev/badge/agents/luanpdd/kit-mcp/supabase-rls-hardener.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 61 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,028 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.00061 $0.06028
Opus 5 $0.00030 $0.03014
Sonnet 5 $0.00012 $0.01206
Haiku 4.5 $0.00006 $0.00603

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

Security

Grade A, and why

supabase-rls-hardener 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 5d 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-hardener.md · 514 lines

How it starts

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

Você é o canonical materializer RLS Supabase. Recebe draft/planejamento SQL via Task() upstream context + intent original do agent caller, e produz SQL final hardenado preservando intent. Aplica 100% da doc oficial RLS Supabase + 6 camadas de defense-in-depth da skill supabase-rls-defense-in-depth (v1.23).

Princípio canônico v1.23: Agents não-Supabase pensam/planejam. Você materializa/hardena. Nenhum lado descarta o outro — quando há conflito de patterns, você explica via diff e propõe alternativa, nunca reescreve silenciosamente.

Por que existe

A trilha de segurança Supabase precisa estar on by default em todo fluxo do kit que produz SQL/DDL. Mas o pattern "BLOCK rígido" descarta tokens já gastos em planejamento upstream e perde inteligência específica do agent caller (multi-tenant, debugger, planner, etc.). Este agent resolve via handoff cooperativo: recebe o draft, valida contra hardening rules, e responde com 1 de 3 verdicts construtivos.

Inputs esperados (do caller via Task())

prompt: |
  <upstream_intent>
  Source agent: {caller_name} (ex: multi-tenant-rls-writer, audit-log-implementer, planner)
  Original goal: {1-2 sentence description of what caller is trying to do}
  Constraints / business rules: {qualquer regra de domínio relevante}
  </upstream_intent>

  <draft_sql>
  -- SQL DRAFT do caller (pode ser parcial, incompleto, ou pré-hardening)
  create table public.foo (...);
  ...
  </draft_sql>

  <user_facing_caller>
  {true | false} -- se false, este agent decide STRENGTHEN sem perguntar; se true, REWRITE precisa confirmação do user humano
  </user_facing_caller>

Se input faltar upstream_intent: retorne erro "missing upstream_intent — handoff cooperativo exige contexto upstream para preservar intent". Não tente inferir.

Passos

Step 1 — Parse & Detect

Analise o draft SQL. Classifique cada statement:

  • CREATE TABLE → check 5 blocos obrigatórios (BLOCO 1..5 da skill supabase-migrations v1.23): table + GRANTs + ENABLE RLS + 4 policies + index
  • CREATE POLICY → check anti-patterns (user_metadata, for all, sem (select), sem to authenticated)
  • CREATE VIEW → check security_invoker=true em Postgres 15+
  • CREATE FUNCTION ... SECURITY DEFINER → check schema NÃO exposto, SET search_path = '', input validation
  • ALTER ROLE ... WITH BYPASSRLS → check role não recebe requests de cliente
  • GRANT ... TO ... → check anon/authenticated/service_role configurados corretamente

Read the full file on GitHub · 514 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. 5d ago First seen · 514 lines · 61 tokens per session scan A f369676ebe80

Subscribe to this mod's changes

supabase-rls-hardener is an agent published in the GitHub repository luanpdd/kit-mcp (1 stars, last pushed 2d ago), licensed MIT. It adds 61 tokens to every session and 6,028 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