Supabase RLS Policy Debugger
Paste the error Postgres gave you, or your CREATE POLICY statement, and get the diagnosis: which clause rejected you, why, and the corrected SQL. Nothing you paste leaves your browser.
What this tool detects
The analyzer matches the real failure signatures we have debugged and documented — each diagnosis links to the deep-dive article with the full explanation and test steps.
new row violates row-level security policyWITH CHECK rejected the row on INSERT/UPDATE — wrong user_id, missing session, or no INSERT policy for the role — read the fix
infinite recursion detected in policy for relationThe policy queries its own table — fix with a SECURITY DEFINER helper function — read the fix
permission denied for tableA missing GRANT, not RLS — the role cannot touch the table at all — read the fix
Query succeeds but returns 0 rowsSilent RLS filtering — auth.uid() is NULL or the policy targets another role — read the fix
Storage upload blockedstorage.objects has its own policies — bucket_id and folder checks required — read the fix
Works with service_role, fails with anon keyservice_role bypasses RLS entirely — the policies ARE the difference — read the fix
Shipping to production?
RLS is one line of the pre-deploy story. The full checklist covers auth redirects, cookies, middleware, env vars and cache behaviour for Next.js + Supabase apps.
Open the production checklist