Sitral.AI
← Blog
Supabase

Supabase and RLS explained simply: why your database might be open

What Supabase access rules are, why a table without RLS is public, and how to check yours without knowing how to code.

· 2 min read

If you built your app with Lovable, Bolt, or a similar tool, your data is very likely in Supabase. And there is one single setting that decides whether that data is private or whether anyone can read it. It's called RLS.

How your app talks to the database

In a traditional app, the browser asks a server for things, and the server decides what to show each person. With Supabase, the browser talks directly to the database, using a key that comes inside your site.

That key, the anon key, is public on purpose. It's not a mistake that it's visible. But then what stops someone from copying it and asking for all the data?

That's what RLS is for

RLS stands for Row Level Security. These are rules that live in the database and answer one question for every piece of data: can this user see or change this row?

A typical rule says: "each user can see only their own orders."

  • With RLS on and well-written rules, even if someone copies the public key, the database only gives them what belongs to them.
  • With RLS off, the public key is enough to read the whole table. And often to change or delete it too.

Why it happens so often in apps built with AI

Because the app works the same with RLS off. In fact, it works better, because nothing blocks any request. When you're testing and something won't load, the fastest fix is to turn the rules off. The problem gets "fixed" and the table is left public.

The opposite also happens: RLS stays on, but with a rule that lets everyone through. The result is the same.

How to check yours

  1. Go to your project in Supabase.
  2. Open the Table Editor and look at each table: it has to say RLS enabled.
  3. Open Authentication → Policies and check that every table has policies, and that they don't simply say true.
  4. Supabase includes a Security Advisor that flags unprotected tables. Take a look at it.

A policy that says true means "anyone can." If you see one on a table with user data, it needs to be fixed.

The three warning signs

  • A table with personal data that says RLS disabled.
  • Policies that allow everything for everyone.
  • The service_role key inside the site's code. That key bypasses all the rules; it should never be in the browser.

What can't be seen from the outside

A review from the outside can tell you if you have an admin key exposed, but it can't see your rules. For that, someone has to go into the project. It's exactly the first thing we review in the Sitral audit, and what we fix before publishing.

If you want to start with what can be seen from the outside, ask for the free check.

Does your site have any of these problems?

Send us your site: we'll look at it ourselves and, within one business day, tell you what's visible from the outside.

Check my site for free

Keep reading