Free · runs in your browser

Supabase RLS policy generator

Pick how the table is accessed and get the migration: RLS on, one policy per operation, only the grants the API roles need, and the indexes the policies use. Every pattern is tested against Postgres as signed-out and signed-in users.

Your table

Operations the app does

migration.sql


      

Then check it: npx airlock-rls fails your CI build if any table ships without RLS or with an always-true policy.

check.sql


    

What the generated SQL does, and why

Tested: each pattern is applied to Postgres and checked as a signed-out visitor and as two users (own rows only, no cross-user reads or writes, no reassigning rows, no recursion on the membership table).

Policies written. Now keep them that way.

A policy edited by hand or a table added in a hurry can reopen a leak. airlock-rls blocks it in CI for free; Airlock Monitor re-checks production on a schedule.

npx airlock-rls →