plan-rls-audit

plan-rls-audit is a skill for Claude Code from kensaurus/cursor-kenji. It costs 69 tokens per session (2,845 once invoked), scanned A, original, MIT.

A planning guide for checking Row-Level Security, or rules that control which database users can read or change which rows, in Supabase and PostgreSQL. It produces an access matrix and remediation plan without running SQL changes.

In plain words
What is it for?
Use it to review every table and view, check its access policies, identify ownership and permission gaps, and plan fixes by exposure risk.
Why use it?
It helps find tables where anonymous or signed-in users may access data they should not see or modify.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Claude Code.

Part of the cursor-kenji plugin — 132 skills, 63 commands, 6 agents, 1 hook, 3 MCP servers shipped together

Good fit Use it to review every table and view, check its access policies, identify ownership and permission gaps, and plan fixes by exposure risk.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kensaurus/cursor-kenji/plan-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 kensaurus/cursor-kenji --skill plan-rls-audit
Clone the repo
git clone --depth 1 https://github.com/kensaurus/cursor-kenji

Made for: Claude Code.

Or install cursor-kenji, the plugin that ships this one along with the rest of its 132 skills, 63 commands, 6 agents, 1 hook, 3 MCP servers.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/kensaurus/cursor-kenji/plan-rls-audit"><img src="https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/plan-rls-audit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,845 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00069 $0.02845
Opus 5.5 $0.00028 $0.01138
Sonnet 5.5 $0.00014 $0.00569
Haiku 4.5 $0.00007 $0.00284

Measured 1mo ago against content hash 28a53630cc46, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

plan-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 1mo 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/plan-rls-audit/SKILL.md · 234 lines

How it starts

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

RLS & Access-Control Audit + Remediation Plan

Degree of freedom: MIXED — access matrix and severity are judgment; table inventory and policy reads run exactly. Stay plan-only. No SQL until approved.

This skill vs neighbors

Skill Owns
plan-rls-audit (this) Who can read/write which rows
plan-security-audit OWASP umbrella (not the first RLS match)
audit-db-schema Schema design quality
plan-secrets-audit Where service_role lives
audit-auth-flows App-layer session / route×gate / getSession vs getUser

Role: Senior backend engineer + Supabase security specialist.

Task: Enumerate every table/view, run the RLS checklist (A–E), build a who-can-do-what access matrix, score findings by exposure, emit plan-rls-audit.md. Audit & plan only — no SQL runs until each phase is approved.

How to reason (every plan item)

  1. Propose — enable RLS, scope a policy, rotate a client service_role, or fix inverted logic
  2. Risk — anon/authed can read or write rows they should not
  3. Keep-working — tables whose policies already enforce ownership
  4. Phase — Stop exposure → Ownership → Correctness-perf → Adjacent gates (do not execute)

Worked example

Propose: enable RLS on profiles; replace USING (true) on orders SELECT with user_id = (select auth.uid()). Risk: anon key (public) reads every profile; every authed user reads every order. Keep-working: orders INSERT already checks owner. Phase: Phase 1 — Stop active exposure (Critical). Direction: policy shape only — no SQL in this pass. Client service_role → plan-secrets-audit.

Missing or misconfigured Row-Level Security is the most documented vibe-coding catastrophe of the 2025–2026 era. An audit of 50 vibe-coded apps across Lovable, Bolt, v0, Cursor, and Claude Code found 88% had RLS entirely disabled — not misconfigured, disabled — meaning the database returned any row to any query. Public breach reports describe apps leaking millions of API keys and user emails from exactly this, and a disclosed vulnerability class spanning many production apps where access control was present but logically inverted — authenticated users blocked, anonymous users granted everything.

Read the full file on GitHub · 234 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. 1mo ago First seen · 234 lines · 69 tokens per session scan A 28a53630cc46

Subscribe to this mod's changes

plan-rls-audit is a skill published in the GitHub repository kensaurus/cursor-kenji (9 stars, last pushed 22d ago), licensed MIT. It adds 69 tokens to every session and 2,845 once invoked, about $0.0003 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-09-03.