AgentTrafficCop
AgentTrafficCop is a runtime circuit breaker for multi-agent AI systems that validates handoffs, fingerprints payloads, and halts loops before they drain API budgets. It installs with pip and is open source under the MIT License.
About AgentTrafficCop
AgentTrafficCop
AgentTrafficCop is a runtime circuit breaker designed to stop AI agents from burning money in loops in multi-agent systems. It sits between agents, validating every handoff against a strict Pydantic v2 schema, fingerprinting each payload with SHA-256 to detect identical repeats and A-B ping-pong loops, and using step counters to catch other cases. When thresholds are breached, it returns structured diagnostics so an orchestrator can decide to halt, alert, or escalate. It runs as a standalone FastAPI service and works with LangGraph, CrewAI, AutoGen, or raw asyncio, with a LangGraph adapter included in the SDK. The page lists v1.0.1 as available on PyPI, reports 190+ tests passing in CI, and describes the middleware and SDK as open source and self-hostable today. A free tier is listed with up to 5 agents, 10,000 messages per month, and 60 requests per minute; Pro ($49/mo) and Team ($199/mo) tiers are marked coming soon.
Key features
- Schema shield: validates every handoff against a strict Pydantic v2 contract and rejects malformed payloads
- Loop detection: SHA-256 fingerprinting of payloads to catch identical repeats and A-B ping-pongs, plus step counters
- Circuit breaker: returns structured diagnostics when thresholds breach so the orchestrator can halt, alert, or escalate
- Standalone FastAPI service
- SDK with Guard and LoopDetected exception for integration into orchestrators
- LangGraph adapter that wraps any node in one line
- Works with LangGraph, CrewAI, AutoGen, or raw asyncio
- Pluggable session store with Redis or in-memory options
- Deterministic payload hashing
Best suited for
- Teams running multi-agent systems that risk runaway API costs from looping agents
- Developers using LangGraph, CrewAI, AutoGen, or raw asyncio orchestrators
- Organizations wanting an open-source, self-hostable guardrail for agent handoffs
Pricing
Free tier listed at $0 forever (up to 5 agents, 10,000 messages/month, 60 requests/minute). Pro at $49/mo and Team at $199/mo are listed as coming soon. The middleware and SDK are open source and self-hostable today.
Discussion
Used AgentTrafficCop? Share what worked and what didn’t.
No comments yet. Start the conversation.