DEV Community

Anup Singh
Anup Singh

Posted on

AI Agents Are Notorious: A $200 Lesson in Autonomous Systems

So I just learned a very expensive lesson about AI agents.

I've been working on justcopy.ai - basically a tool where you can copy any website, customize it, and deploy it. To make this work, I built 7 AI agents that do the heavy lifting, following standard dev workflows.

What happened

Last week I started up the agents to test something, then stepped out to grab coffee. Came back maybe 2 hours later and checked my OpenRouter dashboard.

My bill had jumped $100.

First reaction: "Oh shit, are people actually using this?" Got excited for like 30 seconds thinking I had real users hammering the API.

Nope.

Added some logging and realized the agent I kicked off earlier was STILL running. Just churning through API calls. Completely autonomous. By the time I caught it, I'd burned through $200.

The fix

I had to add interrupt checks everywhere. Now before an agent makes any API call, it checks if it's been told to stop. Also added:

  • Hard timeouts on everything
  • Budget caps per session
  • Better logging so I can see WTF is happening

Seems obvious in hindsight but yeah... autonomous doesn't mean it knows when to quit.

Anyway

If you're building stuff with AI agents and running into similar issues, hit me up. Would be happy to compare notes on what works (and what drains your bank account).

Top comments (0)