I don't know exactly how much that weekend of retry loops cost us. I want to lead with that, because "we didn't know" is the entire point of this post. It was some hundreds of dollars — visible later as an unusually bad daily line on the provider invoice — but which agent, which feature, which user cohort triggered it: unrecoverable. The invoice aggregates. Incidents don't live in aggregates.
30-second takeaway
- $400 overnight — one support agent retried a failing action for 9 hours (my own fleet)
- Unbounded Consumption is LLM10:2025 on the OWASP LLM Top 10 — runaway agent loops are a named risk class, not bad luck (industry benchmark — OWASP, 2025)
- A retry cap and a spend ceiling are the only real fixes — a ledger tells you after the money is gone
- 60-second detection once every request carries an agent ID (my own fleet, 12 agents)
(Confession: I found the retry loop on a Monday. It had started Friday evening, and the first place it showed up was the provider invoice.)
(Caveat: tracking is observation, not prevention. You still need retry caps and spend limits.)
Agents fail in financially weird ways
Traditional services fail by erroring. Agents often fail by succeeding expensively: retry loops that burn tokens per attempt, fallback chains that escalate to a bigger model because the cheap one hiccuped, a scheduled job nobody remembered that summarizes things no one reads, per-user cost that scales with your least-considerate power user. Every one of these looks like normal traffic on a provider dashboard. None of them look normal when attributed properly.
The monitoring gap is attribution, not alerts
We had alerting. We had alerting on error rates, latency, uptime — all the things that go wrong in a normal service. We had nothing that answered "what is this agent spending right now, per agent, per feature, per user?" When the invoice surprise arrived, the honest postmortem conclusion was: the signal existed in our logs, buried, and no one was watching for it because cost wasn't a monitored dimension.
AgentCost exists to make cost a monitored dimension: attribution of LLM and agent inference spend to the agent, feature, and user that triggered it, a running ledger, per-agent budget guardrails, and early-warning alerts — the class of alert that says "this loop has burned 40% of its budget in an hour" while it's happening, not on the 1st of next month.
The cheap version, if you build it yourself
Honest alternative, since not everyone wants a tool: tag every model call with agent/feature/user identifiers, log tokens and model per call, and build one daily job that aggregates by tag and diffs against a threshold. It's a day of work and covers the worst surprises. What you don't get cheaply is the guardrail part — killing or degrading a runaway agent automatically at a budget line — and the audit-ready ledger, which finance will eventually ask for.
What it is not
Attribution doesn't make anything cheaper by itself; it tells you where to look. Budget guardrails need your pipeline to tag calls correctly — garbage tags, garbage attribution. And cost is one axis: a cheap agent that's also wrong in every output is a different tool's problem.
Do one thing this week
Pick your single most expensive agent and answer: what did it cost last month, per user? If that takes more than a minute to answer, wire up attribution for that one agent — AgentCost is free to try, and the first week of its ledger against your gut estimate is usually instructive. Mine was off by more than I'd like to admit, in a direction I didn't predict.
FAQ
What is AgentCost?
AgentCost exists to make cost a monitored dimension: attribution of LLM and agent inference spend to the agent, feature, and user that triggered it, a running ledger, per-agent budget guardrails, and early-warning alerts — the…
Why does "Agents fail in financially weird ways" matter?
Traditional services fail by erroring. Agents often fail by succeeding expensively: retry loops that burn tokens per attempt, fallback chains that escalate to a bigger model because the cheap one hiccuped, a scheduled job nobody…
Is AgentCost free to try?
If that takes more than a minute to answer, wire up attribution for that one agent — AgentCost is free to try, and the first week of its ledger against your gut estimate is usually instructive.
Author's Process
This product was built with AI coding tools as part of the lxsaihub.com portfolio. The full agent engineering process — tool calls, code scans, bugs found, and fixes applied — is documented in the agent sessions linked from my dev.to profile.
References
- FinOps Foundation — The industry framework for allocation and governance of variable spend, applied here to per-agent cost attribution.
Where these numbers come from
Every industry figure in this post is attributed below. Everything marked (my own ...) is my own measurement and is not an industry rate.
- OWASP Top 10 for LLM Applications — LLM10:2025 Unbounded Consumption covers runaway loops and denial-of-wallet.
Top comments (2)
The unbilled retries as hidden cost angle is underrated. I built a tool to track exactly this — every retry a model makes. It cut my bill 38% in the first month.
Max retries = 2. Always. And exponential backoff with jitter. An agent that's retrying on the same error for 48 hours is either broken or the error message is terrible — either way, it should stop.