# The 10-Minute Database Check Every Vibe-Coded App Needs Before Launch

**Quick Answer:** This vibe coded app database security checklist takes ten minutes and catches the most common data leak in AI-built apps. You run one audit query in Postgres to find tables with Row Level Security turned off. You then turn RLS on and add one policy per table so users only see their own rows. Finally, you verify like an attacker by testing anonymous reads, cross-user reads, leaked keys, and storage buckets. Ten minutes now is cheaper than a breach later.

A vibe-coded app can go from idea to working demo in a weekend. I have seen it happen many times. The app looks done. The buttons work. The screens load fast. But the database underneath may be wide open to the internet.

On September 25, 2026, security firm UpGuard reported 16,326 Supabase databases with tables readable by anyone on the internet. They found them by scanning roughly 300,000 domains. More than half of those databases showed signs of personal data.

TechCrunch covered the story. A valet service was exposing customer records. An immigration service was exposing thousands of user records, some with plaintext passwords. These were not attacked servers. The doors were simply left open.

This post is your vibe coded app database security checklist in the form of a timed drill. Set a timer. Ten minutes. You will find open tables, lock them down, and verify the lock held.

## First, Know What Row Level Security Actually Does

Row Level Security, or RLS, is a Postgres feature. It attaches access rules directly to a table. The database itself decides which rows each request may see. Your app code does not make that decision. The database does.

Supabase gives you two keys when you create a project. The anon key, also called the sb_publishable_ key, is meant to be public. It identifies your project in requests from the browser. It is fine that users can see it. RLS is what stops that public key from reading everything.

The service_role key is different. It bypasses RLS completely. It can read and write any row in any table. It must never sit in client code, in a frontend bundle, or in a public repo. If a user opens your browser dev tools and finds the service_role key, they own your database.

## Why AI Coding Agents Leave Tables Open

Here is the root cause. Tables created in the Supabase dashboard get RLS turned on by default. Tables created with raw SQL through the API do not. AI coding agents create tables with raw SQL. That is how the doors get left open.

Postgres does not enable RLS on new tables by default either. So the agent creates the table, writes the queries, and moves on. Everything works in testing because the agent tests with full access. Nobody notices the missing rules until a scanner finds them.

The scale of the problem is real. CVE-2025-48757 documented hundreds of endpoints behind AI-built apps that were publicly readable. Most had the same root cause. Tables with no access rules, readable with a public key.

## Minute 0 to 2: Start the Vibe Coded App Database Security Checklist

Minutes zero to two are about discovery. You need a list of every table in your database. You also need to know which ones lack Row Level Security. Open the Supabase SQL editor and run this audit query.

```sql
select schemaname, tablename
from pg_tables
where schemaname = 'public'
  and rowsecurity = false;
```

This returns every public table with RLS turned off. Any table on this list is readable by anyone holding your public anon key. Treat each row as an open door.

### Run the Bonus Query for Tables With Zero Policies

RLS turned on is only half the job. A table can have RLS on and still have zero policies attached. Run this second query to catch that case.

```sql
select tablename, count(policyname) as policy_count
from pg_tables
left join pg_policies
  on pg_tables.tablename = pg_policies.tablename
where pg_tables.schemaname = 'public'
group by tablename
having count(policyname) = 0;
```

Tables on this list have RLS enabled but no rules. Write them down. You will add policies in the next step.

## Minutes 3 to 7: Lock the Tables Without Breaking the App

Now you lock things down. The pattern is simple and you repeat it per table. First, enable RLS on the table. Then add one policy for reading and one for writing, each limited to the logged-in user's own rows.

Here is the lock-down query for a table with a user_id column. Change the table and column names to match your schema.

```sql
alter table bookings enable row level security;

create policy "read own rows"
on bookings for select
using (auth.uid() = user_id);

create policy "update own rows"
on bookings for update
using (auth.uid() = user_id);
```

auth.uid() is the id of the currently logged-in user. The policy says the database will only return rows where user_id matches that id. One policy per table is often enough to start. You can add more later for admins or shared access.

### RLS With No Policies Means Deny Everything

This surprises people. If RLS is on and a table has zero policies, every request gets denied. Anonymous requests return nothing. Logged-in users also get nothing. The app shows empty screens.

Do not panic if that happens after step two. It means RLS is working. You just have not added policies yet. Add one policy per table, re-test, and the screens will fill back in with only the right data. I cover this check in my production-readiness checklist. Database security is one of its core checks.

## Minutes 8 to 10: Verify Like an Attacker

The last two minutes are verification. You locked the tables. Now you try to break the lock. Attackers are patient and creative. Be more creative than them.

### Step 1: The Anonymous Read Test

Open a new browser window where you are not logged in. Hit your app's data endpoints with only the anon key. You should get nothing back for protected tables. If you see real rows, a policy is missing or wrong.

### Step 2: The Cross-User Test

Create two test accounts. Log in as user A. Try to read rows that belong to user B. User A must not see a single row of user B's data. This is the test that matters most. Many apps pass the anonymous test but fail this one.

### Step 3: Hunt for the service_role Key

Search your entire repo for service_role. Search your client code, your environment files, and your frontend bundles. The service_role key belongs only on the server, in backend code that never ships to a browser. If you find it in client code, rotate it immediately in the Supabase dashboard.

### Step 4: Check Storage Bucket Policies

Tables are not the only target. Supabase storage buckets have their own policies. A locked table means nothing if uploaded files sit in a public bucket with no rules. Check that private files need authentication to download. This full verify routine is part of the vibe coded app database security checklist. It only works if you run every step.

## A Booking App That Nearly Launched Open

A founder asked me to check a vibe-coded booking app before launch. The app looked finished. Customers could sign up, book slots, and pay. The demo impressed everyone.

I ran the audit query from minute zero. The users table and the bookings table both had RLS off. Anyone with the public anon key could list every customer and every booking. Names, emails, booking times, all of it.

We enabled RLS and added one policy per table, exactly the pattern from this drill. Anonymous requests then returned nothing. Logged-in users saw only their own bookings. The whole fix took under ten minutes. The launch went ahead the same day.

In my piece on fixing vibe-coded applications I walk through this exact workflow. The database check is where I start. AI speeds up the build, as I describe in how I use AI during software development. That speed makes the security review more important, not less.

## When to Repeat the Vibe Coded App Database Security Checklist

Do not run this once and forget it. Run the drill before every launch. Run it after every migration. Run it whenever an AI agent touches the schema. Agents create tables with raw SQL, and raw SQL tables skip the dashboard defaults.

Add it to your launch runbook as a required step, not a nice extra. Postgres tuning matters for speed. I cover that in my Postgres full-text search optimization guide. But speed means nothing if the data is public. Security first, then speed.

## Frequently Asked Questions

### Is it safe to use the Supabase anon key in my frontend code?

Yes, the anon key is designed to be public. It only identifies your project. What keeps it safe is Row Level Security on your tables. If RLS and policies are in place, the public key can only read what the policies allow. If RLS is off, the public key can read everything.

### Can I turn on Row Level Security after my app is already live?

Yes, you can turn it on at any time. Add the policies first, then enable RLS, or do both in one sitting. Test right after with the anonymous read test and the cross-user test. Watch for empty screens, which mean a table needs a policy you have not added yet.

### How do I know if my AI coding agent left my database open?

Run the audit query from this post. It lists every public table with RLS off. Tables created by AI agents through raw SQL are the usual suspects. If your app was built with an AI coding tool, assume it needs this check. Prove otherwise with the query.

### Does RLS slow down my app?

For most apps, no. The policy check runs inside the database and adds very little time. If you have millions of rows, keep the policy columns indexed. A simple index on user_id keeps the row lookup fast. Measure before you worry.

### What happens if I enable RLS but forget to add a policy?

Every request gets denied. The app will show empty screens or error states. This is actually the safe failure mode. Add one policy per table so logged-in users can read their own rows. Then re-test, and the screens will fill in correctly.

### Can a user see another user's data if I filter by user_id in my app code?

App-code filters are not enough. Anyone can call your API directly and skip your filters. RLS enforces the rule inside the database, so it applies no matter how the request arrives. Always enforce row access at the database level, and treat app filters as a convenience only.

### Is the service_role key the same as the anon key?

No. The anon key is public and respects RLS. The service_role key bypasses RLS entirely and must stay on the server. Never put it in frontend code, mobile app bundles, or public repos. If it leaks, rotate it from the Supabase dashboard right away.

### How often should I run this database security check?

Run it before every launch and after every migration. Also run it whenever an AI agent changes your schema. Make it a permanent step in your launch runbook. Ten minutes of checking beats weeks of damage control after a breach.

## Ten Minutes Now Beats a Breach Later

The UpGuard report proved one thing. The most common database breach is not a clever hack. It is an open door nobody checked. This drill closes those doors in ten minutes.

If you want a second pair of eyes on your app before launch, get in touch with me. I run security reviews for vibe-coded apps, and this ten-minute check is where every review starts.

Sources: sekrd summary of the UpGuard report, Supabase RLS troubleshooting guide, AgileSoftLabs RLS guide.
