Skip to content
ShipSafeStack

Checklist

Supabase row level security checklist

Supabase row level security checklist: RLS on every public table, a policy per action, and a two-user test. The anon key stays in the client.

Updated 11 Nov 2026

This is a practical checklist, not a guarantee. It is not a penetration test, a compliance audit, or proof that an app is safe to launch.

Supabase gives the browser a publishable anon key. That key is supposed to be public. Row level security is what stops it from reading every row. Many generated apps create tables and forget the policies. The products around this database are in Database and auth. Per-builder lists are under Ship guides.

Official reference: Supabase Row Level Security. Worked policies, each with the case it fits and the mistake that undoes it, are in Supabase RLS policy examples. The setup that creates them on a new project, plus the "RLS is on but the rows still come back" cases, is how to set up Supabase row level security.

How to check Supabase row level security

Open every table in public. The copy-paste policies live on the setup page linked above. This list is the check after those policies exist.

Policies on every public table

  • Open the table in the Supabase dashboard and confirm RLS is enabled. A table with RLS off is readable and writable by anyone who has the anon key and the URL.
  • Do not “fix” a failing query by disabling RLS. Fix the policy, or move the query to a server that uses the secret key.
  • Add separate policies for select, insert, update, and delete. A policy that only covers select still lets a client insert rows.
  • Write the condition so it checks auth.uid() against an owner column, or membership in a team table. using (true) allows every signed-in user, and sometimes every request.

Where the anon key and the secret key go

  • The anon key may live in the frontend. The service_role key must not. Search the client bundle and the repo. If the service role key has been in the browser or in git, follow Supabase service role key exposed: take it out of the client, put a new secret key only on the server, then retire the old key.
  • Prefer the server, or a Supabase Edge Function, for anything that must bypass RLS. The bypass is the dangerous part. Keep it small.

Prove it with two users

  • Create two accounts. As user A, insert a row. As user B, request that row with the same anon key the app uses. You should get nothing back.
  • Repeat while logged out. The anon key alone should not return user A’s rows.
  • Read the response in the browser network panel. A 200 with an empty array is a pass. A 200 with the other user’s email is a fail.

Storage and views

  • Check Storage buckets. A private table with a public bucket still exposes files.
  • Views and functions can bypass your expectations. If a view is owned by a privileged role, RLS on the underlying table may not protect the view. Test the view with the anon key too.

After you change a policy

  • Re-run the two-user test. Builders regenerate client code. They do not always regenerate policies, and a later prompt can add a table with RLS off.
Not a guarantee. Policies can be wrong in ways a two-user test does not catch, including joins and functions. This is a checklist, not a certification.

FAQ

How do I know row level security is actually on?

Open the table in the Supabase dashboard, or run the enable statement, and confirm the table shows RLS enabled. Then call it with the anon key the app ships, as a second user and while logged out. A 200 with an empty array is the result you want for someone else's row. A 200 that contains their email means the policy or the grant is still open.

Is the anon key supposed to be in the client?

Yes, when row level security is on and the grants match the policies. Supabase documents the anon key and the publishable key as client keys. The secret key and the service_role key are not. If that elevated key is in the bundle or the repo, use Supabase service role key leaked.

Does one select policy cover insert and delete?

No. Add a policy for each of select, insert, update, and delete. An insert policy uses with check. A select policy does not stop a client from inserting. using (true) allows every row that role can already reach.

What if the app breaks after I turn RLS on?

Fix the policy or the grant. Do not turn RLS off to make the query work. Turning it off returns the table to whatever the grants already allow, which on many generated projects is every role. The setup steps and the "RLS is on but the rows still come back" cases are in how to set up Supabase row level security.

Informational only. This page describes checks and vendor documentation. It is not a security audit, a penetration test, or a certification, and it is not a guarantee.

Newsletter

A short weekly note on new tools and security checklists. No spam, unsubscribe anytime.