Supabase RLS checklist for AI-built apps (2026)
Updated 2026-10-25 · Trustfield
Short answer: the anon key is public. Your data is safe only when every table and storage bucket has RLS enabled plus a policy that limits rows to the right user. If a table has no policy, the API returns nothing — that is fine. If RLS is off, the API returns the table.
The checklist
- RLS on for every table in the public schema, including join tables and audit logs.
- A policy exists for each operation you need (select/insert/update/delete). “RLS enabled but no policy” blocks everything — fine for a private table, broken for your own reads.
- Policies filter by the user, for example
using (auth.uid() = user_id), not justusing (true). - Storage buckets need policies too. A public bucket is public forever, including old uploads.
- service_role never reaches the client. It bypasses RLS. Server-only.
- Security-definer SQL functions need a fixed
search_pathand an explicit permission check; otherwise they become a public RPC. - Views created with
security_invoker = falserun as the owner and can bypass RLS — check them. - Test with the anon key, not the dashboard. The dashboard uses a privileged connection and hides the problem.
Test it in 60 seconds
Paste your project URL and anon key into the free checker: /tools/rls. It lists tables and shows which ones return rows to the public key. For the full report — keys in your bundle, webhooks, AI prompt injection — run the free scan.
Trustfield is an external, read-only review. Not a penetration test and not a certification. Methodology · Security