Overspend Recovery for AI Agents: Tolerance Bands, Auto-Recovery, and Bad Debt
TL;DR
- Agents will sometimes overspend their delegated budget — settlement timing differences, dispute reversals, refund races. Don't pretend it won't happen.
- The right architecture is three layers: a tolerance band (small overruns auto-handled), an auto-recovery loop (medium overruns pull funds from a backing source), and a bad-debt threshold (large overruns trigger investigation).
- Without these layers, overspend becomes manual operations work that doesn't scale.
Even with sub-100ms policy enforcement, agent budgets can drift into overspend. Settlement happens after authorization, refunds reverse charges asynchronously, and in-flight authorizations can exceed available budget when several land at the same time. The architecture below handles these cases without manual intervention.
How does overspend actually happen?
Three common causes:
1. Authorization-vs-settlement gap. An auth holds $100 against a $500 budget. Before it settles, three more $100 auths land. Total: $400 held, $100 budget remaining. Then the original auth settles at $120 (network adjustment). Now the agent has settled $120 + 3 holds for $300 = $420 against $500. But the ledger shows $480 used vs $500 budget — close to the line but legal. If a fourth auth comes in for $100, it could push past the limit.
2. Refund races. Agent has $500 budget, $480 used. A $100 refund credits the ledger; agent now sees $80 used. Agent fires a $400 transaction. Refund actually clears 2 hours later, but in the meantime the $400 has authed. Agent has authed $480 + $400 = $880 against $500.
3. Dispute reversals. A merchant successfully chargesback a $200 transaction the agent made 60 days ago. The agent's ledger gets debited $200, putting it over its current budget.
These aren't bugs. They're race conditions inherent to settlement timing. The architecture handles them.
What's the three-layer recovery model?
Layer 1: Tolerance band
The agent's budget is allowed to drift by a small amount before triggering anything. Practical numbers:
- For a $500 budget: tolerance ±$25 (5%).
- For a $5000 budget: tolerance ±$100 (2%).
- For a $50,000 budget: tolerance ±$500 (1%).
Smaller-budget agents get a larger relative tolerance because settlement gaps are proportionally larger.
If overspend is within tolerance: log it, no action. The next normal credit (refund, settlement adjustment) brings it back.
Layer 2: Auto-recovery loop
If overspend exceeds tolerance: trigger automated recovery.
Recovery sources, in order of preference:
Recovery is automatic. Notifications fire to the user (informational) and the publisher (actionable). The agent is paused (cards frozen) until balance is restored.
Layer 3: Bad-debt threshold
If recovery fails (no backing source, no incoming credits) AND overspend exceeds the bad-debt threshold (typically the lesser of $X or N% of budget): escalate to manual investigation.
At this point, the agent is paused, the publisher is notified, and the platform's risk team gets involved. Outcomes:
- Recovery via dispute / reversal. If the overspend was caused by a fraudulent or duplicate charge, file a dispute.
- Pursue the user. If the user underwrote the agent and the overspend is legitimate, collect from them.
- Write off as bad debt. Last resort. Affects the publisher's standing on the platform.
What does this look like in production?
Three real patterns from publishers:
Conservative publisher. Tolerance 1%, auto-recovery from a publisher reserve account, bad-debt threshold $100 or 5% of budget. Maximum protection; lowest agent autonomy.
Mainstream publisher. Tolerance 5%, auto-recovery from user's backing wallet (with explicit consent), bad-debt threshold $500 or 10% of budget. Good balance.
High-trust publisher. Tolerance 10%, auto-recovery from publisher reserve, bad-debt threshold $5000. High agent autonomy; relies on the publisher's underwriting strength.
How do you set the bad-debt threshold?
Three considerations:
Practical starting point: $500 OR 10% of agent's budget, whichever is lower.
What about chargeback-driven overspend?
Chargebacks are weeks-to-months after the original transaction. By the time they hit:
- The agent's budget has rolled over (next billing cycle).
- The user's backing wallet may have moved.
- The publisher's reserve has accumulated other obligations.
Special handling: chargeback debits go against a publisher-level bad-debt fund first. If that's exhausted, escalate to the manual investigation flow regardless of amount.
What's the audit trail look like?
Every overspend event logs:
- Original auth that caused it (or refund race that produced it).
- Time and amount of detection.
- Recovery action taken (which source pulled from).
- Final state (recovered / pending / written off).
Standard report formats for compliance and finance ops.
FAQ
What's the typical overspend rate at a mature publisher?
Less than 0.5% of transaction volume in any given month. Of that, ~95% auto-recovers; ~4% goes to manual investigation; <1% becomes bad debt.
Can agents knowingly trigger overspend to exploit recovery?
The auto-recovery loop has rate limits — the same agent can't trigger recovery repeatedly. After 2-3 recovery events in a window, the agent is paused regardless of amount and a manual review starts.
How do refund races interact with multi-currency?
Worse, because FX rates can move between auth and settlement. Multi-currency policies need wider tolerance bands ($X equivalent in agent's base currency) to absorb FX noise.
What if the user disputes the overspend itself?
Same chargeback flow. Goes through Visa/Mastercard rules. Resolution can take 30-60 days. The platform absorbs the cash flow gap during resolution.
Can I configure tolerance per agent or per use case?
Yes — per-policy. Travel agents and research agents may want different tolerance; configure separately.
Related reading
- [How We Built a 100ms Policy Engine](/blog/building-spending-controls-for-ai-agents) — the engine that detects overspend
- [What Is a Double-Entry Ledger for AI Agent Payments?](/blog/double-entry-ledger-ai-agents) — the ledger layer the recovery flows operate on
- [How to Let AI Agents Make Payments Safely](/blog/let-ai-agents-pay-safely) — broader safety model
External references
- [Visa Chargeback Reason Codes](https://developer.visa.com) — context for chargeback-driven overspend
- [Mastercard Settlement Timing](https://www.mastercard.us/en-us.html) — relevant for auth-vs-settle race conditions
---
By Vlad K.. Last updated 2026-04-29.