# ahmed369refaat/malware-analysis architecture

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

- Interactive diagram: https://gitdiagram.com/ahmed369refaat/malware-analysis
- Repository: https://github.com/ahmed369refaat/malware-analysis

## Overview

Malware-Analysis combines defensive study material with an autonomous malware-analysis system. The principal workflow is an analyst submitting a sample through the FastAPI service, which invokes the analysis graph: triage informs static, dynamic and unpacking work; the system adapts its investigation, then produces findings, reports and validated YARA detections. Supporting capabilities include tool execution, model-provider selection, reusable skills, persistence, monitoring, SOC workflows and MCP access. The graph reflects README claims and sampled relationships; several internal stages are documented but their wiring was not sampled, so those links are omitted.

Main entry points: [`agentic-system/src/agentic_system/orchestration/graph.py`](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/orchestration/graph.py) (Analysis graph), [`agentic-system/src/agentic_system/api/routes/analysis.py`](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/api/routes/analysis.py) (Analysis endpoint), [`agentic-system/src/agentic_system/tools/executor.py`](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/tools/executor.py) (Tool execution), [`agentic-system/src/agentic_system/exploration/engine.py`](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/exploration/engine.py) (Deep exploration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Service entry"]
  node_api["FastAPI service<br/>[main.py]"]
  node_analysis_api["Analysis endpoint<br/>[analysis.py]"]
end

subgraph group_analysis["Analysis workflow"]
  node_graph["Analysis graph<br/>[graph.py]"]
  node_triage["Sample triage<br/>[router.py]"]
  node_static["Static analysis"]
  node_dynamic["Dynamic analysis"]
  node_unpacking["Unpacking<br/>[unpacking_graph.py]"]
  node_exploration["Deep exploration<br/>[engine.py]"]
  node_hypotheses["Hypothesis board"]
end

subgraph group_capabilities["Analyst capabilities"]
  node_tools["Tool execution<br/>[executor.py]"]
  node_registry["Tool registry<br/>[registry.py]"]
  node_models["LLM providers<br/>[factory.py]"]
  node_skills["Analysis skills<br/>[loader.py]"]
  node_detection["Detection engineering"]
end

subgraph group_operations["Operations and integrations"]
  node_reporting["SOC reporting<br/>[soc.py]"]
  node_database[("Analysis database<br/>[database.py]")]
  node_security["Permissions<br/>[permissions.py]"]
  node_mcp["MCP server<br/>[server.py]"]
end

node_analyst(("Analyst"))
node_external_mcp(("MCP client"))

node_analyst -->|"submits sample"| node_api
node_api -->|"routes requests"| node_analysis_api
node_analysis_api -->|"invokes analysis"| node_graph
node_analysis_api -->|"updates evidence"| node_hypotheses
node_analysis_api -->|"uses SOC workflow"| node_reporting
node_triage -->|"runs tools"| node_tools
node_exploration -->|"executes leads"| node_tools
node_exploration -->|"parses evidence"| node_hypotheses
node_tools -->|"looks up tools"| node_registry
node_registry -->|"checks permissions"| node_security
node_graph -.->|"coordinates phases"| node_static
node_graph -.->|"coordinates phases"| node_dynamic
node_graph -.->|"coordinates phases"| node_unpacking
node_graph -.->|"supports investigation"| node_exploration
node_graph -.->|"uses reasoning models"| node_models
node_graph -.->|"uses analysis skills"| node_skills
node_graph -.->|"generates detections"| node_detection
node_detection -.->|"feeds SOC detections"| node_reporting
node_reporting -.->|"persists reports"| node_database
node_external_mcp -->|"sends analysis requests"| node_mcp
node_mcp -->|"dispatches tools"| node_tools

click node_api "https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/api/main.py"
click node_analysis_api "https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/api/routes/analysis.py"
click node_graph "https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/orchestration/graph.py"
click node_triage "https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/orchestration/nodes/router.py"
click node_static "https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/orchestration/subgraphs/static_analysis_graph.py"
click node_dynamic "https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/orchestration/subgraphs/dynamic_analysis_graph.py"
click node_unpacking "https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/orchestration/subgraphs/unpacking_graph.py"
click node_exploration "https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/exploration/engine.py"
click node_hypotheses "https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/orchestration/hypothesis_engine.py"
click node_tools "https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/tools/executor.py"
click node_registry "https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/tools/registry.py"
click node_models "https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/models/factory.py"
click node_skills "https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/skills/loader.py"
click node_detection "https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/orchestration/detection_engineering.py"
click node_reporting "https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/orchestration/soc.py"
click node_database "https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/tools/custom/database.py"
click node_security "https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/security/permissions.py"
click node_mcp "https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/mcp/server.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_api,node_analysis_api,node_external_mcp toneBlue
class node_graph,node_triage,node_static,node_dynamic,node_unpacking,node_exploration,node_hypotheses toneAmber
class node_tools,node_registry,node_models,node_skills,node_detection toneMint
class node_reporting,node_database,node_security,node_mcp toneRose
class node_analyst toneIndigo
```

## Components

### Service entry

- [FastAPI service](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/api/main.py): `agentic-system/src/agentic_system/api/main.py`
- [Analysis endpoint](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/api/routes/analysis.py): `agentic-system/src/agentic_system/api/routes/analysis.py`

### Analysis workflow

- [Analysis graph](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/orchestration/graph.py): `agentic-system/src/agentic_system/orchestration/graph.py`
- [Sample triage](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/orchestration/nodes/router.py): `agentic-system/src/agentic_system/orchestration/nodes/router.py`
- [Static analysis](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/orchestration/subgraphs/static_analysis_graph.py): `agentic-system/src/agentic_system/orchestration/subgraphs/static_analysis_graph.py`
- [Dynamic analysis](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/orchestration/subgraphs/dynamic_analysis_graph.py): `agentic-system/src/agentic_system/orchestration/subgraphs/dynamic_analysis_graph.py`
- [Unpacking](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/orchestration/subgraphs/unpacking_graph.py): `agentic-system/src/agentic_system/orchestration/subgraphs/unpacking_graph.py`
- [Deep exploration](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/exploration/engine.py): `agentic-system/src/agentic_system/exploration/engine.py`
- [Hypothesis board](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/orchestration/hypothesis_engine.py): `agentic-system/src/agentic_system/orchestration/hypothesis_engine.py`

### Analyst capabilities

- [Tool execution](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/tools/executor.py): `agentic-system/src/agentic_system/tools/executor.py`
- [Tool registry](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/tools/registry.py): `agentic-system/src/agentic_system/tools/registry.py`
- [LLM providers](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/models/factory.py): `agentic-system/src/agentic_system/models/factory.py`
- [Analysis skills](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/skills/loader.py): `agentic-system/src/agentic_system/skills/loader.py`
- [Detection engineering](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/orchestration/detection_engineering.py): `agentic-system/src/agentic_system/orchestration/detection_engineering.py`

### Operations and integrations

- [SOC reporting](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/orchestration/soc.py): `agentic-system/src/agentic_system/orchestration/soc.py`
- [Analysis database](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/tools/custom/database.py): `agentic-system/src/agentic_system/tools/custom/database.py`
- [Permissions](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/security/permissions.py): `agentic-system/src/agentic_system/security/permissions.py`
- [MCP server](https://github.com/ahmed369refaat/malware-analysis/blob/main/agentic-system/src/agentic_system/mcp/server.py): `agentic-system/src/agentic_system/mcp/server.py`

### Other components

- **Analyst**
- **MCP client**

## Connections

- Analyst → FastAPI service: submits sample (evidence: `README.md`)
- FastAPI service → Analysis endpoint: routes requests (evidence: `agentic-system/src/agentic_system/api/main.py`)
- Analysis endpoint → Analysis graph: invokes analysis (evidence: `agentic-system/src/agentic_system/api/routes/analysis.py`)
- Analysis endpoint → Hypothesis board: updates evidence (evidence: `agentic-system/src/agentic_system/api/routes/analysis.py`)
- Analysis endpoint → SOC reporting: uses SOC workflow (evidence: `agentic-system/src/agentic_system/api/routes/analysis.py`)
- Sample triage → Tool execution: runs tools (evidence: `agentic-system/src/agentic_system/orchestration/nodes/router.py`)
- Deep exploration → Tool execution: executes leads (evidence: `agentic-system/src/agentic_system/exploration/engine.py`)
- Deep exploration → Hypothesis board: parses evidence (evidence: `agentic-system/src/agentic_system/exploration/engine.py`)
- Tool execution → Tool registry: looks up tools (evidence: `agentic-system/src/agentic_system/tools/__init__.py`)
- Tool registry → Permissions: checks permissions (evidence: `agentic-system/src/agentic_system/tools/registry.py`)
- Analysis graph → Static analysis: coordinates phases
- Analysis graph → Dynamic analysis: coordinates phases
- Analysis graph → Unpacking: coordinates phases
- Analysis graph → Deep exploration: supports investigation
- Analysis graph → LLM providers: uses reasoning models
- Analysis graph → Analysis skills: uses analysis skills
- Analysis graph → Detection engineering: generates detections
- Detection engineering → SOC reporting: feeds SOC detections
- SOC reporting → Analysis database: persists reports
- MCP client → MCP server: sends analysis requests (evidence: `agentic-system/src/agentic_system/mcp/server.py`)
- MCP server → Tool execution: dispatches tools (evidence: `agentic-system/src/agentic_system/mcp/server.py`)
