# 0sec-labs/0 architecture

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

- Interactive diagram: https://gitdiagram.com/0sec-labs/0
- Repository: https://github.com/0sec-labs/0

## Overview

0 is an AI security harness for local and managed security reviews. A user starts a browser chat, CLI workflow, or agent connection; the engine investigates a target, produces evidence-backed findings, and supports review and fixes. Its major branches include scoped agent tools, source and binary analysis, workflow execution, findings and run storage, and integrations. The README documents product-level flows; source-index references establish selected internal dependencies. Many subsystem paths are present in the tree but their implementation and wiring were not sampled, so those relationships are omitted.

Main entry points: [`packages/core/src/console/turn-engine.ts`](https://github.com/0sec-labs/0/blob/main/packages/core/src/console/turn-engine.ts) (Chat turn engine), [`packages/cli/src/commands/index.ts`](https://github.com/0sec-labs/0/blob/main/packages/cli/src/commands/index.ts) (CLI commands), [`packages/cli/src/workflow-engine-service.ts`](https://github.com/0sec-labs/0/blob/main/packages/cli/src/workflow-engine-service.ts) (Workflow runner), [`0verse/src/zeroverse/pipeline.py`](https://github.com/0sec-labs/0/blob/main/0verse/src/zeroverse/pipeline.py) (Binary analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI commands<br/>[index.ts]"]
  node_dashboard["Browser dashboard<br/>[main.tsx]"]
end

subgraph group_engine["Review engine"]
  node_workflow["Workflow runner"]
  node_turn["Chat turn engine<br/>[turn-engine.ts]"]
  node_llm["LLM runtime<br/>[llm-api.ts]"]
  node_features["Agent features<br/>[features.ts]"]
  node_scope["Scope policy<br/>[scope.ts]"]
end

subgraph group_analysis["Analysis and research"]
  node_tools["Security tools"]
  node_active_tools["Active tools"]
  node_pipeline["Unified review"]
  node_zero_ingest["Binary ingest<br/>[ingest.py]"]
  node_zero_pipeline["Binary analysis<br/>[pipeline.py]"]
  node_fuzz["Fuzzing<br/>[aflpp.py]"]
  node_cve["CVE knowledge base<br/>[ingest.py]"]
end

subgraph group_state["Findings and state"]
  node_findings["Findings review"]
  node_database[("Run and finding store<br/>[database.ts]")]
  node_learning["Learning and memory<br/>[learning.ts]"]
end

subgraph group_integrations["Agents and integrations"]
  node_plugins["Plugins and harnesses<br/>[live-harness.ts]"]
  node_mcp["MCP connection<br/>[mcp-server.ts]"]
end

node_user(("Operator"))
node_external_agent(("External coding agent"))
node_provider(("Model provider"))

node_user -->|"starts browser chat"| node_dashboard
node_user -->|"runs workflows"| node_cli
node_dashboard -.->|"submits chat"| node_turn
node_cli -->|"invokes"| node_workflow
node_workflow -.->|"runs review"| node_pipeline
node_turn -->|"creates runtime"| node_llm
node_turn -->|"uses flags"| node_features
node_turn -->|"hosts plugins"| node_plugins
node_tools -->|"checks scope"| node_scope
node_active_tools -->|"resolves scoped paths"| node_scope
node_cli -->|"reviews findings"| node_findings
node_workflow -.->|"persists runs"| node_database
node_findings -.->|"reads findings"| node_database
node_user -->|"reviews lessons"| node_learning
node_user -->|"connects agent"| node_mcp
node_external_agent -->|"uses workflows"| node_mcp
node_llm -->|"uses model"| node_provider
node_zero_ingest -->|"feeds analysis"| node_zero_pipeline
node_zero_pipeline -->|"runs fuzzing"| node_fuzz
node_zero_pipeline -.->|"uses vulnerability data"| node_cve
node_pipeline -.->|"returns findings"| node_findings

click node_cli "https://github.com/0sec-labs/0/blob/main/packages/cli/src/commands/index.ts"
click node_dashboard "https://github.com/0sec-labs/0/blob/main/packages/dashboard/src/main.tsx"
click node_workflow "https://github.com/0sec-labs/0/blob/main/packages/cli/src/workflow-engine-service.ts"
click node_turn "https://github.com/0sec-labs/0/blob/main/packages/core/src/console/turn-engine.ts"
click node_llm "https://github.com/0sec-labs/0/blob/main/packages/core/src/runtime/llm-api.ts"
click node_features "https://github.com/0sec-labs/0/blob/main/packages/core/src/agent/features.ts"
click node_scope "https://github.com/0sec-labs/0/blob/main/packages/core/src/scope/scope.ts"
click node_tools "https://github.com/0sec-labs/0/blob/main/packages/core/src/agent/tools/security-engines.ts"
click node_active_tools "https://github.com/0sec-labs/0/blob/main/packages/core/src/agent/tools/offensive-engines.ts"
click node_pipeline "https://github.com/0sec-labs/0/blob/main/packages/core/src/unified-pipeline.ts"
click node_zero_ingest "https://github.com/0sec-labs/0/blob/main/0verse/src/zeroverse/ingest.py"
click node_zero_pipeline "https://github.com/0sec-labs/0/blob/main/0verse/src/zeroverse/pipeline.py"
click node_fuzz "https://github.com/0sec-labs/0/blob/main/0verse/src/zeroverse/fuzz/aflpp.py"
click node_findings "https://github.com/0sec-labs/0/blob/main/packages/cli/src/web/findings-read-api.ts"
click node_database "https://github.com/0sec-labs/0/blob/main/packages/db/src/database.ts"
click node_learning "https://github.com/0sec-labs/0/blob/main/packages/cli/src/web/learning.ts"
click node_plugins "https://github.com/0sec-labs/0/blob/main/packages/core/src/plugins/live-harness.ts"
click node_mcp "https://github.com/0sec-labs/0/blob/main/packages/cli/src/commands/mcp-server.ts"
click node_cve "https://github.com/0sec-labs/0/blob/main/0verse/src/zeroverse/cve_kb/ingest.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_cli,node_dashboard toneBlue
class node_workflow,node_turn,node_llm,node_features,node_scope toneAmber
class node_tools,node_active_tools,node_pipeline,node_zero_ingest,node_zero_pipeline,node_fuzz,node_cve toneMint
class node_findings,node_database,node_learning toneRose
class node_plugins,node_mcp,node_user,node_external_agent,node_provider toneIndigo
```

## Components

### User interfaces

- [CLI commands](https://github.com/0sec-labs/0/blob/main/packages/cli/src/commands/index.ts): `packages/cli/src/commands/index.ts`
- [Browser dashboard](https://github.com/0sec-labs/0/blob/main/packages/dashboard/src/main.tsx): `packages/dashboard/src/main.tsx`

### Review engine

- [Workflow runner](https://github.com/0sec-labs/0/blob/main/packages/cli/src/workflow-engine-service.ts): `packages/cli/src/workflow-engine-service.ts`
- [Chat turn engine](https://github.com/0sec-labs/0/blob/main/packages/core/src/console/turn-engine.ts): `packages/core/src/console/turn-engine.ts`
- [LLM runtime](https://github.com/0sec-labs/0/blob/main/packages/core/src/runtime/llm-api.ts): `packages/core/src/runtime/llm-api.ts`
- [Agent features](https://github.com/0sec-labs/0/blob/main/packages/core/src/agent/features.ts): `packages/core/src/agent/features.ts`
- [Scope policy](https://github.com/0sec-labs/0/blob/main/packages/core/src/scope/scope.ts): `packages/core/src/scope/scope.ts`

### Analysis and research

- [Security tools](https://github.com/0sec-labs/0/blob/main/packages/core/src/agent/tools/security-engines.ts): `packages/core/src/agent/tools/security-engines.ts`
- [Active tools](https://github.com/0sec-labs/0/blob/main/packages/core/src/agent/tools/offensive-engines.ts): `packages/core/src/agent/tools/offensive-engines.ts`
- [Unified review](https://github.com/0sec-labs/0/blob/main/packages/core/src/unified-pipeline.ts): `packages/core/src/unified-pipeline.ts`
- [Binary ingest](https://github.com/0sec-labs/0/blob/main/0verse/src/zeroverse/ingest.py): `0verse/src/zeroverse/ingest.py`
- [Binary analysis](https://github.com/0sec-labs/0/blob/main/0verse/src/zeroverse/pipeline.py): `0verse/src/zeroverse/pipeline.py`
- [Fuzzing](https://github.com/0sec-labs/0/blob/main/0verse/src/zeroverse/fuzz/aflpp.py): `0verse/src/zeroverse/fuzz/aflpp.py`
- [CVE knowledge base](https://github.com/0sec-labs/0/blob/main/0verse/src/zeroverse/cve_kb/ingest.py): `0verse/src/zeroverse/cve_kb/ingest.py`

### Findings and state

- [Findings review](https://github.com/0sec-labs/0/blob/main/packages/cli/src/web/findings-read-api.ts): `packages/cli/src/web/findings-read-api.ts`
- [Run and finding store](https://github.com/0sec-labs/0/blob/main/packages/db/src/database.ts): `packages/db/src/database.ts`
- [Learning and memory](https://github.com/0sec-labs/0/blob/main/packages/cli/src/web/learning.ts): `packages/cli/src/web/learning.ts`

### Agents and integrations

- [Plugins and harnesses](https://github.com/0sec-labs/0/blob/main/packages/core/src/plugins/live-harness.ts): `packages/core/src/plugins/live-harness.ts`
- [MCP connection](https://github.com/0sec-labs/0/blob/main/packages/cli/src/commands/mcp-server.ts): `packages/cli/src/commands/mcp-server.ts`

### Other components

- **Operator**
- **External coding agent**
- **Model provider**

## Connections

- Operator → Browser dashboard: starts browser chat (evidence: `README.md`)
- Operator → CLI commands: runs workflows (evidence: `README.md`)
- Browser dashboard → Chat turn engine: submits chat
- CLI commands → Workflow runner: invokes (evidence: `packages/cli/src/workflow-engine-service.ts`)
- Workflow runner → Unified review: runs review
- Chat turn engine → LLM runtime: creates runtime (evidence: `packages/core/src/console/turn-engine.ts`)
- Chat turn engine → Agent features: uses flags (evidence: `packages/core/src/console/turn-engine.ts`)
- Chat turn engine → Plugins and harnesses: hosts plugins (evidence: `packages/core/src/console/turn-engine.ts`)
- Security tools → Scope policy: checks scope (evidence: `packages/core/src/agent/tools/security-engines.ts`)
- Active tools → Scope policy: resolves scoped paths (evidence: `packages/core/src/agent/tools/offensive-engines.ts`)
- CLI commands → Findings review: reviews findings (evidence: `README.md`)
- Workflow runner → Run and finding store: persists runs
- Findings review → Run and finding store: reads findings
- Operator → Learning and memory: reviews lessons (evidence: `README.md`)
- Operator → MCP connection: connects agent (evidence: `README.md`)
- External coding agent → MCP connection: uses workflows (evidence: `README.md`)
- LLM runtime → Model provider: uses model (evidence: `README.md`)
- Binary ingest → Binary analysis: feeds analysis (evidence: `0verse/src/zeroverse/pipeline.py`)
- Binary analysis → Fuzzing: runs fuzzing (evidence: `0verse/src/zeroverse/pipeline.py`)
- Binary analysis → CVE knowledge base: uses vulnerability data
- Unified review → Findings review: returns findings
