cd /news/ai-agents/an-ai-agent-deleted-production-in-9-… · home › topics › ai-agents › article
[ARTICLE · art-180433] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↓ negative

An AI agent deleted production in 9 seconds. I checked what mine could reach.

A developer built prodlock, an open-source Rust CLI that scans a machine for production credentials an AI coding agent could read — .env files, shell history and CLI logins — and queries each provider read-only to report what the key can destroy, without printing or uploading secret values. The tool was prompted by an April 2026 incident in which a Cursor agent at PocketOS hit a permissions error, found a Railway token in an old script and deleted a production volume along with the backups stored on it in about nine seconds. prodlock also ships an MCP server and skill for Claude Code, Cursor, Codex and Claude Desktop that forbids using credentials found in files and requires approval before destructive actions, plus backup commands that write Postgres dumps to an S3 Object Lock bucket and verify they restore and cannot be deleted.

recommendation

Scan every machine running a coding agent for reachable production credentials and scope or rotate any key that can destroy data, since agents inherit your user's file access.

more in playbook: Securing agents and AI tools
by read2 min views3 publishedDec 2, 2026

In April 2026 a Cursor agent at PocketOS hit a permissions error on a staging task. It went looking for another way through, found a Railway token in an old script, and called the API. The production volume was deleted. The backups lived on that volume, so they went too. About nine seconds, start to finish.

I read that and opened a terminal. My first question wasn't "how do I stop rm -rf". Nothing like that ran in the incident. It was one ordinary API call with a valid key. The question was: what keys can my agent read right now, and what could each one do?

Claude Code, Cursor and Codex run with your user's permissions. Anything you can open, they can open:

.env files in every project~/.zsh_history keeps every export FOO=… you ever typed)~/.aws/credentials and other CLI logins None of that is exotic. It's every laptop I've worked on.

I built a small open-source CLI to answer the question, prodlock. It looks in those places, and for each production credential it finds it asks the provider, read-only, what the key can do. No secret value is printed or uploaded.

Here it is on a demo project (fake keys, --offline so nothing leaves the machine):

 CRITICAL  Railway API token
            Can destroy: Railway services, databases and volumes the token can reach
            …and the backups you would restore from.
            Found: acme-app/scripts/deploy.sh:2 (RAILWAY_TOKEN) — in a project file your coding agent can read

 CRITICAL  Supabase service_role key
            Can destroy: read, change or delete every row in every table, ignoring Row Level Security
            Found: acme-app/.env:2 (SUPABASE_SERVICE_ROLE_KEY)

 CRITICAL  Postgres connection string  (user postgres on db.….supabase.co)
            Can destroy: drop every table in postgres, or the whole database
            Found: acme-app/.env:3 (DATABASE_URL)

Summary
  4 credentials an AI agent on this machine can reach. 4 can destroy production. 1 can also destroy the backups.

Three files, four keys, and one of them takes the backups down with production. That's the PocketOS shape exactly.

prodlock init adds an MCP server and a skill to Claude Code, Cursor, Codex and Claude Desktop. The rules: never use a credential you found in a file, ask before anything destructive.prodlock backup run dumps Postgres to a bucket with S3 Object Lock in compliance mode; backup verify --restore-to … --try-delete proves it restores and can't be deleted.

npx @prodlock/cli scan

Rust, MIT, no account, nothing uploaded. I'd love to hear what it misses, especially providers it doesn't know yet: https://github.com/amneeksingh/prodlock

I built prodlock; this post is about why.

── more in #ai-agents 4 stories · sorted by recency
── more on @prodlock 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/an-ai-agent-deleted-…] indexed:0 read:2min 2026-12-02 · —