OPEN SOURCE Control plane for multi-agent backends print no. 001

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.

Overload errors (HTTP 429)
--→--
exposed → with HiveGate
Lost concurrent writes
--→--
fencing tokens + CAS state
Backend calls saved
--
singleflight dedup + cache
Risky actions stopped
--→--
ran unchecked → blocked / paused
STEP 1
Route agents through HiveGate
Point one env var (OPENAI_BASE_URL) or the SDK at the gateway. Zero code changes to your agents.
STEP 2
Gateway enforces 5 guardrails
Admission cap, singleflight dedup, fenced writes, depth budgets and YAML policy run on every call.
STEP 3
Record, replay & prove it
Every decision is traced to JSONL so you can replay policy changes, inject chaos and export CI tests.
01 / Live Audit

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.

URL
IDLE AEGIS COMMERCE · FLASH SALE PORTAL
6 AGENTS · 5 TOOLS · READY
02 / Guardrails & Measured Telemetry

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.

IN-PROCESS CONTROL PLANE
01
Adaptive Admission & Fair Queue
admission.py · scheduler.py
Caps concurrent upstream calls. Bursts wait in a bounded fair queue instead of triggering 429s.
CAP: 3 · 0 429s
02
Singleflight Dedup & Cache
dedup.py
Identical in-flight reads share one upstream call; recent reads are cached briefly.
COALESCED: -- · SAVED: --
03
Fenced Leases & CAS State
locks.py · state.py
Monotonic fencing_tokens + version checks so concurrent writers never overwrite each other.
LOST WRITES: 0 · FENCED
04
Goal Budgets & Depth Breaker
budgets.py · semantic.py
Tracks parent→child call lineage and halts runaway recursion and ping-pong loops.
MAX DEPTH: d=3 · PRUNED: --
05
YAML Policy & Human Approval
policy.py
Blocks read-only agents from mutations and pauses high-value actions until a human approves.
DELETE BLOCKED · ≥$100 GATED
TEST ONE GUARDRAIL:
Measured protection telemetry EXPOSED vs. WITH HIVEGATE
Protection metric Exposed With HiveGate
Loading measured baseline audit...
03 / Policy Replay & Diff · Headline feature

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.

TRACE: --
PRESETS:
YAML POLICY — edit any line, then replay
Replay settings
Press "▶ Replay & Diff" to re-run the recorded trace against the edited policy.
Newly blocked
--
Newly allowed
--
Lost writes
0 → 0
429s / p99
--
Seq Agent Tool & payload Before After Rule
Every call whose decision changed will be listed here.
04 / Chaos Mode

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.

Survival rate of the exposed swarm vs. the gated swarm under injected faults.
Loading chaos survival chart...
05 / Recorded Trace & Regression Tests

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...
06 / Hidden-Agent Discovery · 0 found

Unmask agents nobody labelled

Most apps never send an X-Agent-Id header. HiveGate fingerprints system prompts, tool schemas and models on /v1/proxy/* traffic to identify each hidden agent and flag risky behaviour.

Option A · Wrap any local app
hivegate inspect -- opencode
Option B · Point one env var at the proxy
OPENAI_BASE_URL=http://127.0.0.1:8010/v1/proxy/gemini
Fingerprint Inferred role System prompt Tools (declared / emitted) Calls Risk flags
No hidden agents captured yet. Click "Simulate hidden swarm" or run hivegate inspect.
07 / Traffic & Call Tree · 0 waves

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).

Intercepted waves
Wave Agent Endpoint Exposed Gateway
Run an audit to record the intercepted waves.
Agents, tools & call tree
Run an audit to inspect the agent hierarchy.
08 / 4-Pillar Evaluation

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.

GRADE: NOT EVALUATED
DETECTED STACK: not evaluated
Pillar & dimension Measured now Was lacking Target Status
Load a URL or run an audit to compute the scorecard.
09 / Terminal Console

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.

PyPI · hivegate-swarm ↗
1
Install from PyPI
Python 3.10+. Works on Windows, macOS and Linux.
pip install hivegate-swarm
2
Open the console
Run it from your project folder. Type a slash command or ask a question in plain English.
hivegate
3
Route your agents (optional)
Type /proxy start in the console, then point your agent app at it:
OPENAI_BASE_URL=http://127.0.0.1:8010/v1/proxy/openai
4
Use it in CI
Run exported regression tests without opening the console.
hivegate test traces/
hivegate — ~/All project/Agent Swarm
/audit to verify swarm  ·  /replay strict to diff policy  ·  v0.2.1
Audit  · gemini-2.5-flash HiveGateRouter · live
~/All project/Agent Swarm:main shift+tab agents   ctrl+p commands

              
Commands & what they verify
Command Area What it does in your backend
/auditVerifyScans 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.
/discoverDiscoveryLists every control-plane / adapter class, outbound LLM provider bindings, and any hidden agents caught by the live proxy.
/replay strictPolicy diffReplays the recorded backend trace against a stricter policy ($20 refund gate, depth 2) and lists newly blocked calls.
/replay unfencedWrite safetyReplays concurrent writes with fencing disabled to prove how many updates would be lost.
/chaosResilienceInjects 0% / 10% / 30% upstream faults and charts exposed vs. gated survival.
/testCIRuns every exported regression test in traces/regressions/.
/proxy startLive proxyStarts a background proxy on :8010 to intercept OpenCode, LangGraph, CrewAI or any script.
/keyLLMConfigure Gemini (recommended), Groq, local Ollama, or the zero-key offline engine.
shift+tab · ctrl+pKeysCycle agent mode (Audit → Discover → Replay → Chaos → Guard) · open the command palette.
Questions you can ask the console click one to try it in the preview
10 / Ship It

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.

1 · Terminal console
pip install hivegate-swarm
hivegate
2 · Proxy env (zero SDK)
OPENAI_BASE_URL=http://127.0.0.1:8010/v1/proxy/openai
GEMINI_API_BASE=http://127.0.0.1:8010/v1/proxy/gemini
3 · Python SDK
from sdk.client import GatewayClient
gw = GatewayClient("http://127.0.0.1:8010")
await gw.call(goal_id="g1", agent_id="a1", tool="read")
README · problem, how it works & measured proof

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...

↑ Top