Vibe coding · your database
Vibe coding with a real database: the safety checklist
AI coding agents write the app, run the migrations and connect to whatever database your project points at. That is the speed, and it is how production data gets deleted, leaked or left open. Ten checks, each with a guide and commands tested on real servers.
If it already happened
An AI agent deleted my database. What now?
Stop the agent, save what is left, restore, verify. Read it now; the recovery window is counting down.
The checklist
- 1
Production credentials are not in any file your AI agent can read.
How to keep AI coding agents away from your production database → - 2
The agent works against a development database or branch, not production.
How to keep AI coding agents away from your production database → - 3
Any production access the agent has is read-only, with a statement timeout.
How to keep AI coding agents away from your production database → - 4
Your AI tool asks before it runs database commands, and denies the ones that wipe data.
Make your AI coding agent ask before it touches the database → - 5
You read every migration the agent writes before it ships.
Make your AI coding agent ask before it touches the database → - 6
Every table your frontend can reach has row level security with real policies.
Is your Supabase data public? Check row level security in two minutes → - 7
No secret key or database URL is in your built JavaScript or your git history.
Is your app leaking API keys to the browser? → - 8
You have a backup you have actually restored, and point-in-time recovery switched on.
Back up your database before you let an AI agent near it → - 9
You know what you would do in the first hour if an agent deleted data.
An AI agent deleted my database. What now? → - 10
You know how you would move the database if you outgrew the platform.
Moving your database off Supabase →
All guides
How to keep AI coding agents away from your production database
Cursor, Claude Code and Copilot connect with whatever your .env holds. Six layers that stop an AI agent from deleting or leaking production data.
Is your Supabase data public? Check row level security in two minutes
Your Supabase anon key ships in your app, so a table without row level security is open to anyone. SQL to find exposed tables, open policies and views.
Is your app leaking API keys to the browser?
VITE_, NEXT_PUBLIC_ and EXPO_PUBLIC_ variables ship to every browser. Find the secrets an AI-built app leaks, which keys are fine, and what to rotate.
Back up your database before you let an AI agent near it
One command each to back up PostgreSQL, MySQL and MongoDB, restore it into a scratch database, and prove it works before an AI agent touches the real one.
Make your AI coding agent ask before it touches the database
Coding agents can run prisma migrate reset or drizzle-kit push on their own. Settings and deny rules that make Claude Code, Cursor and Copilot ask first.
Moving your database off Supabase
Export a Supabase database with pg_dump, what stays behind (auth users, storage files), the role errors on restore, and a cutover without downtime.
Let AI agents use your data, not your database password
Airlock gives agents scoped tokens: read-only by default, personal data masked, every request logged, and a switch that stops them all. No API key or AI tool can change those rules. Free to start.