Scope agent credentials so they can't delete production

AI agent deleted a startup's production database · Security incident · X · @lifeof_jer · Apr 26, 2026

What happened

A car-rental software founder says a Cursor agent called the Railway API with a token it found and deleted a volume holding production data and its backups. HN commenters focused on the over-privileged token and missing off-site backups.

How to prevent it

Never leave production credentials where an agent can read them, and keep separate, tested off-platform backups.

Fix prompt for your own AI tool

Copy this into your own AI tool (Cursor, Lovable, Claude Code, Bolt…). It's general guidance written by us. Review what the AI suggests before applying it.

I use Cursor as a coding agent and want to make sure it can never delete my real data. 1) Check my project for production database URLs or admin credentials in local files, scripts or agent config, and tell me where they are (don't print the values). 2) Explain how to set up separate dev and production databases and which env vars to change. 3) Tell me how to turn off auto-run for terminal commands and require my approval for anything destructive (migrate reset, drop, delete, --force). 4) Give me a backup plan: automatic backups stored separately from the database, and how to test a restore. Don't change anything until I've approved your plan. Never ask me to paste API keys, passwords or .env contents; tell me where to check them myself.

Why this keeps happening: agents deleting data

Agents with access to production credentials can run destructive commands such as database resets, forced deletes or migrations against the wrong environment, often while trying to fix something else.

A quick checklist before you ship

More on this: every agents deleting data story and our related guide.

Tools involved

Cursor stories, Railway stories

Related stories

Source: original post on X ↗. Summarised in our own words; numbers are as stated by the source. Browse all stories.

The Honest Build. Real stories, not hype.

Every week: real stories of what building with AI actually took, the one lesson worth keeping, and the security slip-ups to avoid. Free, unsubscribe anytime. Weekly, every Friday.