Stop your agent swarm from breaking your backend.
When dozens of AI agents hit the same API at once, you get 429 storms, lost writes, runaway recursion and unauthorized deletes. HiveGate sits between your agents and your backend and fixes all four — with measured proof below.
OPENAI_BASE_URL) or the SDK at the gateway. Zero code changes to your agents.Watch a swarm break — then get protected
Pick a target and press Run Audit. HiveGate fires the same agent swarm twice: once directly at the backend (EXPOSED) and once through the gateway (PROTECTED), then compares the measured numbers.
Five guardrails, every call
Each card is one module in gateway/. The badge shows its live effect from the last audit. Use the buttons below to stress-test a single guardrail in isolation.
429s.fencing_tokens + version checks so concurrent writers never overwrite each other.| Protection metric | Exposed | With HiveGate |
|---|---|---|
| Loading measured baseline audit... | ||
Test a policy change before you ship it
Edit the YAML policy (or pick a preset) and press Replay & Diff. HiveGate re-runs the recorded trace against your new rules and shows exactly which calls flip from allowed to blocked — with zero production risk.
| Seq | Agent | Tool & payload | Before | After | Rule |
|---|---|---|---|---|---|
| Every call whose decision changed will be listed here. | |||||
What happens when the backend fails?
Replays the same traffic while injecting latency spikes, HTTP 500s, malformed JSON, 429 storms and partial writes at 0%, 10% and 30% fault rates. Inspired by Netflix's Chaos Monkey.
Turn any incident into a CI test
Every gateway decision is recorded to JSONL. Blocked or gated calls are listed first — click Export as test to save one as a permanent regression test in traces/regressions/.
| Seq | Agent | Request | Gateway decision | Upstream | Action |
|---|---|---|---|---|---|
| Loading recorded JSONL trace... | |||||
Every wave, every agent
Left: the intercepted multi-agent request waves and how each one fared with and without the gateway. Right: the agents and tools discovered on the target and the full call tree (pruned branches are dashed).
| Wave | Agent | Endpoint | Exposed | Gateway |
|---|---|---|---|---|
| Run an audit to record the intercepted waves. | ||||
Benchmark scorecard
Evals, deployment latency, OWASP LLM/agentic security and telemetry — what the target was lacking, what it has to be, and which gateway module closes the gap.
| Pillar & dimension | Measured now | Was lacking | Target | Status |
|---|---|---|---|---|
| Load a URL or run an audit to compute the scorecard. | ||||
Everything above, in your terminal
The hivegate CLI opens an interactive console that verifies your backend — no demos. Install it in 30 seconds, then try it live in the preview on the right.
pip install hivegate-swarm
hivegate
/proxy start in the console, then point your agent app at it:OPENAI_BASE_URL=http://127.0.0.1:8010/v1/proxy/openai
hivegate test traces/
█ █ ███ █ █ █████ █████ █████ █████ █████ █ █ █ █ █ █ █ █ █ █ █ █████ █ █ █ ████ █ ███ █████ █ ████ █ █ █ █ █ █ █ █ █ █ █ █ █ █ ███ █ █████ █████ █ █ █ █████
| Command | Area | What it does in your backend |
|---|---|---|
/audit | Verify | Scans your backend code (routes, guardrail modules, YAML policy) and runs a live 30-call swarm through gateway.main to measure dedup, admission cap, fenced writes and grounding. |
/discover | Discovery | Lists every control-plane / adapter class, outbound LLM provider bindings, and any hidden agents caught by the live proxy. |
/replay strict | Policy diff | Replays the recorded backend trace against a stricter policy ($20 refund gate, depth 2) and lists newly blocked calls. |
/replay unfenced | Write safety | Replays concurrent writes with fencing disabled to prove how many updates would be lost. |
/chaos | Resilience | Injects 0% / 10% / 30% upstream faults and charts exposed vs. gated survival. |
/test | CI | Runs every exported regression test in traces/regressions/. |
/proxy start | Live proxy | Starts a background proxy on :8010 to intercept OpenCode, LangGraph, CrewAI or any script. |
/key | LLM | Configure Gemini (recommended), Groq, local Ollama, or the zero-key offline engine. |
shift+tab · ctrl+p | Keys | Cycle agent mode (Audit → Discover → Replay → Chaos → Guard) · open the command palette. |
Add HiveGate to your stack
Three ways to integrate, from zero-code to full SDK. Download the audit as a PDF or the raw trace for your records.
pip install hivegate-swarm
hivegate
OPENAI_BASE_URL=http://127.0.0.1:8010/v1/proxy/openai
GEMINI_API_BASE=http://127.0.0.1:8010/v1/proxy/gemini
from sdk.client import GatewayClient
gw = GatewayClient("http://127.0.0.1:8010")
await gw.call(goal_id="g1", agent_id="a1", tool="read")
Problem. When an agent swarm hits a backend concurrently, duplicate reads trigger 429 Too Many Requests, naive concurrent writes overwrite each other, recursive sub-agents loop without bound, and read-only agents call destructive endpoints.
How HiveGate works. Singleflight coalesces duplicate reads, leased locks + monotonic fencing tokens serialize writes, call-tree budgets prune recursion at max_depth=3, and declarative YAML rules block or pause risky actions.
Measured proof. Loading measured numbers...