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

> Source: <https://dev.to/amneeksingh/an-ai-agent-deleted-production-in-9-seconds-i-checked-what-mine-could-reach-1cfn>
> Published: 2026-12-02 18:37:26+00:00

**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 the playbook "Securing agents and AI tools": <https://wpnews.pro/playbooks/agent-security>

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](https://github.com/amneeksingh/prodlock)

*I built prodlock; this post is about why.*
