rls-audit

rls-audit is a skill for Claude Code from MartinOlivero/saas-builder. It costs 198 tokens per session (2,558 once invoked), scanned A, original, MIT.

A focused security review of row-level security and database permissions in Postgres systems exposed through automatic APIs such as Supabase or PostgREST. Row-level security controls which rows each database user may read or change.

In plain words
What is it for?
Use it to audit policies for anonymous and signed-in users, check whether users can access other users' rows, and find permission gaps in a Postgres-backed API.
Why use it?
A public browser key does not protect data by itself; database grants and policies decide what requests can do. The review tests declared access intentions against actual permissions instead of relying on pattern matching alone.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the saas-builder plugin — 22 skills, 1 hook shipped together

Good fit Use it to audit policies for anonymous and signed-in users, check whether users can access other users' rows, and find permission gaps in a Postgres-backed API.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/martinolivero/saas-builder/rls-audit
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.

Any agent
npx skills add MartinOlivero/saas-builder --skill rls-audit
Clone the repo
git clone --depth 1 https://github.com/MartinOlivero/saas-builder

Made for: Claude Code.

Or install saas-builder, the plugin that ships this one along with the rest of its 22 skills, 1 hook.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/martinolivero/saas-builder/rls-audit/github.svg)](https://agentmods.dev/skills/martinolivero/saas-builder/rls-audit)
Your own site
<a href="https://agentmods.dev/skills/martinolivero/saas-builder/rls-audit"><img src="https://agentmods.dev/badge/skills/martinolivero/saas-builder/rls-audit/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 rls-audit

Your own site · 80×15
<a href="https://agentmods.dev/skills/martinolivero/saas-builder/rls-audit"><img src="https://agentmods.dev/badge/skills/martinolivero/saas-builder/rls-audit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 198 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,558 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.00198 $0.02558
Opus 5.5 $0.00079 $0.01023
Sonnet 5.5 $0.00040 $0.00512
Haiku 4.5 $0.00020 $0.00256

Measured 15d ago against content hash 247c18fe59d2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rls-audit 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 15d 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.

skills/rls-audit/SKILL.md · 135 lines

How it starts

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

RLS Audit

On a BaaS, the database is the API. The public key ships inside your JavaScript bundle, so anyone can send any query your grants and policies allow. This skill finds the gap between what you meant to expose and what the database actually permits.

Analogy: RLS is the bouncer at each door of a building. This skill doesn't ask the bouncer whether they're doing a good job — it walks up to every door with a visitor badge and tries the handle.

Why a scanner is not enough

A generic scanner greps for USING (true) and flags it. That is wrong in both directions: a public price list is supposed to be USING (true), while a policy that looks strict (customer_id = auth.uid()) can be useless if the user is the one who writes customer_id. The scanner has no way to know what you intended. Intent is the missing input, and you have to declare it. That declaration is Step 1.

Scope

Postgres reachable through PostgREST-style auto APIs: Supabase, InsForge, Neon + PostgREST. The role names below (anon, authenticated) are the common ones — confirm yours. It does not apply to MySQL, MongoDB or Firebase rules.

This is a focused review, not a penetration test. For an app holding money or sensitive data, it is the step before a professional audit, not a substitute for one.

Step 1 — Declare intent (once, in writing)

Classify every table and view into exactly one bucket. Ask the developer; do not guess from names. Save it as docs/rls-intent.md so the next audit starts from it.

Bucket Meaning What "correct" looks like
public-reference Anyone may read it, on purpose (catalog, plans, public directory) SELECT open; no write from API roles
owner-scoped A row belongs to one user Every policy ties the row to the caller's id
tenant-scoped A row belongs to an organization Every policy ties the row to a tenant the caller is a member of
server-only Only your backend touches it (billing, tokens, audit log) RLS on, no policies, grants revoked from API roles

Read the full file on GitHub · 135 lines

Files

What ships with it

1 file 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. 15d ago First seen · 135 lines · 198 tokens per session scan A 247c18fe59d2

Subscribe to this mod's changes

rls-audit is a skill published in the GitHub repository MartinOlivero/saas-builder (4 stars, last pushed 11d ago), licensed MIT. It adds 198 tokens to every session and 2,558 once invoked, about $0.0008 per session on Opus 5.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-10-08.

Related

Other skills, from other repositories

moai-platform-database-cloud

Cloud database platform specialist covering Neon (serverless PostgreSQL), Supabase (PostgreSQL 16 with real-time), and Firebase Firestore (NoSQL with offline sync). Use when choosing or setting up cloud databases.

modu-ai/moai-adk · 51 tokens

memstack-security-rls-guardian

Use this skill when creating or altering database tables in Supabase or PostgreSQL projects. Triggers include: CREATE TABLE, ALTER TABLE, migration files, 'RLS', 'row level security', 'new table', 'database schema'. Enforces Row Level Security policies on every table to prevent unauthorized data access. Do NOT use for…

cwinvestments/memstack · 84 tokens

supabase

Supabase platform standards — Row-Level Security, publishable/anon and secret/servicerole key boundaries, Postgres and Edge functions, Storage, Realtime, and the CLI migration workflow. Use when working with RLS policies, Supabase clients, Edge Functions, or supabase/ migrations. Loads alongside the database…

ndisisnd/cook · 71 tokens

database

Database standards for PostgreSQL persistence and Redis caching. Use when designing schemas, writing migrations, optimizing queries, configuring Redis, or implementing cache invalidation.

ndisisnd/cook · 32 tokens

writing-safe-migrations

Guides Postgres migrations when altering large or live tables, adding indexes or constraints, backfilling columns, changing column types, or planning zero-downtime rollouts. Covers lock levels, locktimeout, CREATE INDEX CONCURRENTLY, NOT VALID constraints, and expand-and-contract.

pumarogie/claude-postgres-skills · 62 tokens

designing-postgres-schemas

Guides Postgres schema design when creating tables, choosing keys and data types, defining foreign keys and deletion behavior, modeling JSONB, or planning retention for unbounded event and log data.

pumarogie/claude-postgres-skills · 45 tokens