Supabase RLS checklist for AI-built apps
Published 2026-11-01 · Updated 2026-11-06 · by Appfaryan
Short answer: Row Level Security protects a Supabase app only if it is enabled on every exposed table and each policy limits rows to their owner. Verify it by signing in as two different users and requesting each other's records through the API. Also check views, storage buckets and that the service-role key never ships to the browser.
Supabase exposes your Postgres tables to the client through its API, so Row Level Security (RLS) policies are what stand between one user's data and everyone else. Generated apps often work in the demo with RLS off or too permissive. Use this list to verify the real behavior; see Supabase's own documentation for current details.
Know what is exposed
Anything in an exposed schema is reachable with the public anon key unless a policy says otherwise.
- List every table in the exposed schema (usually public) and mark which hold user-owned or sensitive data.
- Confirm RLS is enabled on each of those tables. Tables created through SQL or migrations are not protected until you enable it.
- Remember that enabled RLS with no policies denies access to client roles, which is safe but may break features; enabling policies too broadly is the real risk.
Read the policies, not the summary
A policy that exists is not necessarily a policy that restricts.
- Look for policies that are effectively always true, such as using (true).
- Check that insert and update policies use a with check clause so users cannot write rows owned by someone else.
- Tie ownership to auth.uid() on a column the user cannot change.
- Do not base authorization on user-editable metadata.
Keys
The anon key is designed to be public. The service role key is not.
- Search the client bundle and repository for the service role key. It bypasses RLS and must exist only on trusted servers.
- Confirm server code that uses the service role key re-implements the ownership checks RLS would have done.
Views, functions and storage
RLS on tables does not automatically cover everything that reads them.
- Review views and database functions that read protected tables; check how they run with respect to the caller's permissions.
- Check storage buckets and their policies separately from table policies.
- Review any RPC functions callable from the client for who may execute them.
Prove it with two accounts
Reading policy text is not a test.
- Sign in as user A and attempt to select, update and delete user B's rows through the same client your app uses.
- Try it with the anon key and no session as well; unauthenticated access should be denied where intended.
- Repeat after every schema change or regenerated migration.
Get the questions for your own app
Describe your app or paste its public URL. HMBQ returns its top source-checked question free, no account needed. The full report and PDF are $12.99 one-time.
Find my blind spots — freeFAQ
- Does enabling RLS make my app safe?
- Not by itself. It makes the policies you write enforceable. Wrong or overly broad policies, exposed service keys and unprotected storage can still leak data.
- Is the Supabase anon key a secret?
- No, it is intended for client use and relies on RLS for protection. The service role key is the secret one.
- Can HMBQ audit my Supabase policies?
- No. HMBQ does not connect to your database or code. It turns your description or documents into questions such as which tables are protected and what test would prove it.
Sources and further reading
General guidance, not legal, security or compliance advice. Verify details against your providers' current documentation.