# nebulae/trudi architecture

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

- Interactive diagram: https://gitdiagram.com/nebulae/trudi
- Repository: https://github.com/nebulae/trudi

## Overview

TRUDI is an autonomous DFIR investigation agent: an analyst directs an investigation through an MCP tool gateway, collects forensic evidence, and produces reviewed findings and an auditable report. Its documented workflow separates phase planning (DAIR), execution (the analyst and forensic tools), adversarial review, and gated reporting. The README supports these workflow relationships; server.py shows the MCP gateway and tool imports. Several tool implementations and the dashboard wiring were not sampled, so those edges reflect documented behavior rather than inspection of their internals.

Main entry points: [`server.py`](https://github.com/nebulae/trudi/blob/main/server.py) (MCP gateway), [`tools/reasoning.py`](https://github.com/nebulae/trudi/blob/main/tools/reasoning.py) (Adversarial reviewer), [`tools/dair.py`](https://github.com/nebulae/trudi/blob/main/tools/dair.py) (DAIR director), [`core/findings.py`](https://github.com/nebulae/trudi/blob/main/core/findings.py) (Finding lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Investigation orchestration"]
  node_mcp["MCP gateway<br/>[server.py]"]
  node_middleware["Tool middleware<br/>[middleware.py]"]
  node_dair["DAIR director<br/>[dair.py]"]
end

subgraph group_forensics["Forensic examination"]
  node_disk["Disk examination<br/>[imaging.py]"]
  node_memory["Memory forensics<br/>[volatility.py]"]
  node_windows["Windows artifacts<br/>[eztools.py]"]
  node_timeline["Timeline analysis<br/>[plaso.py]"]
  node_malware["YARA hunting<br/>[yara_tools.py]"]
  node_network["Network analysis<br/>[network.py]"]
  node_enrichment["IOC enrichment<br/>[enrichment.py]"]
  node_live["Live triage<br/>[live.py]"]
end

subgraph group_assurance["Reasoning and assurance"]
  node_reasoning["Adversarial reviewer<br/>[reasoning.py]"]
  node_workorder["Work-order gates<br/>[work_order.py]"]
end

subgraph group_evidence["Evidence and reporting"]
  node_findings["Finding lifecycle<br/>[findings.py]"]
  node_submission["Finding submission"]
  node_trace[("Execution trace<br/>[execution_log.py]")]
  node_packets["Evidence packets"]
  node_report["Case reporting<br/>[misc.py]"]
end

subgraph group_operations["Monitoring and response"]
  node_dashboard["Trace dashboard<br/>[serve.py]"]
  node_response["Response controls<br/>[gates.py]"]
end

node_analyst(("Claude analyst"))

node_analyst -->|"directs investigation"| node_mcp
node_mcp -->|"installs middleware"| node_middleware
node_mcp -->|"exposes tools"| node_disk
node_mcp -->|"exposes tools"| node_memory
node_mcp -->|"exposes tools"| node_windows
node_mcp -->|"exposes tools"| node_timeline
node_mcp -->|"exposes tools"| node_malware
node_mcp -->|"exposes tools"| node_network
node_mcp -->|"exposes tools"| node_enrichment
node_mcp -->|"exposes tools"| node_live
node_analyst -->|"requests phase direction"| node_dair
node_dair -->|"prescribes work"| node_analyst
node_analyst -->|"requests review"| node_reasoning
node_reasoning -->|"returns challenges"| node_analyst
node_analyst -->|"records findings"| node_findings
node_findings -.->|"submits revisions"| node_submission
node_analyst -->|"writes final report"| node_report
node_analyst -->|"records calls"| node_trace
node_trace -->|"renders trace"| node_dashboard
node_reasoning -.->|"binds tool plan"| node_workorder
node_reasoning -.->|"reviews evidence"| node_packets
node_analyst -.->|"uses response gates"| node_response

click node_mcp "https://github.com/nebulae/trudi/blob/main/server.py"
click node_middleware "https://github.com/nebulae/trudi/blob/main/core/middleware.py"
click node_dair "https://github.com/nebulae/trudi/blob/main/tools/dair.py"
click node_disk "https://github.com/nebulae/trudi/blob/main/tools/imaging.py"
click node_memory "https://github.com/nebulae/trudi/blob/main/tools/volatility.py"
click node_windows "https://github.com/nebulae/trudi/blob/main/tools/eztools.py"
click node_timeline "https://github.com/nebulae/trudi/blob/main/tools/plaso.py"
click node_malware "https://github.com/nebulae/trudi/blob/main/tools/yara_tools.py"
click node_network "https://github.com/nebulae/trudi/blob/main/tools/network.py"
click node_enrichment "https://github.com/nebulae/trudi/blob/main/tools/enrichment.py"
click node_live "https://github.com/nebulae/trudi/blob/main/tools/live.py"
click node_reasoning "https://github.com/nebulae/trudi/blob/main/tools/reasoning.py"
click node_workorder "https://github.com/nebulae/trudi/blob/main/tools/_gates/work_order.py"
click node_findings "https://github.com/nebulae/trudi/blob/main/core/findings.py"
click node_submission "https://github.com/nebulae/trudi/blob/main/core/finding_submission.py"
click node_trace "https://github.com/nebulae/trudi/blob/main/core/execution_log.py"
click node_packets "https://github.com/nebulae/trudi/blob/main/core/evidence_packets.py"
click node_report "https://github.com/nebulae/trudi/blob/main/tools/misc.py"
click node_dashboard "https://github.com/nebulae/trudi/blob/main/dashboard/serve.py"
click node_response "https://github.com/nebulae/trudi/blob/main/response/gates.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_mcp,node_middleware,node_dair toneBlue
class node_disk,node_memory,node_windows,node_timeline,node_malware,node_network,node_enrichment,node_live toneAmber
class node_reasoning,node_workorder toneMint
class node_findings,node_submission,node_trace,node_packets,node_report toneRose
class node_dashboard,node_response,node_analyst toneIndigo
```

## Components

### Investigation orchestration

- [MCP gateway](https://github.com/nebulae/trudi/blob/main/server.py): `server.py`
- [Tool middleware](https://github.com/nebulae/trudi/blob/main/core/middleware.py): `core/middleware.py`
- [DAIR director](https://github.com/nebulae/trudi/blob/main/tools/dair.py): `tools/dair.py`

### Forensic examination

- [Disk examination](https://github.com/nebulae/trudi/blob/main/tools/imaging.py): `tools/imaging.py`
- [Memory forensics](https://github.com/nebulae/trudi/blob/main/tools/volatility.py): `tools/volatility.py`
- [Windows artifacts](https://github.com/nebulae/trudi/blob/main/tools/eztools.py): `tools/eztools.py`
- [Timeline analysis](https://github.com/nebulae/trudi/blob/main/tools/plaso.py): `tools/plaso.py`
- [YARA hunting](https://github.com/nebulae/trudi/blob/main/tools/yara_tools.py): `tools/yara_tools.py`
- [Network analysis](https://github.com/nebulae/trudi/blob/main/tools/network.py): `tools/network.py`
- [IOC enrichment](https://github.com/nebulae/trudi/blob/main/tools/enrichment.py): `tools/enrichment.py`
- [Live triage](https://github.com/nebulae/trudi/blob/main/tools/live.py): `tools/live.py`

### Reasoning and assurance

- [Adversarial reviewer](https://github.com/nebulae/trudi/blob/main/tools/reasoning.py): `tools/reasoning.py`
- [Work-order gates](https://github.com/nebulae/trudi/blob/main/tools/_gates/work_order.py): `tools/_gates/work_order.py`

### Evidence and reporting

- [Finding lifecycle](https://github.com/nebulae/trudi/blob/main/core/findings.py): `core/findings.py`
- [Finding submission](https://github.com/nebulae/trudi/blob/main/core/finding_submission.py): `core/finding_submission.py`
- [Execution trace](https://github.com/nebulae/trudi/blob/main/core/execution_log.py): `core/execution_log.py`
- [Evidence packets](https://github.com/nebulae/trudi/blob/main/core/evidence_packets.py): `core/evidence_packets.py`
- [Case reporting](https://github.com/nebulae/trudi/blob/main/tools/misc.py): `tools/misc.py`

### Monitoring and response

- [Trace dashboard](https://github.com/nebulae/trudi/blob/main/dashboard/serve.py): `dashboard/serve.py`
- [Response controls](https://github.com/nebulae/trudi/blob/main/response/gates.py): `response/gates.py`

### Other components

- **Claude analyst**

## Connections

- Claude analyst → MCP gateway: directs investigation
- MCP gateway → Tool middleware: installs middleware (evidence: `server.py`)
- MCP gateway → Disk examination: exposes tools (evidence: `server.py`)
- MCP gateway → Memory forensics: exposes tools (evidence: `server.py`)
- MCP gateway → Windows artifacts: exposes tools (evidence: `server.py`)
- MCP gateway → Timeline analysis: exposes tools (evidence: `server.py`)
- MCP gateway → YARA hunting: exposes tools (evidence: `server.py`)
- MCP gateway → Network analysis: exposes tools (evidence: `server.py`)
- MCP gateway → IOC enrichment: exposes tools (evidence: `server.py`)
- MCP gateway → Live triage: exposes tools (evidence: `server.py`)
- Claude analyst → DAIR director: requests phase direction
- DAIR director → Claude analyst: prescribes work
- Claude analyst → Adversarial reviewer: requests review
- Adversarial reviewer → Claude analyst: returns challenges
- Claude analyst → Finding lifecycle: records findings
- Finding lifecycle → Finding submission: submits revisions
- Claude analyst → Case reporting: writes final report
- Claude analyst → Execution trace: records calls
- Execution trace → Trace dashboard: renders trace
- Adversarial reviewer → Work-order gates: binds tool plan (evidence: `tools/reasoning.py`)
- Adversarial reviewer → Evidence packets: reviews evidence (evidence: `tools/reasoning.py`)
- Claude analyst → Response controls: uses response gates
