Supabase RLS Policy Builder
Row-level security is the difference between a Supabase app and an open database — and theCREATE POLICY syntax is easy to get subtly wrong. Pick your table, operation, and role, choose an ownership preset (or write custom clauses), and copy syntax-valid PostgreSQL. The builder enforces the real validity rules: INSERT policies take only WITH CHECK, SELECT and DELETE take only USING.
runs 100% in your browser — schema details never leave the tab
- 1Describe the accessTable name, operation (ALL / SELECT / INSERT / UPDATE / DELETE), and the Supabase role it applies to.
- 2Pick a preset or go custom"User owns record", read-everyone/update-owner, or team matching — or type your own USING and WITH CHECK clauses.
- 3Copy valid SQLThe policy updates as you click, with the clause rules Postgres actually enforces baked in.
Clause validity is enforced automatically: INSERT policies emit onlyWITH CHECK; SELECT andDELETE emit only USING — exactly what Postgres accepts.
Generated PostgreSQL
Run it in the Supabase SQL editor. The ALTER TABLE … ENABLE ROW LEVEL SECURITYline is included — without it, policies exist but nothing is enforced.