AgentTrafficCop Get Free API Key →
v1.0.0 · now available on PyPI

Stop AI agents from burning money in loops.

AgentTrafficCop is a runtime circuit breaker for multi-agent systems. It validates every handoff, fingerprints every payload, and trips before a loop empties your API budget.

Generate Free API Key ↗
No credit card required 5 Agents free 213 tests passing
python demo.py
$ python demo.py ────────────────────────────────────────────── RUN 1 · WITHOUT AgentTrafficCop ────────────────────────────────────────────── coder → reviewer {diff: 'rename foo to bar'} reviewer → coder {feedback: 'add a docstring'} coder → reviewer {diff: 'add null check'} reviewer → coder {feedback: 'handle empty case'} ... 20 more rounds ... ✗ no breaker · 24 messages · cost: $0.10 (illustrative) ────────────────────────────────────────────── RUN 2 · WITH AgentTrafficCop ────────────────────────────────────────────── coder → reviewer {...} ✓ step=1 reviewer → coder {...} ✓ step=2 coder → reviewer {...} ✓ step=3 reviewer → coder {...} ✗ CYCLIC_PAYLOAD_LOOP 🛑 CIRCUIT BREAKER TRIPPED error_code : CYCLIC_PAYLOAD_LOOP session : demo-loop step : 8 ✓ session halted · 8 messages · cost: $0.03 (illustrative) ✓ saved vs run 1: $0.07
Built with
FastAPI Pydantic v2 Redis Docker LangGraph Python 3.11+

Three primitives,
sitting between your agents.

01

Schema shield

Every handoff validated against a strict Pydantic v2 contract before it reaches the next agent. Malformed payloads are rejected at the door.

02

Loop detection

SHA-256 fingerprinting on every payload. Identical repeats and A↔B ping-pongs trip the breaker. Step counters catch the rest.

03

Circuit breaker

When thresholds breach, the response carries structured diagnostics. Your orchestrator decides: halt, alert, or escalate.

Five lines to add it
to your orchestrator.

your_orchestrator.py
from agenttrafficcop import Guard, LoopDetected guard = Guard(url="https://YOUR-RENDER-URL.onrender.com", api_key="your-key") try: result = await guard.check( session_id="run-42", sender="coder", recipient="reviewer", payload={"diff": "fix typo"}, ) print("approved at step", result.step) except LoopDetected as e: print("loop caught:", e.error_code)

Runs as a standalone FastAPI service. Works with LangGraph, CrewAI, AutoGen, or raw asyncio. The SDK ships a LangGraph adapter — wrap any node in one line.

Tested, observable,
hardened.

190+
Tests
Passing in CI on every commit
SHA-256
Fingerprinting
Deterministic payload hashing
Redis
Or memory
Pluggable session store
MIT
License
Open source, on PyPI

Free to start.
Scale when you need to.

The middleware and SDK are open source and self-hostable today. Managed tiers are coming soon.

Free
$0
forever
  • Protect up to 5 agents
  • 10,000 messages / month
  • 60 requests / minute
  • Hosted Cloud
Get started
Team
$199/mo
coming soon
  • Protect up to 100 agents
  • 2,000,000 messages / month
  • 300 requests / minute
  • Priority support
Upgrade

Try it in sixty seconds.

One command to install. Three lines to integrate. Zero infrastructure to manage.