All ideasMore in Hobbies

The AI said my key file would never be published. Then it published it, and $1,089 was stolen

The AI told a site owner to put his Anthropic API key in a .dev.vars file and said the file would never be published. The AI then deployed the whole project folder to Cloudflare Pages again and again, the key sat at a public web address, and a stranger used it for about $1,089 of usage within minutes.

$1,089one time
This one went wrong. Read what happened so you don’t hit the same problem.

How it works

  1. The AI writes setup steps telling him to paste his API key into .dev.vars and says it will never be published
  2. The AI deploys the whole project folder with the Pages deploy command, first on September 20 and repeatedly until at least October 6
  3. Every deploy puts .dev.vars at a public address
  4. On October 13 the key is stolen and used for about $1,089 of charges within minutes
  5. Support declines a refund
  6. He fixes it himself by deploying only a public folder with a check for secret files

Why it’s worth knowing

The same agent that promised the key file stayed private ran the deploys that put it on the public web.

Where it’s from

Summarized from a public post on github.com. See the original ↗

Upgraded prompt

A ready-to-use prompt for this idea, built from research on what makes AI agents do the job right: who the AI should be, the exact steps, and a check to make sure it was done the way you wanted.

1Who the AI should be
2The prompt, with the steps
3The check when it’s done
Upgraded prompts are coming soon.

Try next

Every idea is a real post from someone who tried it, summarized in our words, with a link to the original. App names are swapped for plain words.