⚡ RUNLOG AGENT CIRCUIT BREAKER

Stop Runaway Agent Loops
Before They Burn $500.

A 10-line drop-in Python/TypeScript wrapper that detects repeating tool retry loops, enforces hard session spending ceilings, and triggers safe fallbacks in real-time.

$420+ Avg. Saved per Incident
< 1ms Interception Latency
10 Lines Zero-Friction Drop-in
100% Crash-Free Fallbacks

⚡ Live Interactive Playground

See Loop-Guard in action right in your browser. Choose a broken agent scenario and watch the circuit breaker halt execution.

🔴 1. Runaway SQL Retry Loop
Agent queries missing DB replica, retrying identical SQL query 3 times.
🟡 2. 403 Scraper Cycle (A→B→A→B)
Oscillating loop between failing scrape and rotating proxy without progress.
🟣 3. Token Budget Burner ($2.00 cap)
Massive prompt injection exceeding per-session dollar ceiling on o1.
Execution Trace Stream:
CIRCUIT CLOSED • READY
Click "▶ Run Live Simulation" above to witness Loop-Guard intercept a runaway agent.
Session Dollar Ceiling $0.00 / $2.00
Consecutive Repetition 0 / 3 retries
Instant Webhook Alert:
🚨 Slack / Telegram Alert Dispatcher
Standby. When circuit breaker trips, real-time alert payload displays here.

How to Run & Configure Loop-Guard

Drop it into your existing OpenAI, Anthropic, or LangGraph agent in 3 simple steps.

1
Install the SDK

Available for Python and TypeScript with zero heavy dependencies:

# Python
pip install ./runlog_loopguard-0.1.0-py3-none-any.whl

# TypeScript / Node.js
npm install ./runlog-loopguard-0.1.0.tgz
2
10-Line Drop-in Wrapper

Wrap your existing OpenAI client instance:

from openai import OpenAI
from loopguard import CircuitBreaker, TripPolicy, wrap_openai

# Set 3-retry threshold and $2.00 hard budget ceiling
guard = CircuitBreaker(
    policy=TripPolicy(
        max_consecutive_retries=3,
        max_cost_usd=2.00,
        fallback_mode="synthetic_response"
    )
)

client = wrap_openai(OpenAI(), guard)
3
Connect Alerts & Relax

Get instant notifications if an agent is halted:

from loopguard import AlertDispatcher

alerts = AlertDispatcher(
    slack_webhook_url="https://hooks.slack.com/...",
    telegram_bot_token="123456:ABC...",
    telegram_chat_id="-100123456789"
)

guard.on_trip_callback = lambda cb, details: alerts.notify_trip(cb.to_dict(), details)

Install the local SDK

Versioned Python and TypeScript packages with source and checksums. Hosted telemetry and platform billing are not available for purchase yet.

Loop-Guard 0.1.0 · Free source distribution

Retry/cycle detection, local session budget checks, and optional webhook alert integrations run inside your application. Configure and test thresholds for your workload. Budget checks depend on observed token usage and are not a guarantee against all upstream charges.

Download packages and checksums

Read installation and integration documentation