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.
npx skills add butterbase-ai/butterbase-skills --skill debug-rlsgit clone --depth 1 https://github.com/butterbase-ai/butterbase-skillsWrote 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.
[](https://agentmods.dev/skills/butterbase-ai/butterbase-skills/debug-rls)<a href="https://agentmods.dev/skills/butterbase-ai/butterbase-skills/debug-rls"><img src="https://agentmods.dev/badge/skills/butterbase-ai/butterbase-skills/debug-rls/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.
<a href="https://agentmods.dev/skills/butterbase-ai/butterbase-skills/debug-rls"><img src="https://agentmods.dev/badge/skills/butterbase-ai/butterbase-skills/debug-rls.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00034 | $0.03494 |
| Opus 5.5 | $0.00014 | $0.01398 |
| Sonnet 5.5 | $0.00007 | $0.00699 |
| Haiku 4.5 | $0.00003 | $0.00349 |
Grade A, and why
debug-rls 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 2mo 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.
How it starts
The opening of the file, as written. The whole thing — 364 lines — stays where its author put it; the contents beside it link to each section on GitHub.
debug-rls
Systematic methodology for debugging Row-Level Security issues in Butterbase. Uses role simulation (as_role/as_user parameters) to verify policy behavior without needing real user sessions.
1. Overview
Row-Level Security (RLS) in Butterbase controls which rows each database role can see or modify. When RLS is misconfigured, users may see no data, too much data, or get unexpected errors on insert. This skill walks through a repeatable four-step process to identify and fix the root cause.
Key principle: MCP tools default to the service key (bb_sk_...), which bypasses all RLS. Always use as_role/as_user to simulate the role your frontend actually uses.
2. Quick Diagnosis
Match the symptom your user reports to the most likely cause before diving into the full protocol.
| Symptom | Likely cause |
|---|---|
| User sees no rows | RLS enabled but no policy for butterbase_user role |
| User sees ALL rows | RLS not enabled on the table, or request uses service key (bb_sk_) |
Insert fails with AUTH_RLS_POLICY_VIOLATION |
No INSERT policy, or user_column not auto-populated |
| User sees other users' data | Policy USING expression is wrong, or user isolation not set up |
| Anonymous user gets 403 | No policy for butterbase_anon role |
| Works in MCP tools but not from frontend | MCP uses service key (bypasses RLS); frontend uses end-user JWT |
3. The Three Roles
Butterbase automatically assigns a database role based on the auth header of each request. You never create these roles — they are built in.
| Auth header | Database role | Behavior |
|---|---|---|
| None | butterbase_anon |
Default deny. Only sees rows allowed by explicit anon policies. |
| Valid end-user JWT | butterbase_user |
current_user_id() returns their UUID. Sees rows matching their policies. |
API key (bb_sk_...) |
butterbase_service |
Bypasses ALL RLS. Sees everything. Used by MCP tools and admin operations. |
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.
- 2mo ago First seen · 364 lines · 34 tokens per session scan A ffbe168a9c6a
debug-rls is a skill published in the GitHub repository butterbase-ai/butterbase-skills (535 stars, last pushed 6d ago), licensed MIT. It adds 34 tokens to every session and 3,494 once invoked, about $0.0001 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-08-30.
debug-rls compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| debug-rlsbutterbase-ai/butterbase-skills | Skill | 535 | 6d ago | MIT | A | 34 | Claude Code |
| triage-issuesgoogleapis/mcp-toolbox | Skill | 17k | yesterday | Apache-2.0 | A | 164 | Claude Code, Codex |
| postgresql-indexingprowler-cloud/prowler | Skill | 15k | yesterday | Apache-2.0 | A | 108 | Claude Code |
| graphjin-evaldosco/graphjin | Skill | 3.2k | 5d ago | Apache-2.0 | A | 27 | Claude Code, Codex |
| butterbasebutterbase-ai/butterbase | Skill | 3.0k | yesterday | Apache-2.0 | A | 34 | Claude Code, Codex |
| axiom-audit-grdb-performanceCharlesWiltgen/Axiom | Skill | 1.3k | yesterday | MIT | A | 43 | Codex |
| django-perf-reviewgetsentry/skills | Skill | 1.1k | yesterday | Apache-2.0 | A | 55 | Claude Code |