ENFR
Back to blog

Is Your Supabase Database Open? What Founders Should Check

Many apps built with AI tools keep their data in Supabase. One feature decides whether strangers can read that data. Here is what it is, and how to check it yourself in a few minutes.

A wall of closed mailboxes in an apartment hall, with one hanging open and letters spilling on the floor
Short answer

Your Supabase database is open if a table has row level security (RLS) turned off, or if its rules let anyone read every row. The public key in your app is meant to be seen, but it is only safe when RLS is on and the rules are right. Check it in the dashboard: every table should have RLS on, each rule should limit users to their own data, and the secret key should never be in the browser.

Supabase is a popular database service, and many AI builders use it to store an app's data. It is a good tool, and it gives you strong ways to protect your users. But one of them has to be set up correctly, and in apps built quickly it often is not. The result is a database that anyone can read with a few lines of code, while the app looks perfectly normal on screen. This article explains row level security in plain words, why it is so often missing, how to check your own project, and what to do if you find a problem. It goes deep on one point. For the full list of security checks, see our security checklist for an app built with AI.

How your app talks to Supabase

In a classic app, the browser asks your server for data, and the server asks the database. Many Supabase apps skip that middle step. The code that runs in the browser talks to the database directly, through Supabase's API (the address the app sends its requests to).

To do that, the browser code contains two things: your project address and a public key, called the anon key (newer projects may call it the publishable key). Anyone can open the browser's developer tools and see both. That is normal. Supabase designed it this way, and the key is meant to be public. The real question is what someone can do with it.

What row level security is

Row level security, or RLS, is a feature of Postgres, the database inside Supabase. It lets you write rules, called policies, that say who may read, add, change or delete each row of a table. A row is one record: one order, one message, one customer profile.

Think of your app as a building. The public key is the key to the front door, and every user has a copy. RLS is the lock on each apartment. With the locks in place, a visitor in the hall can only enter their own apartment. Without them, every door is open to anyone who walks in.

A good rule for a table of orders says, in plain words: a logged-in user may read an order only if it belongs to them. If RLS is turned on and a table has no rules at all, nobody can read it with the public key. That is safe, but your app will show empty screens until the right rules exist.

The public key in your app is not the leak. A table without locks is.

Why apps built with AI tools often launch with it open

To be fair to the tools: AI builders get a lot right here, and some now create rules and warn you about open tables. That helps. But a rule that exists is not always a rule that is right, and a warning only helps if someone reads it.

How to check in the dashboard

You need access to your Supabase project. You do not need to write code.

Then do the two-account test from the checklist: log in as one user and try to open another user's data. These checks find most open doors, but not all of them. Some parts of the database, such as views and functions, can skip RLS when they are set up in a certain way. Those need someone who can read SQL.

What to do if you find a problem

Why a second pair of eyes helps

The person who writes a rule tends to test the case they had in mind. An AI is the same: it writes rules that look right and match the request, and then it moves on. Nobody checks the case nobody thought of.

A reviewer works the other way round. They try to read your data as a stranger would, with only the public key, calling the database directly instead of using your screens. They read every policy, every view and every function, and they check where each key is used. It is a small job compared with the cost of a leak, and it gives you a clear list ranked by risk. At Swipe Up, the database rules are the first thing we check when we finish an app built with AI. If you want a first view on your own, our free launch check shows in two minutes which points are still open.

The bottom line

Supabase gives you the locks. You still have to fit them. Turn RLS on for every table, make sure each rule limits users to their own data, and keep the secret key on the server. Then move on to the rest of the list: logins, payments, uploads and limits. Problems in those areas look different, but they come from the same cause, which we describe in why AI prototypes break with real users.

Not sure your database is closed?
Start with a fixed-price audit.

We run your app, read the code and tell you exactly what it takes to launch: one honest recommendation, a fixed scope and a timeline.

More from the blog