# eurusdevsec/zero-door architecture

> Architecture diagram of the GitHub repository eurusdevsec/zero-door, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/eurusdevsec/zero-door
- Repository: https://github.com/eurusdevsec/zero-door

## Overview

ZERO DOOR is a research-stage, multi-agent defense system for microservices. Its documented loop is Nemesis planning an attack, the Go worker injecting it into a target, Gaia observing metrics and emitting an alert, and Hephaestus applying a recovery action. Shared event-pipeline and measurement modules support event validation, capture, audit, and scoring; the repository also contains an SQL-injection handoff and fixture path. The README describes the broad agent flow, while sampled excerpts and the source index support only selected internal links; historical performance claims are explicitly unverified.

Main entry points: [`agent-orchestrator/nemesis/main.py`](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/nemesis/main.py) (Nemesis Agent), [`chaos-worker/cmd/main.go`](https://github.com/eurusdevsec/zero-door/blob/main/chaos-worker/cmd/main.go) (Chaos Worker), [`agent-orchestrator/event_pipeline/adapters.py`](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/event_pipeline/adapters.py) (Event Adapters), [`agent-orchestrator/measurement/scorer.py`](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/measurement/scorer.py) (Incident Scorer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agents["Defense Agents"]
  node_nemesis["Nemesis Agent<br/>[main.py]"]
  node_nemesis_guard["Command Guard<br/>[command_guard.py]"]
  node_gaia["Gaia Monitor<br/>[main.py]"]
  node_gaia_diagnosis["Gaia Diagnosis<br/>[diagnosis.py]"]
  node_hephaestus["Hephaestus Healer<br/>[main.py]"]
  node_heph_recovery["Recovery Logic<br/>[recovery.py]"]
  node_dashboard["Agent Dashboard<br/>[app.js]"]
end

subgraph group_execution["Attack Execution"]
  node_worker["Chaos Worker<br/>[main.go]"]
  node_attack_exec["Attack Executors<br/>[executor.go]"]
  node_worker_guard["Worker Guard<br/>[auth.go]"]
end

subgraph group_events["Event Pipeline"]
  node_event_contract["Event Contract<br/>[contract.py]"]
  node_event_client["Event Client<br/>[client.py]"]
  node_event_adapters["Event Adapters<br/>[adapters.py]"]
  node_event_store[("Event Store<br/>[store.py]")]
  node_audit["Event Audit<br/>[audit.py]"]
  node_llm["LLM Adapter<br/>[llm.py]"]
  node_formal_capture["Formal Capture<br/>[formal_capture.py]"]
end

subgraph group_measurement["Measurement"]
  node_measurement_flows["Measurement Flows<br/>[flows.py]"]
  node_measurement_scorer["Incident Scorer<br/>[scorer.py]"]
  node_measurement_metrics["Metrics Analysis<br/>[metrics.py]"]
  node_measurement_clock["Clock Alignment<br/>[clock.py]"]
  node_measurement_formal["Formal Measurement<br/>[formal.py]"]
end

subgraph group_target["Target System"]
  node_fixture["SQLi Fixture<br/>[app.py]"]
  node_target_app["Microservices Target"]
end

node_operator(("Operator"))
node_kafka["Kafka"]
node_prometheus[("Prometheus")]

node_operator -->|"triggers attack"| node_nemesis
node_nemesis -->|"publishes command"| node_kafka
node_kafka -->|"delivers command"| node_worker
node_worker -->|"checks policy"| node_worker_guard
node_worker -->|"dispatches attack"| node_attack_exec
node_worker -->|"publishes result"| node_kafka
node_attack_exec -->|"injects failure"| node_target_app
node_target_app -->|"exports metrics"| node_prometheus
node_prometheus -->|"provides metrics"| node_gaia
node_gaia -->|"sends alerts"| node_kafka
node_kafka -->|"delivers alerts"| node_hephaestus
node_hephaestus -->|"delegates recovery"| node_heph_recovery
node_heph_recovery -->|"heals service"| node_target_app
node_nemesis -->|"checks commands"| node_nemesis_guard
node_nemesis -->|"queries metrics"| node_prometheus
node_nemesis -.->|"serves interface"| node_dashboard
node_gaia_diagnosis -->|"uses adapter"| node_llm
node_gaia_diagnosis -->|"captures decisions"| node_formal_capture
node_event_adapters -->|"uses client"| node_event_client
node_event_adapters -->|"validates events"| node_event_contract
node_event_adapters -->|"captures events"| node_formal_capture
node_event_client -->|"validates payloads"| node_event_contract
node_audit -->|"checks records"| node_event_contract
node_measurement_flows -.->|"scores runs"| node_measurement_scorer
node_measurement_scorer -->|"aligns timestamps"| node_measurement_clock
node_measurement_scorer -->|"uses formal data"| node_measurement_formal
node_measurement_formal -->|"uses metrics"| node_measurement_metrics
node_measurement_formal -->|"audits events"| node_audit
node_fixture -.->|"hosts SQLi scenario"| node_target_app

click node_nemesis "https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/nemesis/main.py"
click node_nemesis_guard "https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/nemesis/command_guard.py"
click node_gaia "https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/gaia/main.py"
click node_gaia_diagnosis "https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/gaia/diagnosis.py"
click node_hephaestus "https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/hephaestus/main.py"
click node_heph_recovery "https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/hephaestus/recovery.py"
click node_dashboard "https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/nemesis/static/app.js"
click node_worker "https://github.com/eurusdevsec/zero-door/blob/main/chaos-worker/cmd/main.go"
click node_attack_exec "https://github.com/eurusdevsec/zero-door/blob/main/chaos-worker/internal/attack/executor.go"
click node_worker_guard "https://github.com/eurusdevsec/zero-door/blob/main/chaos-worker/internal/guard/auth.go"
click node_event_contract "https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/event_pipeline/contract.py"
click node_event_client "https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/event_pipeline/client.py"
click node_event_adapters "https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/event_pipeline/adapters.py"
click node_event_store "https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/event_pipeline/store.py"
click node_audit "https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/event_pipeline/audit.py"
click node_llm "https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/event_pipeline/llm.py"
click node_formal_capture "https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/event_pipeline/formal_capture.py"
click node_fixture "https://github.com/eurusdevsec/zero-door/blob/main/services/sqli-fixture/app.py"
click node_measurement_flows "https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/measurement/flows.py"
click node_measurement_scorer "https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/measurement/scorer.py"
click node_measurement_metrics "https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/measurement/metrics.py"
click node_measurement_clock "https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/measurement/clock.py"
click node_measurement_formal "https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/measurement/formal.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_nemesis,node_nemesis_guard,node_gaia,node_gaia_diagnosis,node_hephaestus,node_heph_recovery,node_dashboard toneBlue
class node_worker,node_attack_exec,node_worker_guard,node_prometheus toneAmber
class node_event_contract,node_event_client,node_event_adapters,node_event_store,node_audit,node_llm,node_formal_capture toneMint
class node_measurement_flows,node_measurement_scorer,node_measurement_metrics,node_measurement_clock,node_measurement_formal toneRose
class node_fixture,node_target_app,node_operator,node_kafka toneIndigo
```

## Components

### Defense Agents

- [Nemesis Agent](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/nemesis/main.py): `agent-orchestrator/nemesis/main.py`
- [Command Guard](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/nemesis/command_guard.py): `agent-orchestrator/nemesis/command_guard.py`
- [Gaia Monitor](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/gaia/main.py): `agent-orchestrator/gaia/main.py`
- [Gaia Diagnosis](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/gaia/diagnosis.py): `agent-orchestrator/gaia/diagnosis.py`
- [Hephaestus Healer](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/hephaestus/main.py): `agent-orchestrator/hephaestus/main.py`
- [Recovery Logic](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/hephaestus/recovery.py): `agent-orchestrator/hephaestus/recovery.py`
- [Agent Dashboard](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/nemesis/static/app.js): `agent-orchestrator/nemesis/static/app.js`

### Attack Execution

- [Chaos Worker](https://github.com/eurusdevsec/zero-door/blob/main/chaos-worker/cmd/main.go): `chaos-worker/cmd/main.go`
- [Attack Executors](https://github.com/eurusdevsec/zero-door/blob/main/chaos-worker/internal/attack/executor.go): `chaos-worker/internal/attack/executor.go`
- [Worker Guard](https://github.com/eurusdevsec/zero-door/blob/main/chaos-worker/internal/guard/auth.go): `chaos-worker/internal/guard/auth.go`

### Event Pipeline

- [Event Contract](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/event_pipeline/contract.py): `agent-orchestrator/event_pipeline/contract.py`
- [Event Client](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/event_pipeline/client.py): `agent-orchestrator/event_pipeline/client.py`
- [Event Adapters](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/event_pipeline/adapters.py): `agent-orchestrator/event_pipeline/adapters.py`
- [Event Store](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/event_pipeline/store.py): `agent-orchestrator/event_pipeline/store.py`
- [Event Audit](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/event_pipeline/audit.py): `agent-orchestrator/event_pipeline/audit.py`
- [LLM Adapter](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/event_pipeline/llm.py): `agent-orchestrator/event_pipeline/llm.py`
- [Formal Capture](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/event_pipeline/formal_capture.py): `agent-orchestrator/event_pipeline/formal_capture.py`

### Measurement

- [Measurement Flows](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/measurement/flows.py): `agent-orchestrator/measurement/flows.py`
- [Incident Scorer](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/measurement/scorer.py): `agent-orchestrator/measurement/scorer.py`
- [Metrics Analysis](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/measurement/metrics.py): `agent-orchestrator/measurement/metrics.py`
- [Clock Alignment](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/measurement/clock.py): `agent-orchestrator/measurement/clock.py`
- [Formal Measurement](https://github.com/eurusdevsec/zero-door/blob/main/agent-orchestrator/measurement/formal.py): `agent-orchestrator/measurement/formal.py`

### Target System

- [SQLi Fixture](https://github.com/eurusdevsec/zero-door/blob/main/services/sqli-fixture/app.py): `services/sqli-fixture/app.py`
- **Microservices Target**

### Other components

- **Operator**
- **Kafka**
- **Prometheus**

## Connections

- Operator → Nemesis Agent: triggers attack (evidence: `README.md`)
- Nemesis Agent → Kafka: publishes command (evidence: `README.md`)
- Kafka → Chaos Worker: delivers command (evidence: `README.md`)
- Chaos Worker → Worker Guard: checks policy (evidence: `chaos-worker/cmd/main.go`)
- Chaos Worker → Attack Executors: dispatches attack (evidence: `chaos-worker/cmd/main.go`)
- Chaos Worker → Kafka: publishes result (evidence: `chaos-worker/cmd/main.go`)
- Attack Executors → Microservices Target: injects failure (evidence: `README.md`)
- Microservices Target → Prometheus: exports metrics (evidence: `README.md`)
- Prometheus → Gaia Monitor: provides metrics (evidence: `agent-orchestrator/gaia/main.py`)
- Gaia Monitor → Kafka: sends alerts (evidence: `README.md`)
- Kafka → Hephaestus Healer: delivers alerts (evidence: `README.md`)
- Hephaestus Healer → Recovery Logic: delegates recovery (evidence: `agent-orchestrator/hephaestus/recovery.py`)
- Recovery Logic → Microservices Target: heals service (evidence: `README.md`)
- Nemesis Agent → Command Guard: checks commands (evidence: `agent-orchestrator/nemesis/main.py`)
- Nemesis Agent → Prometheus: queries metrics (evidence: `agent-orchestrator/nemesis/main.py`)
- Nemesis Agent → Agent Dashboard: serves interface
- Gaia Diagnosis → LLM Adapter: uses adapter (evidence: `agent-orchestrator/gaia/diagnosis.py`)
- Gaia Diagnosis → Formal Capture: captures decisions (evidence: `agent-orchestrator/gaia/diagnosis.py`)
- Event Adapters → Event Client: uses client (evidence: `agent-orchestrator/event_pipeline/adapters.py`)
- Event Adapters → Event Contract: validates events (evidence: `agent-orchestrator/event_pipeline/adapters.py`)
- Event Adapters → Formal Capture: captures events (evidence: `agent-orchestrator/event_pipeline/adapters.py`)
- Event Client → Event Contract: validates payloads (evidence: `agent-orchestrator/event_pipeline/client.py`)
- Event Audit → Event Contract: checks records (evidence: `agent-orchestrator/event_pipeline/audit.py`)
- Measurement Flows → Incident Scorer: scores runs
- Incident Scorer → Clock Alignment: aligns timestamps (evidence: `agent-orchestrator/measurement/scorer.py`)
- Incident Scorer → Formal Measurement: uses formal data (evidence: `agent-orchestrator/measurement/scorer.py`)
- Formal Measurement → Metrics Analysis: uses metrics (evidence: `agent-orchestrator/measurement/formal.py`)
- Formal Measurement → Event Audit: audits events (evidence: `agent-orchestrator/measurement/formal.py`)
- SQLi Fixture → Microservices Target: hosts SQLi scenario
