blog / security
Is your Supabase leaking? RLS checks for vibe coders
Most AI-built apps on Supabase ship with tables anyone can read. Here are the four ways it goes wrong, and how to check your own repo in two minutes.

If you built your app with Lovable, Bolt, Cursor or Claude Code on top of Supabase, there is a good chance anyone on the internet can read your users' data.
That is not a scare line. One study sampled 1,645 Lovable apps and found roughly 70% had Row Level Security (RLS) disabled. In May 2025, more than 170 Lovable apps exposed whole user tables to a single anonymous request — no login, no exploit.
Why this happens
Supabase ships the anon key to the browser on purpose. It is not a secret. What protects your data is RLS: rules in the database that decide which rows each user may see or change.
AI agents are great at building screens. They are much worse at remembering that every new table needs a policy. And because the app works, nobody notices.
The four mistakes
- RLS is off. Without RLS, the anon key can read and write every row of the table.
- RLS is on, but there is no policy. This blocks everything — safer, but the agent often "fixes" it with step 3.
- A policy that allows everything.
using (true)looks like a policy and Supabase shows RLS as enabled — but it restricts nothing. - The service-role key in the wrong place. The service-role key skips RLS completely. If it ends up in frontend code or a public route, every rule you wrote is gone.
Two cousins of these show up in API routes too: writes without validation (the request body goes straight into the database) and routes with no auth check.
How to check your own repo
Bettr's codebase map has a Flow lens that follows each data flow from the client, through the API route, to the database. It flags:
rls-offandno-policyon tables in your SQL migrationsservice-rolewherever the service-role key is usedwrite-without-validationandno-authon routes
Open the codebase map, pick the Flow lens, and every flagged flow is listed with the file and line. Then press Ask agent to fix — Bettr hands the exact finding to the agent in your pane, and it adds the missing policy, validation or auth check the way your codebase already does it.
The lens shows where to look; your agent does the judging. Flows are found by pattern (fetch/axios, Next.js and Express routes, Supabase, SQL migrations), so if a flow you expect is missing, ask your agent to trace it by hand.
Frequently asked questions
Is the Supabase anon key a secret? No. It is meant to be public. Your data is protected by Row Level Security, not by hiding the anon key.
Does turning RLS on break my app? It can, until you add policies. RLS with no policy blocks all access — add a policy per table for what each user should see.
Can I check RLS without Bettr? Yes — review every table in the Supabase dashboard and read each policy. Bettr's Flow lens just finds the risky spots in your code for you and lets your agent fix them.


