browser-research-bot (browser-use 0.2.1) · $437.19 burned in 43 minutes across 812 tool calls.
Context overflowed at turn 87. The model silently truncated its system prompt, then looped retry_on_error against a 429 for another 36 minutes — until the team lead woke up.
Your agent just spent $437 in a loop. Here's how we'd have stopped it in 40ms.
RunGuard is a runtime circuit breaker for AI agents. One line of install trips it the moment a tool-call pattern shows a loop, a context-window truncation, or a budget blow-through — so the run fails closed instead of running up a four-figure invoice over the weekend.
One line
// TypeScript · also: pip install runguard
import { guard } from '@runguard/sdk';
const run = guard({ budget: 10, maxLoopReps: 3 });
await run(() => myAgent.invoke(task));
Drops into browser-use, CrewAI, LangGraph, agentkit, or your own runner. Node and Python.
What trips the breaker
- Loops. A repeated tool-call signature inside a run. Breaker trips in 40ms, returns a structured error to the caller, pages Slack. No silent $400 bill.
- Context blowouts. When the model drops your system prompt, RunGuard sees the truncation before the output does — instead of letting the agent free-associate for another 2,000 turns.
- Budget ceilings. Set
$X per runor$Y per hour. Breaker trips on the token that crosses it. You won't find out on Monday morning.
Langfuse shows you the crime scene. RunGuard stops the crime.
Langfuse, LangSmith, and Braintrust are trace viewers — they show you what went wrong after the invoice lands. RunGuard runs in-process and trips before the next tool call. They're complementary: use whatever observability you already have, and add RunGuard for the failure modes that cost money in real time.