# sohampatil5337/elixir-pentest-agent architecture

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

- Interactive diagram: https://gitdiagram.com/sohampatil5337/elixir-pentest-agent
- Repository: https://github.com/sohampatil5337/elixir-pentest-agent

## Overview

This is an AI-assisted web penetration-testing dashboard. An operator starts a scan; the backend coordinates target crawling (optionally with login), form prioritization and injection checks, then generates findings and a report. Distinct stages include reconnaissance, endpoint resolution, attack-payload checks, and reporting. The frontend is served by the backend, and an Ollama-backed LLM supports planning and explanations. The README is minimal; the dashboard’s detailed UI behavior and some report-persistence wiring are not shown in the excerpts, so those relationships are omitted or marked unverified.

Main entry points: [`backend/main.py`](https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/main.py) (FastAPI service), [`backend/agents/planner_agent.py`](https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/agents/planner_agent.py) (Scan planner), [`backend/agents/injection_agent.py`](https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/agents/injection_agent.py) (Injection tester), [`frontend/app.js`](https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/frontend/app.js) (Web dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Dashboard interface"]
  node_dashboard["Web dashboard<br/>[app.js]"]
  node_api["FastAPI service<br/>[main.py]"]
end

subgraph group_orchestration["Scan orchestration"]
  node_planner["Scan planner<br/>[planner_agent.py]"]
  node_recon_runner["Recon subprocess"]
end

subgraph group_testing["Recon and testing"]
  node_recon["Browser reconnaissance<br/>[recon_agent.py]"]
  node_endpoint_map["Endpoint resolver<br/>[endpoint_map.py]"]
  node_injector["Injection tester<br/>[injection_agent.py]"]
  node_attack_modules["Attack checks<br/>[attack_modules.py]"]
end

subgraph group_results["Results and AI"]
  node_reporter["Report generator<br/>[reporting_agent.py]"]
  node_llm_client["LLM client<br/>[llm_client.py]"]
  node_scan_history["Scan history<br/>[main.py]"]
  node_report_files["Report files<br/>[main.py]"]
end

node_operator(("Operator"))
node_scan_target["Target web app"]
node_ollama["Ollama service"]

node_operator -.->|"uses"| node_dashboard
node_dashboard -.->|"requests scans"| node_api
node_api -->|"serves"| node_dashboard
node_api -->|"runs scan"| node_planner
node_planner -->|"launches"| node_recon_runner
node_recon_runner -->|"runs crawl"| node_recon
node_recon -.->|"crawls"| node_scan_target
node_planner -->|"tests forms"| node_injector
node_injector -->|"resolves endpoint"| node_endpoint_map
node_injector -->|"runs checks"| node_attack_modules
node_injector -->|"sends payloads"| node_scan_target
node_planner -->|"plans priority"| node_llm_client
node_api -->|"generates report"| node_reporter
node_reporter -->|"requests explanations"| node_llm_client
node_llm_client -->|"sends prompts"| node_ollama
node_api -->|"reads and writes"| node_scan_history
node_api -->|"serves reports"| node_report_files

click node_dashboard "https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/frontend/app.js"
click node_api "https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/main.py"
click node_planner "https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/agents/planner_agent.py"
click node_recon_runner "https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/run_recon_subprocess.py"
click node_recon "https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/agents/recon_agent.py"
click node_endpoint_map "https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/agents/endpoint_map.py"
click node_injector "https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/agents/injection_agent.py"
click node_attack_modules "https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/agents/attack_modules.py"
click node_reporter "https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/agents/reporting_agent.py"
click node_llm_client "https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/core/llm_client.py"
click node_scan_history "https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/main.py"
click node_report_files "https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/main.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_dashboard,node_api toneBlue
class node_planner,node_recon_runner toneAmber
class node_recon,node_endpoint_map,node_injector,node_attack_modules toneMint
class node_reporter,node_llm_client,node_scan_history,node_report_files toneRose
class node_operator,node_scan_target,node_ollama toneIndigo
```

## Components

### Dashboard interface

- [Web dashboard](https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/frontend/app.js): `frontend/app.js`
- [FastAPI service](https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/main.py): `backend/main.py`

### Scan orchestration

- [Scan planner](https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/agents/planner_agent.py): `backend/agents/planner_agent.py`
- [Recon subprocess](https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/run_recon_subprocess.py): `backend/run_recon_subprocess.py`

### Recon and testing

- [Browser reconnaissance](https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/agents/recon_agent.py): `backend/agents/recon_agent.py`
- [Endpoint resolver](https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/agents/endpoint_map.py): `backend/agents/endpoint_map.py`
- [Injection tester](https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/agents/injection_agent.py): `backend/agents/injection_agent.py`
- [Attack checks](https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/agents/attack_modules.py): `backend/agents/attack_modules.py`

### Results and AI

- [Report generator](https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/agents/reporting_agent.py): `backend/agents/reporting_agent.py`
- [LLM client](https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/core/llm_client.py): `backend/core/llm_client.py`
- [Scan history](https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/main.py): `backend/main.py`
- [Report files](https://github.com/sohampatil5337/elixir-pentest-agent/blob/main/backend/main.py): `backend/main.py`

### Other components

- **Operator**
- **Target web app**
- **Ollama service**

## Connections

- Operator → Web dashboard: uses
- Web dashboard → FastAPI service: requests scans
- FastAPI service → Web dashboard: serves (evidence: `backend/main.py`)
- FastAPI service → Scan planner: runs scan (evidence: `backend/main.py`)
- Scan planner → Recon subprocess: launches (evidence: `backend/agents/planner_agent.py`)
- Recon subprocess → Browser reconnaissance: runs crawl (evidence: `backend/run_recon_subprocess.py`)
- Browser reconnaissance → Target web app: crawls
- Scan planner → Injection tester: tests forms (evidence: `backend/agents/planner_agent.py`)
- Injection tester → Endpoint resolver: resolves endpoint (evidence: `backend/agents/injection_agent.py`)
- Injection tester → Attack checks: runs checks (evidence: `backend/agents/injection_agent.py`)
- Injection tester → Target web app: sends payloads (evidence: `backend/agents/injection_agent.py`)
- Scan planner → LLM client: plans priority (evidence: `backend/agents/planner_agent.py`)
- FastAPI service → Report generator: generates report (evidence: `backend/main.py`)
- Report generator → LLM client: requests explanations (evidence: `backend/agents/reporting_agent.py`)
- LLM client → Ollama service: sends prompts (evidence: `backend/core/llm_client.py`)
- FastAPI service → Scan history: reads and writes (evidence: `backend/main.py`)
- FastAPI service → Report files: serves reports (evidence: `backend/main.py`)
