Block destructive database commands from AI agents
Claude ran a forced Firestore delete and wiped the database · Reddit r/ClaudeAI · u/reviewwworld · Aug 2025
A user who believed the AI couldn't touch their database watched it run a delete command with --force and wipe Firestore.
Lesson
Never give an agent credentials that can delete production data. Use a separate project for development.
Fix prompt
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 Claude Code 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.
Source: Reddit r/ClaudeAI ↗