Policy Parameters
Generated Production SQL Migration
Why (SELECT auth.uid()) Matters
Calling bare auth.uid() inside a policy forces PostgreSQL to invoke the JWT function per row. Wrapping it in (SELECT auth.uid()) triggers an initPlan cache so Postgres evaluates it once per query.
Stop CVE-2025-48757 PostgREST Leaks
Every table created in public is automatically exposed over Supabase PostgREST. Without ENABLE ROW LEVEL SECURITY and explicit role policies, anyone with your browser anon key can read entire tables.
Never Bundle service_role
A Supabase service_role JWT bypasses every RLS rule completely. Always audit built JS bundles with VibeShield v7.0 before shipping to catch accidental NEXT_PUBLIC_ leaks.