Stop AI agents from burning your money. Pre-flight budget gate. Hard-stop before token-1. ~$0.001 per check.
I built this after my own autonomous platform hit runaway LLM costs — loops that looked like progress but were burning through budget with zero output. The model causing the loop is the same one you'd ask to self-throttle. That doesn't work. burnstop is the primitive that lives outside the model's context.
# Via GitHub (available now):
pip install git+https://github.com/santicalderon/burnstop
# Via PyPI (coming soon):
# pip install burnstopimport burnstop
burnstop.install(budget_envelope_usd=5.00, model="claude-3-5-sonnet")
# your existing code, unchanged:
from anthropic import Anthropic
client = Anthropic()
client.messages.create(...) # burnstop intercepts, raises BudgetExceeded if over envelopeThat's the entire integration. Drop-in. No refactor.
| Date | Stack | Loss | Source |
|---|---|---|---|
| Jul 2025 | Replit AI | prod DB + 1,206 records | Fortune |
| Nov 2025 | LangChain + A2A (11-day loop) | $47,000 | Medium |
| 2026 | LangGraph weekend autonomous refactor | $4,200 | DEV.to |
| Apr 2026 | Cursor + Claude | PocketOS DB wiped in 9s, 30h outage | OECD.AI |
Same shape every time: no per-run budget that lives outside the model's context. The model that loops is the same one you would ask to self-throttle. burnstop is the primitive that fixes it.
Before each tool call:
- Estimates the projected $ cost (cache_creation + cache_read + output decomposition the response headers don't expose — see anthropic-cookbook#46829)
- Returns
OKif within envelope, raisesBudgetExceededif not - After the call lands, records actual cost and updates running total
$ burnstop demo --budget 0.30
[burnstop] OK call=1 proj=$0.0442 left=$0.3000
[burnstop] CALL#1 actual=$0.0435 cache_read=0% cumul=$0.0435
[burnstop] OK call=2 proj=$0.0442 left=$0.2565
...
[burnstop] 402 BUDGET_EXCEEDED: would_spend=$0.0442 envelope_left=$0.0390
burnstop ships as a core library + drop-in adapters for every major agent framework:
| Adapter | Install | Framework |
|---|---|---|
| burnstop-langchain | pip install burnstop-langchain |
LangChain callbacks |
| burnstop-langgraph | pip install burnstop-langgraph |
LangGraph nodes |
| burnstop-autogen | pip install burnstop-autogen |
AutoGen agents |
| burnstop-crewai | pip install burnstop-crewai |
CrewAI crews |
Each adapter wraps the same Receipt primitive — one budget envelope, same BudgetExceeded exception, works across frameworks.
from burnstop import Receipt, BudgetExceeded
r = Receipt(budget_envelope_usd=5.00, model="claude-3-5-sonnet")
try:
r.check(input_tokens=4500, max_output=2048)
# ... your call lands ...
r.record(actual_response_body=response)
except BudgetExceeded as e:
# graceful stop, don't retry
log.warning(f"agent stopped at envelope: {e}")- DID:
did:web:mcp.mi-kernel2026.xyz - Agent Card: https://mcp.mi-kernel2026.xyz/.well-known/agent-card.json
- Issues / PRs welcome; responses within 24h on weekdays
See AGENT_CARD.md for the substrate this is built on.
- burnstop-langchain — LangChain callback adapter
- burnstop-langgraph — LangGraph node wrapper + shared middleware
- burnstop-crewai — per-agent / per-crew budget gate
MIT — see LICENSE.
burnstop is part of the kernel autonomous AI Business substrate.
- 🌐 kernel → kernel.mi-kernel2026.xyz
- 📋 AI Business Audit $499 → /audit/
- 🔁 InvoiceChaser $14.50/mo → /invoicechaser/
- 📰 Reviews + newsletter → /reviews/