Skip to main content
The swarm has three independent safety mechanisms. None of them can be overridden by any LLM or strategic layer. If any one triggers, everything stops.

Three Safety Layers

CriticalityMonitor

Compiled Rust. 15 systemic risk indicators run every 60 seconds. When criticality exceeds the threshold, it triggers the KillChain and deploys the avalanche reserve.

KillChain

Compiled Rust + Python callbacks. 6-phase automated incident response: detect, contain, preserve, diagnose, remediate, learn. Genome blacklisting prevents failed strategies from re-evolving.

Circuit Breaker

Python daemon thread. No LLM. Reads engine metrics every 2 seconds. Emergency stop with no override path.

CriticalityMonitor (Rust)

15 indicators computed from price series, volume data, and feed spreads:
When overall_score exceeds avalanche_deploy_threshold (default 0.30), the Hive deploys the avalanche reserve (15% of capital held back for exactly this scenario) and triggers the KillChain.

KillChain (Rust + Python)

Six phases execute in sequence with Python callbacks at each step. Once triggered, all 6 phases run. The Hive can’t suppress an incident or skip phases.
Genome blacklisting is permanent. A strategy genome that caused a Sev1 incident will never be spawned again by the EvolutionEngine or AgentFactory.

Circuit Breaker (Python Thread)

A daemon thread with no LLM involvement. Reads numbers from the engines, compares to hard limits, acts. No reasoning, no prompts, no exceptions.

Why No LLM

An LLM might rationalize a losing position. Misinterpret drawdown as noise. Convince itself to override a limit. The circuit breaker doesn’t reason. It compares two numbers. If portfolio_drawdown > max_drawdown, everything stops.

How It Runs

A Python threading.Thread with daemon=True. Every 2 seconds:
  1. Reads portfolio metrics from every engine.
  2. Checks each metric against its limit.
  3. If any check fails, triggers an emergency stop.
  4. Publishes the result to the event bus.

Emergency Stop

When triggered:
  1. Cancels every open order across every exchange.
  2. Pauses all agents.
  3. Publishes an event with the failing metric, value, and limit.
  4. Only the human operator can restart.

Where They Sit in the Stack

Each layer runs independently. If the KillChain misses something, the circuit breaker catches it. If the circuit breaker thread dies, the Rust engine’s per-order risk pipeline still rejects every bad order.