AgentTrafficCop Get started →
v0.1.0 · available on PyPI

Stop your AI agents from
burning money in loops.

A runtime circuit breaker for multi-agent systems. Sits between your agents, validates every handoff, fingerprints every payload, and trips before $400 becomes $4,000.

python demo.py bash
$ 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 ──────────────────────────────────────────── 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 ✓ saved vs run 1: $0.07

Three things, sitting
between your agents.

01

Schema shield

Every handoff validated against a strict Pydantic contract. Malformed payloads get a structured 422 before they reach the next agent.

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

Runtime 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 Python
from agenttrafficcop import Guard, LoopDetected guard = Guard(url="http://localhost:8000", 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)

Works with LangGraph, CrewAI, AutoGen, or raw asyncio. Runs as a standalone service.

Tested, observable,
hardened.

168
Tests
Passing in CI on every commit
<1ms
Overhead
Per handoff, canonical JSON
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. The managed service is coming soon.

Free
$0
forever
  • 10,000 messages / month
  • Single instance
  • Self-hosted
  • Community support
Get started
Team
$199/mo
coming soon
  • 2M messages / month
  • 1-year audit log
  • Priority support
  • Slack Connect
Contact
Enterprise
Custom
talk to us
  • Unlimited messages
  • SSO / SAML
  • On-prem or VPC
  • DPA, BAA
Contact

Try it in sixty seconds.

One command to install. Three lines to integrate. Zero runtime dependencies.

GitHub ↗ PyPI ↗ Contact ↗