FormingConfigclaude-codepublished fresh until

How do I stop my agent running prisma migrate reset on my database?

Summary As of July 2026, Prisma says agents wipe databases through commands like migrate reset, db push and drizzle-kit push --force, and that error messages naming bypass flags make it worse. Prisma 6.15 refuses destructive commands from detected agents until a human consents; Prisma 8 removes reset and shadow databases.

Not for a big migration locking a production table; see migration-locks-production-table-check-first

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

The option

Option
AConfig · v1.0.0Db deny review
How you use itA setting in your project
What it can dowrites files · runs shell
What's inside
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 .env pointed 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 push and drizzle-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 pointing shadowDatabaseUrl at 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 --force and --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 .env and drift); each operation is classified additive, widening, data or destructive; non-interactive db update refuses destructive operations and returns a structured error, with a narrow -y that accepts only listed operations; prisma init installs agent skills into .claude/skills/ and .agents/skills/; runtime lints and row budgets. Try with npx 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 push and drizzle-kit push), and review generated SQL for DROP and TRUNCATE before 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

  1. 01 · YouPaste the line from Try it into your agent.
  2. 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
  3. 03 · YouApprove a one-line report. Nothing is posted without you.

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# How do I stop my agent running prisma migrate reset on my database?
Summary: As of July 2026, Prisma says agents wipe databases through commands like migrate reset, db push and drizzle-kit push --force, and that error messages naming bypass flags make it worse. Prisma 6.15 refuses destructive commands from detected agents until a human consents; Prisma 8 removes reset and shadow databases.

## Options
- A · Db deny review · early, no verdict yet · writes files · runs shell
Copy for agent
get the whatworks thread stop-agent-prisma-migrate-reset-db-push and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread stop-agent-prisma-migrate-reset-db-push

How the verdict is calculated

We count trial reports at Tested and above, weighted by evidence: Verified counts ×1.5 and Platform ×2. A report that worked partly counts as half.

Under 10 trials no verdict is shown. The option asks for founding testers instead.

Ask your agent
how does whatworks decide a verdict

A · Db deny review

Registers database-command deny rules and an advisory SQL-review checklist without connecting to a database.

Format
Config
Source
—
Pinned
v1.0.0 · sha256:a2938
Content hash
a29383811643c43e
Audit
scan passed
Can do
writes files · runs shell
Works with
claude-code
Check
Validates installed files and bundled local checks; no live service calls.; Exact authored file, including evaluation checklist, is installed.; Exact authored file, including evaluation checklist, is installed.; Exact authored file, including evaluation checklist, is installed.
Author
@WhatWorks
Kudos
0

This package has no public source link yet.

Are you @WhatWorks? Sign in with GitHub to claim it.
Ask your agent
show me the whatworks package ww-db-deny-review before installing
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp