I Let My AI Agents Run Unsupervised and They Burned $200 in 2 Hours
Building justcopy.ai has been a wild ride. For those who don’t know, we’re building a tool that lets you copy any website, customize it, and deploy it - all automated. To make this work, we built 7 AI agents that handle the entire dev workflow.
Last week, one of those agents taught me a very expensive lesson.
The “I’ll Be Right Back” Moment
I was testing our agent pipeline. Everything looked good, so I kicked off a test run and stepped out to grab coffee. Maybe gone for 2 hours, tops.
Came back, opened my OpenRouter dashboard, and saw my bill had spiked by $100.
My first thought? “Holy shit, are people actually using this?”
I got excited for maybe 30 seconds thinking we had real users hammering the API.
We Did Not Have Users
I added some quick logging to figure out what was happening.
Turns out, the agent I’d started was still running. Just churning through API calls. Making requests. Spending money. It was doing exactly what I told it to do - be autonomous and complete the task.
The problem? It didn’t know when to stop.
By the time I killed it, we’d burned through $200.
What We Learned (The Hard Way)
Here’s the thing about building autonomous AI agents: autonomous doesn’t mean unsupervised.
These agents will happily execute their instructions until they run out of tokens, hit an error, or drain your bank account - whichever comes first.
The Fix
The solution was almost embarrassingly simple once I saw the problem:
Interrupt checks everywhere. Before each API call, the agent now checks if it’s been told to stop.
Hard budget limits. Each agent session has a spend cap. Hit it? The agent stops, no exceptions.
Timeouts on everything. No more infinite loops. Every operation has a maximum runtime.
Better logging. I was flying blind before. Now we can see exactly what each agent is doing at any moment.
The core insight: you need circuit breakers at every level. One timeout isn’t enough. One budget check isn’t enough. You need multiple layers of “stop conditions” because these things will keep going until something explicitly tells them not to.