Tegoby Attention SpanBlogBook a demo

An agent deleted production in nine seconds

Strict rules refuse key steps

In April 2026, an AI agent in Cursor was working on a staging task for PocketOS, found a Railway password in a file nobody meant it to use, and with one web request deleted the disk holding the production database, backups included. With strict rules, Tego would refuse the delete: the agent can only reach the hosts you list, and Railway's API isn't one of them. We reproduced the incident's steps under these rules to confirm it.

What happened?

On Friday 24 April 2026, PocketOS's founder says, an agent deleted his production database in 9 seconds. PocketOS makes software that car rental and other rental businesses run on. He told the story in a post on X the next day. Everything here is his account unless another source is named.

The agent was Cursor running Claude Opus 4.6, on a routine staging task (work on a test copy of the app, away from real customers). His post does not say whether it was the editor, the CLI or a cloud agent, or which operating system it ran on.

The agent hit a credential mismatch. It decided "entirely on its own initiative" to fix it by deleting a Railway volume. Railway is the cloud host where PocketOS ran its database, and a volume is the disk the database lives on.

It found an API token (a password that lets a program act on your account) "in a file completely unrelated to the task". The team had made that token to add and remove custom domains through the Railway CLI. They did not know it could also delete volumes.

The agent used curl, a command-line tool that sends web requests. It sent one curl -X POST to https://backboard.railway.app/graphql/v2, with the token and a volumeDelete mutation (a GraphQL write request). "It took 9 seconds."

The volume's backups went with it. Railway's docs say so plainly: "Wiping a volume deletes all backups." His newest usable backup was three months old. He restored it and rebuilt bookings by hand from Stripe, calendars and email.

Railway's CEO posted that the user "handed a fully permissioned Railway API key to Cursor", and that Railway honours an authenticated delete. He wrote, "We've since recovered that database", and later added that Railway keeps "multiple layers of backups (user + disaster recovery)". The founder confirmed the recovery.

He told The Register that Railway's CEO stepped in on Sunday evening and helped restore the data within an hour.

Why the usual safety didn't catch it

The agent had been told not to do this. Asked why, it wrote that it had guessed the delete "would be scoped to staging only". The founder says its reply quoted a rule against destructive commands and admitted breaking it, a rule that sat in Cursor's system prompt and his project's rules. We have only his account of that reply. A rule the agent reads is advice it can argue its way past.

The token had full rights, so Railway saw a valid, signed-in request and did what it asked. Railway's CEO told The Register the call hit "a legacy endpoint" without delayed delete, since patched. A Railway employee wrote on Railway's forum on 27 April that dashboard deletes had a "two-day grace period", and that the API now has the same.

Cursor ships its own sandbox, described in its February 2026 post and its run modes page, but some modes let a command run outside it. The founder does not say which mode was on, so we make no claim about it.

How it could have been prevented

The habit that prevents this needs no knowledge of the attack: let the agent reach only the network hosts its task needs. A staging task needs the AI model and perhaps a package registry. It doesn't need the API that can delete production, so a request there should fail however the agent came by a token.

Tego does this from outside the agent, with the Linux kernel, so no argument the agent makes changes the answer. Picture the same agent run as the Cursor CLI on a Linux machine the team controls. Under Tego's strict setup, every connection to a host you didn't list is refused. Railway's API isn't listed, so curl would fail with a permission error and the delete would never leave the machine. The refusal would be written into the run's record, the log Tego keeps of what the agent did. That rule was written with no knowledge of this incident.

Two earlier steps still go through. Tego keeps a built-in list of secret files away from the agent (SSH keys, cloud credentials, .env files), but a Railway token in some other project file stays readable unless you name it. And curl itself starts; the record keeps the program and its arguments, token included.

Tego's strict setup is three built-in rule sets: the agent can't read your secrets, can only reach the hosts you list, and can only change files in the folders you name. Starting from the strict setup is the general habit; here the host rule alone is enough.

A team that drives Railway from the same machine, as this one did for domains, may need Railway reachable. Then make each Railway connection wait for a person instead of allowing it, and put the token file out of the agent's reach. In Tego's rules file, that's:

YAML
extends: [tego/no-secrets, tego/no-prod]
net:
  ask: ["tcp://backboard.railway.app:443"]   # each Railway connection waits for a person
fs:
  deny_read: ["./ops/railway-token"]         # the file that holds your token

The first line takes two of the built-in rule sets: no secrets, and no hosts you didn't name. A person answers each held connection with tego approve, tego deny or the dashboard's Approvals page, and no answer in 5 minutes counts as a refusal. Add the hosts Cursor itself needs from Cursor's network page; tego learn can propose them from one run.

Tego runs on Linux, and on a Mac or Windows inside a small Linux VM. Work pushed to a Cursor cloud agent runs where Tego is not.

The honest limit: the person asked sees where the request goes but not the volumeDelete inside it, since it's encrypted; answering "always" lets later calls through for the rest of the run; and nothing inside Railway, its backups or its delete, is visible to Tego.

The lesson

A token with full rights in a readable file is a delete button for any agent that finds it. Make the limit something the agent cannot argue with: a host it cannot reach, or a call that waits for a person. And keep one copy of your data outside the system that can delete it.

Sources (34 links)