Thoughts after I saw an AI agent ran up a $6,531 AWS bill in 24 hours

Discussion

I saw someone let an agent join DN42 to run port scans on HN. They told it to "continue" without reading its plan. And 24 hours later they found that a pile of EC2 instances, load balancers, lambdas, and a $6,531.30 bill. AWS later cut it to about $1,894.

I think the scary part isn't the compute. I did the calculate that the five m8g.12xlarge it planned run about $2.15/hr each (m8g.xlarge is $0.1795/hr in us-east-1, EC2 scales linearly). Run all five for the full 24 hours and that's roughly $260. That's about 4% of the bill. The other 96% came from stuff that never shows up in the agent's chat transcript: extra instances it spawned, load balancers, egress.

The model didn't go crazy, and It did exactly what it was told efficiently instead. The problem was blast radius: real AWS creds, no spend cap, and nobody read the plan.

What I changed:

  1. Billing alarm that pages me, not emails me
  2. The agent gets a scoped role, never my keys
  3. Separate sandbox account with a hard spend cap
  4. A kill switch I've actually tested

Quick check you can do right now if your agent's role has ec2:* or iam:* on *

Posted Jul 9, 2026, 7:49 PM UTC

311
Loading comments…