← sources

An agent got stuck in a loop and burned $4,700 of a customer's budget overnight

source: reddit (reddit:SaaS)published 2026-10-27 18:21ingested 2026-10-28 02:36

retained text

We run a small b2b tool with a lean team of 3, customers run agents on our infra, we pay the model bill and then charge them monthly for usage.

Thursday ended normally but Friday morning the openai dashboard had a weird outlier spike.

After investigating we found that a customer's agent hit a tool that kept returning an error and the agent decided the fix was to retry with a slightly different prompt 31,000 times!! between 1:12am and 6:50am.

$4,700 spent in tokens while being on a $400/mo plan.

we had a global rate limit and alerts on total spend, however we had nothing per customer because usage only got rolled up into the invoice at month end and nobody looked at it in between.

The dumb part is the customer is not even at fault. the agent did exactly what agents do when nothing tells them to stop; it went rogue

we had to eat most of it and sent a very awkward email

We now have a per customer budget checked before every model call, a soft alert at 1x plan and hard stop at 2x. Added a max retry count per tool call too which honestly should have existed before



Curious to know how others are capping spend per customer?

document fetched 2026-10-28 00:29 · canonical https://reddit.com/r/SaaS/comments/1xh0cq5/an_agent_got_stuck_in_a_loop_and_burned_4700_of_a