Guide · Supabase
Supabase RLS explained in plain English
RLS, short for row level security, is the set of rules in your Supabase database that decides who can read and change which rows. Your app hands every visitor a public key to reach the database, so these rules are the only thing standing between a stranger and your customers’ data. Supabase’s own advice is to turn it on for every table your app can reach.
What does row level security mean?
Think of your database as a filing cabinet and each row as one card in it: one customer, one order, one message. Row level security puts a rule on each drawer saying whose cards a person may take out. A good rule says “each customer sees only their own cards”. Supabase describes it as authorization rules “that run inside the database”, which matters: the rule holds even if someone skips your app and talks to the database directly with your public key.
Why does it matter for an app built with AI tools?
Claude, Lovable, Bolt, Cursor and other AI tools build apps that talk to Supabase straight from the visitor’s browser, using the public key. That key is meant to be public. The rules are what make it safe, and they are the part an AI tool is most likely to leave out, because the app works perfectly without them.
The three states a table can be in
- Row level security off. Anyone with your public key can read the whole table, and often change it. Supabase warns about this as RLS disabled in public.
- On, but no rules. Locked to everyone. In Supabase’s words, no data is reachable with the public key “until you create policies”, so your app shows nothing. That is the RLS enabled, no policy case, and the fix is a rule, not switching security off.
- On, with rules. The safe state, as long as the rules say the right thing. A rule that lets every signed in user read every row keeps strangers out but still lets one customer see another’s data.
How do I check mine?
- In Supabase: the Security Advisor lists any table where row level security is off.
- From your AI tool: ask it to list every table and its rules in plain words, with the request below.
- As two users: sign up as two test customers and make sure neither can open the other’s data.
Paste this into Claude, Lovable, Bolt, Cursor or whichever tool built your app:
List every table in my Supabase database. For each one, tell me whether row level security is turned on and which rules (policies) it has, in plain words: who can read it, who can add to it, who can change it and who can delete it. Turn row level security on for every table that does not have it. Anything about a person should be readable and changeable only by that person. Show me the list before and after.
Then check from the outside, the way a stranger would. Our free database check finds your app’s public key the way a visitor’s browser does and shows which tables it can read. It cannot see what a signed in user can reach; that is the two user test above.
GuardCue checks apps built with AI tools and explains what it finds in plain English, for the person who built it rather than for a developer. Check your database, free.