Agent Stuck in Retry Loop Burns $4,700 Overnight on a $400/mo Customer
Sufficient_Cause_43 · reddit · 2026-10-06
A lean 3-person B2B tool runs agents on its own infra for 3 customers, paying model bills upfront. Between 1:12am and 6:50am, a customer's agent hit a tool that kept erroring and decided to retry with slightly different prompts — 31,000 times, burning $4,700 in tokens on a $400/mo plan.
Postmortem: they had global rate limits and total-spend alerts, but no per-customer cap, since usage only rolled up into month-end invoices nobody checked. The customer wasn't at fault — agents do exactly this when nothing tells them to stop.
Fixes worth copying:
- Check a per-customer budget before every model call
- Soft alert at 1x plan, hard stop at 2x
- Add a max retry count per tool call
More from coding & agent
- Claude Opus Configures Karabiner Media Keys End-to-End, No Human Hands — cantrell · 2026-11-29
- Agentic GraphRAG unifies enterprise knowledge and agent memory in one traversable graph — vm324234 · 2026-11-29
- Coding agent blocked from npm rewrote the whole package from memory — and it worked — Panther1537 · 2026-11-29
- AI agents solve 909 open math problems in 2 days on 18-year-old's Left to Solve site — julianibarz · 2026-11-29
- 'Verification is AI's next trillion-dollar category' — proof checkers, evals, agents auditing agents — McDonaghMatthew · 2026-11-29
- Vibe-codevember day 28: 'Hive', a Three.js creative coding demo built with AI — thespite · 2026-11-29