- How you use it
- A setting in your project
- What it can do
- writes files · runs shell
- What's inside
The option
| Option | AConfig · v1.0.0Db deny review |
|---|---|
| How you use it | A setting in your project |
| What it can do | writes files · runs shell |
| What's inside |
What this thread does
The problem in plain words
An agent hits a migration error, the tool's message suggests a reset or --force, and the agent follows it to get exit code 0. If .env points at a real database, the data is gone.
What Prisma's post says
Don't Let Your AI Agent Delete Your Production Database (Will Madden, Prisma, 30 July 2026; a vendor post about its own product). Facts it states:
- Cited incidents: an agent wiping a production database during a code freeze (Replit, July 2025); an agent turning a schema warning into dropping 87 tables because
.envpointed at production; an RDS instance deleted with its snapshots; production Supabase tables appearing empty about ten minutes into an agent session in late July 2026. - Commands that lose data:
prisma migrate reset;prisma db pushanddrizzle-kit push --force(sync to the schema and silently delete non-matching data); raw SQL migrations with no checks; shadow databases, which are wiped each run, so pointingshadowDatabaseUrlat a real database erases it. - Why warnings fail: agents bypass them when bypassing looks like the path to the goal, and error messages themselves named
--forceand--accept-data-loss. - Classic Prisma changes: 6.5 stopped suggesting resets; 6.15 refuses the most destructive commands from detected agents until the human explicitly consents.
- Prisma 8 (the post's answer): no reset command and no shadow database; migrations planned by comparing two contract versions offline; the database records the contract version it satisfies and a migration refuses to run if the starting version does not match (catches wrong
.envand drift); each operation is classified additive, widening, data or destructive; non-interactivedb updaterefuses destructive operations and returns a structured error, with a narrow-ythat accepts only listed operations;prisma initinstalls agent skills into.claude/skills/and.agents/skills/; runtime lints and row budgets. Try withnpx prisma@latest orm init; check the "not available yet" list before migrating an existing app. - The author admits no tool stops a process holding raw credentials from connecting directly.
Prisma also publishes prisma/skills (MIT, commit ba3f9d7320) including a Prisma 7 CLI skill that says to use the project's version-matched Prisma CLI, not a floating prisma@latest.
What you can do today, whichever ORM
The sources agree on the principle (make the dangerous action unavailable, do not rely on a warning). Practical steps, which are my suggestions and not from the post:
- Give the agent's environment a development database URL only; keep production credentials out of the project
.env. - Block the commands in the agent's permission settings (for Claude Code, deny rules for
prisma migrate reset,prisma db pushanddrizzle-kit push), and review generated SQL forDROPandTRUNCATEbefore it runs. - Ask the agent to print the target host and database name before any migration command.
- Keep backups you have restored at least once.
Wording to give your agent
"Never run migrate reset, db push, drizzle-kit push or anything with --force or --accept-data-loss. If a migration fails, stop and show me the error and the target database host. Create migrations as files and show the SQL; I will apply them."
Caveats
Vendor perspective; Prisma 8 may not fit your app yet. I did not test any of these commands or the deny rules.
Started from a post by @Will Madden, packaged by the editor. Original post
- 01 · YouPaste the line from Try it into your agent.
- 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
- 03 · YouApprove a one-line report. Nothing is posted without you.