My Hermes agent spent $3 before I noticed. Now it can't. A developer accidentally spent $3 on a Hermes research agent running across 50 literature review tasks after forgetting to check the bill until the next morning, with the agent retrying failed web searches at a cost each time. The fix is `agent-cost-guard`, a Python library that tracks costs as they accumulate and stops execution when a user-defined limit is hit. The tool also supports warning callbacks at configurable thresholds and per-label cost breakdowns for logging or blocking modes. This is a submission for the Hermes Agent Challenge. I ran a Hermes research agent across 50 literature review tasks and forgot to check the bill until the next morning. Three dollars gone. The agent had retried a bunch of failed web searches and each retry cost money. The fix is obvious in hindsight: track cost as you go and stop when you hit the limit. That's agent-cost-guard . python from agent cost guard import CostGuard guard = CostGuard limit usd=1.00 Inside your agent loop: response = client.messages.create model="claude-sonnet-4-5", ... cost = calculate cost response.usage guard.add cost, label="research turn" raises CostLimitExceeded if over $1 python def on warn w : log.warning f"Cost at {w.pct used:.0%} — ${w.total usd:.4f} of ${w.limit usd:.4f}" guard = CostGuard limit usd=1.00, warn at= 0.5, 0.8 , on warn=on warn, The callback fires once per threshold and never again unless you call guard.reset . guard.add 0.05, label="web search" guard.add 0.12, label="llm synthesis" guard.add 0.03, label="web search" s = guard.summary print s.by label {"web search": 0.08, "llm synthesis": 0.12} Now you know where the money went. guard = CostGuard limit usd=0.50, stop on limit=False guard.add 1.00 no exception print guard.ok False print guard.remaining usd -0.50 Useful for logging-only mode when you want to measure but not block. guard.check raises CostLimitExceeded if total limit Call it at checkpoints rather than after every single add. s = guard.summary print str s Cost: $0.20 / $1.00 20.0% used Entries: 3 Breakdown: llm synthesis: $0.12 web search: $0.08 python from agent cost guard import make cost guard guard = make cost guard limit usd=1.00, on warn=on warn warn at defaults to 0.5, 0.8 Standard library only: dataclasses , time . Nothing else. pip install agent-cost-guard