← Back to the feedTool ·

Vibecoding with Supabase? Quick Security Check

3 min read

If you’re a fellow vibecoder who’s been building with Supabase, but don’t really know what you’re doing (like me), then you should know that there’s a common security issue that could expose data stored in your Supabase database.

Now I love Supabase, because I don’t have to deal with a backend anymore. It’s just frontend and database, no backend in between. That makes it a lot easier and faster to build an app.

But in order for that to work, the app ships with a public key (called the anon key or publishable key) inside the code that runs in the browser. Anyone can see this by just poking around with their browser’s dev tools.

And that’s fine. This public key is kinda like the street address of a bank.

Now there’s something else and you’ve probably seen it and not really understood what it is: RLS (Row-Level Security). It’s like a set of rules on each table, and it says things like “a user can only read their own messages”.

If RLS is on and the rules are defined properly, you’re good.

If RLS is off, or the rules are too loose though, anyone with the public address can download the entire table from your database.

(There’s also yet another key, the service_role or secret key, which is kinda like a master key. Anyone who has that can just bypass RLS and download anything anyway, which is why you want to keep that very secret and never expose it in your frontend.)

AI agents often don’t enable RLS

When you create a table in the Supabase dashboard, it pushes you to turn RLS on. But AI agents don’t do that, and oftentimes you get tables with RLS off.

Sometimes AI agents also set things up correctly, but then run into a permission issue, and agents often are a bit singularly focused. “There is a permission error here. I will just disable the need for permissions, so that I can get the thing done I’m asked to get done.” They basically disable the lock at the door and leave the door open for everyone.

Now Supabase has rolled out a fix that was applied to all existing projects on October 30, 2026, but any table that already existed keeps its old permissions.

What to do

Log into Supabase, open your project, and look at the Security Advisor. There it would show you if there are tables in the public schema without RLS.

Or you just use an AI agent. Put this prompt into Claude Code, Codex, Cursor, or whatever your coding agent of choice is:

Audit my Supabase database security. Don't change anything yet, just report.

1. List every table in the public schema and tell me whether Row-Level Security is enabled on each one.
2. For every table, explain in plain English who can read, insert, update and delete rows: anyone, any logged-in user, or only the user the row belongs to.
3. Flag every table where a user could read or edit data that isn't theirs, and every policy that allows everything (like USING (true)) on data that should be private.
4. Check whether the service_role or secret key appears anywhere in frontend code or in environment variables that get shipped to the browser.

Then propose fixes that keep the app working. Don't fix a permission error by loosening a policy. For each fix, tell me what I should test afterward with a second user account to confirm the app still works and the data is locked.
The takeaway: The public key in your app is fine. RLS is the lock. Make sure it's on for every table, and that your AI didn't loosen the rules to make an error go away.
Visit the source →