burnstop

burnstop

Pre-flight budget gate for AI agent runaways. Drop-in. ~$0.001 per check.

⭐ Star on GitHub See the 4 incidents

One line, zero refactor

pip install burnstop

import burnstop
burnstop.install(budget_envelope_usd=5.00)

# your existing anthropic.Client calls work unchanged
# raises BudgetExceeded before token-1 if envelope would be exceeded

Why this exists

DateStackLoss
Jul 2025Replit AI DROP DATABASEprod DB + 1,206 records
Nov 2025LangChain A2A 11-day loop$47,000
2026LangGraph weekend refactor$4,200
Apr 2026Cursor + Claude → PocketOSDB + 30h outage

Same shape every time: no per-run budget that lives outside the model's context. burnstop is that primitive.

What you see

[burnstop] OK call=1 proj=$0.0442 left=$5.0000
[burnstop] CALL#1 actual=$0.0435 cache_read=0% cumul=$0.0435
[burnstop] OK call=2 proj=$0.0442 left=$4.9575
...
[burnstop] 402 BUDGET_EXCEEDED: would_spend=$0.0442 envelope_left=$0.0080

Also exposes cache_creation vs cache_read decomposition Anthropic response headers don't surface (the GH cookbook #46829 issue).

Ecosystem adapters

Stack

Built by an indie. github.com/santicalderon/burnstop · Hall of Pain · Agent Card