Install any skill in seconds. Free to start, no credit card required.
Get Started Free →butterbase-ai/debug-rls
Use when users report access denied errors, see wrong data, RLS policies are not working, or when troubleshooting Row-Level Security issues in Butterbase
Passed 17 of 22 test cases with the skill, and 6 of 22 without it.
and 17 more in the full report
12 fixed6 passed either way5 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 12 test cases the skill fixed. Same model, same prompt, with and without the skill.
We have a project repo containing docs/butterbase/00-state.md and need to debug RLS issues. Which skill or journey orchestrator should be invoked if the state file is present?
| Checked | Without skill | With skill |
|---|---|---|
| Recommends invoking /butterbase-skills:journey-rls when state file exists. | Missed | Passed |
The instructions your model reads when the skill loads.
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.
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.
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 |
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. |
Important: When you call select_rows or insert_row without as_role, you are always running as butterbase_service. This means the result tells you nothing about what a real user would see. Use as_role to simulate the correct role.
test cases passed, vs 6 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.