# trannhatbuilder/autonomous-vapt-system architecture

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

- Interactive diagram: https://gitdiagram.com/trannhatbuilder/autonomous-vapt-system
- Repository: https://github.com/trannhatbuilder/autonomous-vapt-system

## Overview

VAPT-AI is a vulnerability-assessment and penetration-testing platform. Its principal workflow is a user-initiated scan: the API starts a pipeline, consent and scan state are managed, an orchestrator delegates work to agents and tools, and findings are persisted and reported with progress events. Separate capabilities include authentication, human-in-the-loop review, evidence handling, C2/exploit support, and a web interface. The README is empty; relationships below rely on the supplied source excerpts and SOURCE INDEX, so unsampled subsystem links are omitted where unverified.

Main entry points: [`app/pentest/scan_pipeline.py`](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/pentest/scan_pipeline.py) (Scan Pipeline), [`app/db/session.py`](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/db/session.py) (PostgreSQL Store), [`app/orchestration/langgraph_supervisor.py`](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/orchestration/langgraph_supervisor.py) (Supervisor Orchestrator), [`app/main.py`](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/main.py) (FastAPI Application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Interface and API"]
  node_frontend["Web Console<br/>[page.tsx]"]
  node_api["FastAPI Application<br/>[main.py]"]
  node_orchestration_routes["Orchestration Routes<br/>[orchestration.py]"]
  node_auth["Authentication<br/>[manager.py]"]
end

subgraph group_scan["Scan Execution"]
  node_pipeline["Scan Pipeline<br/>[scan_pipeline.py]"]
  node_orchestrator["Supervisor Orchestrator"]
  node_events["Scan Events<br/>[events.py]"]
  node_scan_registry["Active Scan Registry<br/>[scan_registry.py]"]
end

subgraph group_agents["Agents and Tools"]
  node_registry["Agent Registry<br/>[registry.py]"]
  node_agent["Agent Runtime<br/>[base.py]"]
  node_llm_shim["Agent LLM Shim<br/>[llm_client.py]"]
  node_tool_exec["Tool Execution"]
end

subgraph group_safety["Safety and Evidence"]
  node_consent["Consent and Scope<br/>[manager.py]"]
  node_hitl["HITL Review<br/>[manager.py]"]
  node_harness["Validation Harness"]
  node_evidence["Evidence Service<br/>[service.py]"]
  node_report["Report Export"]
end

subgraph group_platform["State and Integrations"]
  node_llm_core["LLM Client<br/>[llm_client.py]"]
  node_database[("PostgreSQL Store<br/>[session.py]")]
  node_c2["C2 Management<br/>[manager.py]"]
  node_exploit["Exploit Sessions<br/>[session_manager.py]"]
end

node_user(("Operator"))
node_llm_provider{{"LLM Provider"}}

node_user -->|"operates"| node_frontend
node_frontend -.->|"requests"| node_api
node_api -.->|"routes requests"| node_orchestration_routes
node_orchestration_routes -->|"starts scans"| node_pipeline
node_api -.->|"authenticates"| node_auth
node_pipeline -.->|"checks consent"| node_consent
node_pipeline -->|"runs orchestration"| node_orchestrator
node_orchestration_routes -->|"selects mode"| node_orchestrator
node_orchestrator -->|"looks up agents"| node_registry
node_orchestrator -->|"delegates tasks"| node_agent
node_agent -->|"requests completions"| node_llm_shim
node_llm_shim -->|"delegates calls"| node_llm_core
node_llm_core -.->|"sends requests"| node_llm_provider
node_agent -->|"executes tools"| node_tool_exec
node_pipeline -->|"checks abort state"| node_scan_registry
node_pipeline -->|"emits progress"| node_events
node_pipeline -->|"persists findings"| node_evidence
node_pipeline -->|"generates reports"| node_report
node_pipeline -.->|"persists scan data"| node_database
node_hitl -->|"checks aborts"| node_scan_registry
node_events -->|"persists event history"| node_database
node_evidence -->|"stores evidence"| node_database
node_c2 -->|"stores C2 state"| node_database
node_exploit -->|"stores sessions"| node_database

click node_frontend "https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/frontend/src/app/page.tsx"
click node_api "https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/main.py"
click node_orchestration_routes "https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/routes/orchestration.py"
click node_auth "https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/auth/manager.py"
click node_pipeline "https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/pentest/scan_pipeline.py"
click node_consent "https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/consent/manager.py"
click node_orchestrator "https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/orchestration/langgraph_supervisor.py"
click node_registry "https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/agents/registry.py"
click node_agent "https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/agents/base.py"
click node_llm_shim "https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/agents/llm_client.py"
click node_llm_core "https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/core/llm_client.py"
click node_tool_exec "https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/mcp/execution_service.py"
click node_hitl "https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/hitl/manager.py"
click node_harness "https://github.com/trannhatbuilder/autonomous-vapt-system/tree/main/app/harness"
click node_evidence "https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/evidence/service.py"
click node_report "https://github.com/trannhatbuilder/autonomous-vapt-system/tree/main/app/report"
click node_events "https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/pentest/events.py"
click node_scan_registry "https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/pentest/scan_registry.py"
click node_database "https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/db/session.py"
click node_c2 "https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/c2/manager.py"
click node_exploit "https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/exploit/session_manager.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_frontend,node_api,node_orchestration_routes,node_auth toneBlue
class node_pipeline,node_orchestrator,node_events,node_scan_registry toneAmber
class node_registry,node_agent,node_llm_shim,node_tool_exec toneMint
class node_consent,node_hitl,node_harness,node_evidence,node_report toneRose
class node_llm_core,node_database,node_c2,node_exploit,node_user,node_llm_provider toneIndigo
```

## Components

### Interface and API

- [Web Console](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [FastAPI Application](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/main.py): `app/main.py`
- [Orchestration Routes](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/routes/orchestration.py): `app/routes/orchestration.py`
- [Authentication](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/auth/manager.py): `app/auth/manager.py`

### Scan Execution

- [Scan Pipeline](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/pentest/scan_pipeline.py): `app/pentest/scan_pipeline.py`
- [Supervisor Orchestrator](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/orchestration/langgraph_supervisor.py): `app/orchestration/langgraph_supervisor.py`
- [Scan Events](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/pentest/events.py): `app/pentest/events.py`
- [Active Scan Registry](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/pentest/scan_registry.py): `app/pentest/scan_registry.py`

### Agents and Tools

- [Agent Registry](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/agents/registry.py): `app/agents/registry.py`
- [Agent Runtime](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/agents/base.py): `app/agents/base.py`
- [Agent LLM Shim](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/agents/llm_client.py): `app/agents/llm_client.py`
- [Tool Execution](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/mcp/execution_service.py): `app/mcp/execution_service.py`

### Safety and Evidence

- [Consent and Scope](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/consent/manager.py): `app/consent/manager.py`
- [HITL Review](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/hitl/manager.py): `app/hitl/manager.py`
- [Validation Harness](https://github.com/trannhatbuilder/autonomous-vapt-system/tree/main/app/harness): `app/harness`
- [Evidence Service](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/evidence/service.py): `app/evidence/service.py`
- [Report Export](https://github.com/trannhatbuilder/autonomous-vapt-system/tree/main/app/report): `app/report`

### State and Integrations

- [LLM Client](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/core/llm_client.py): `app/core/llm_client.py`
- [PostgreSQL Store](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/db/session.py): `app/db/session.py`
- [C2 Management](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/c2/manager.py): `app/c2/manager.py`
- [Exploit Sessions](https://github.com/trannhatbuilder/autonomous-vapt-system/blob/main/app/exploit/session_manager.py): `app/exploit/session_manager.py`

### Other components

- **Operator**
- **LLM Provider**

## Connections

- Operator → Web Console: operates (evidence: `frontend/src/app/page.tsx`)
- Web Console → FastAPI Application: requests
- FastAPI Application → Orchestration Routes: routes requests (evidence: `app/main.py`)
- Orchestration Routes → Scan Pipeline: starts scans (evidence: `app/routes/orchestration.py`)
- FastAPI Application → Authentication: authenticates (evidence: `app/main.py`)
- Scan Pipeline → Consent and Scope: checks consent
- Scan Pipeline → Supervisor Orchestrator: runs orchestration (evidence: `app/pentest/scan_pipeline.py`)
- Orchestration Routes → Supervisor Orchestrator: selects mode (evidence: `app/routes/orchestration.py`)
- Supervisor Orchestrator → Agent Registry: looks up agents (evidence: `app/orchestration/langgraph_supervisor.py`)
- Supervisor Orchestrator → Agent Runtime: delegates tasks (evidence: `app/orchestration/langgraph_supervisor.py`)
- Agent Runtime → Agent LLM Shim: requests completions (evidence: `app/agents/base.py`)
- Agent LLM Shim → LLM Client: delegates calls (evidence: `app/agents/llm_client.py`)
- LLM Client → LLM Provider: sends requests
- Agent Runtime → Tool Execution: executes tools (evidence: `app/agents/base.py`)
- Scan Pipeline → Active Scan Registry: checks abort state (evidence: `app/pentest/scan_pipeline.py`)
- Scan Pipeline → Scan Events: emits progress (evidence: `app/pentest/scan_pipeline.py`)
- Scan Pipeline → Evidence Service: persists findings (evidence: `app/pentest/scan_pipeline.py`)
- Scan Pipeline → Report Export: generates reports (evidence: `app/pentest/scan_pipeline.py`)
- Scan Pipeline → PostgreSQL Store: persists scan data (evidence: `app/pentest/scan_pipeline.py`)
- HITL Review → Active Scan Registry: checks aborts (evidence: `app/hitl/manager.py`)
- Scan Events → PostgreSQL Store: persists event history (evidence: `app/pentest/events.py`)
- Evidence Service → PostgreSQL Store: stores evidence (evidence: `app/evidence/service.py`)
- C2 Management → PostgreSQL Store: stores C2 state (evidence: `app/c2/manager.py`)
- Exploit Sessions → PostgreSQL Store: stores sessions (evidence: `app/exploit/session_manager.py`)
