v0.1.0 — live on PyPI

Stop your AI agents
from burning money
in loops.

A runtime circuit breaker and schema shield for multi-agent systems. Sits between your agents, catches loops before they burn tokens, and rejects malformed handoffs before they crash your pipeline.

Works with LangGraph, CrewAI, AutoGen, or raw asyncio.

LangGraph· CrewAI· AutoGen· FastAPI· Pydantic v2· Prometheus· Redis· Docker· Python 3.11+· Async-first· LangGraph· CrewAI· AutoGen· FastAPI· Pydantic v2· Prometheus· Redis· Docker· Python 3.11+· Async-first·
01
Live demo

Two agents. One loop. The breaker trips.

python demo.py
$ python demo.py
════════════════════════════════════════
RUN 1: WITHOUT AgentTrafficCop
════════════════════════════════════════
Coder → Reviewer : {'diff': 'rename foo to bar', ...}
Reviewer → Coder : {'feedback': 'add a docstring', ...}
... repeats for 12 rounds ...
No breaker. Loop ran 24 messages. Estimated cost: $0.10
════════════════════════════════════════
RUN 2: WITH AgentTrafficCop
════════════════════════════════════════
Coder → Reviewer : {...} [APPROVED step=1]
Reviewer → Coder : {...} [APPROVED step=2]
Coder → Reviewer : {...} [APPROVED step=3]
Reviewer → Coder : {...} [CYCLIC_PAYLOAD_LOOP]
🛑 CIRCUIT BREAKER TRIPPED
Error code: CYCLIC_PAYLOAD_LOOP
Session: demo-loop
step: 8
cycle_length: 2
cycle_repeats: 3
Session halted after 8 messages. Estimated cost: $0.03
Saved vs Run 1: $0.07
02
The problem

Multi-agent systems fail
in two predictable ways.

🔁

Infinite loops

A Coder agent keeps "fixing" the same thing. A Reviewer keeps asking for the same change. The loop looks like progress to a step counter, but it's silently burning $400 an hour.

💥

Corrupted handoffs

Agent A sends unstructured markdown when Agent B expects JSON. The pipeline crashes, or worse, silently drops context.

Both problems cost real money. Neither is solved by prompt engineering.

03
The solution

Three things, sitting
between your agents.

🛡

Schema shield

Every handoff validated against a strict Pydantic contract before it reaches the next agent. No malformed payloads. No silent failures.

🔍

Loop detection

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

⚡

Runtime breaker

When thresholds are breached, returns HTTP 422 with structured diagnostics. Your orchestrator decides what to do.

04
How it works

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. The middleware runs as a standalone service — call it before any handoff.

05
Built for production

Tested, observable,
and hardened.

0
automated tests, on every commit
<1ms
added per handoff, canonical JSON
Redis
or in-memory sessions, pluggable
MIT
licensed, published on PyPI
06
Pricing

Free to start.
Scale when you need to.

The middleware and SDK are open source. The managed service is coming soon — pricing below is the plan.

Free
$0
forever
  • ✓10,000 messages / month
  • ✓Single instance
  • ✓Community support
  • ✓Self-hosted
Get started
Recommended
Pro
$49/mo
coming soon
  • ✓250,000 messages / month
  • ✓Multi-instance
  • ✓Prometheus metrics
  • ✓30-day audit log
  • ✓Email support
Join waitlist
Team
$199/mo
coming soon
  • ✓2M messages / month
  • ✓1-year audit log
  • ✓Priority support
  • ✓Slack Connect
Contact us
Enterprise
Custom
talk to us
  • ✓Unlimited messages
  • ✓SSO / SAML
  • ✓On-prem or VPC
  • ✓DPA, BAA, SLAs
Contact us

Try it in sixty seconds.

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