AgentTrafficCop
A runtime circuit breaker for multi-agent systems that validates handoffs and trips on repeated or cyclic payload loops.
At a Glance
Permanent free hosted tier; middleware and SDK are open source (MIT) and self-hostable.
Engagement
Available On
Alternatives
Listed Nov 2026
About AgentTrafficCop
AgentTrafficCop is a runtime circuit breaker for multi-agent AI systems, published by belalshafeq. It sits between communicating agents, validates each handoff against a schema, fingerprints payloads with SHA-256, and halts a session when a loop is detected. The site lists version 1.0.1 on PyPI.
What It Is
AgentTrafficCop is a FastAPI middleware service with a Python SDK. Your orchestrator calls it before each handoff, and it does not call your agents itself. It is positioned as a single-purpose tool for stopping runaway agent loops, and not as an LLM router, observability platform or prompt manager.
How the circuit breaker works
Each message is checked against a strict Pydantic v2 contract. The payload is then hashed with SHA-256 to catch identical repeats and A-to-B cyclic ping-pongs, while step counters, consecutive-repeat limits and cycle limits cover the remaining cases. When a threshold is breached, the service returns HTTP 422 with a stable error code (for example CYCLIC_PAYLOAD_LOOP or REPEATED_PAYLOAD_LOOP) and diagnostics, and the orchestrator decides whether to halt, alert or escalate.
Operations and integration
Sessions can be held in memory or in Redis. The service also provides Bearer API key authentication, a Prometheus /metrics endpoint, an optional JSON Lines audit log, an admin API for listing and cleaning up sessions, session TTL, and per-key usage metering with tier limits. A LangGraph adapter wraps a graph node in one call, and the project says it also works with CrewAI, AutoGen or raw asyncio. Docker deployment files are included.
Documented limitations
Detection relies on exact hashes, so semantically equivalent but differently worded loops are not caught. The in-memory backend is single-process, and rate limiting is per-process. The README also notes there is no multi-tenancy and no self-serve tier changes.
Community Discussions
Be the first to start a conversation about AgentTrafficCop
Share your experience with AgentTrafficCop, ask questions, or help others learn from your insights.
Pricing
Free
Permanent free hosted tier; middleware and SDK are open source (MIT) and self-hostable.
- Protect up to 5 agents
- 10,000 messages / month
- 60 requests / minute
- Hosted Cloud
- No credit card required
Pro
Managed tier, coming soon.
- Protect up to 25 agents
- 250,000 messages / month
- 120 requests / minute
- Usage analytics + Email support
- Coming soon
Team
Managed tier, coming soon.
- Protect up to 100 agents
- 2,000,000 messages / month
- 300 requests / minute
- Priority support
- Coming soon
Capabilities
Key Features
- Schema shield with Pydantic v2 validation
- SHA-256 payload fingerprinting loop detection
- Circuit breaker with step, repeat and cycle limits
- Structured HTTP 422 errors with diagnostics
- Bearer API key authentication
- Redis-backed or in-memory sessions
- Prometheus metrics endpoint
- JSON Lines audit log
- Admin API for session management
- Session TTL
- Per-key usage metering and tier limits
- LangGraph adapter
- Python SDK
