# larlarua/autocve architecture

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

- Interactive diagram: https://gitdiagram.com/larlarua/autocve
- Repository: https://github.com/larlarua/autocve

## Overview

AutoCVE is a web-based security-audit and CVE-discovery product. Its documented main journey is project selection/import, audit-task creation, coordinated agent analysis and verification, then vulnerability management and report generation; users can also follow live progress and continue an audit in a session. The graph preserves the documented scan, skills, and one-click CVE branches. Source excerpts show selected runtime details, while other subsystems are represented from the README and source index; their internal links are omitted where implementation evidence was not shown.

Main entry points: [`backend/app/services/finding_runtime/query_loop.py`](https://github.com/larlarua/autocve/blob/main/backend/app/services/finding_runtime/query_loop.py) (Finding runtime), [`backend/app/api/v1/endpoints/agent_tasks.py`](https://github.com/larlarua/autocve/blob/main/backend/app/api/v1/endpoints/agent_tasks.py) (Agent task API), [`backend/app/services/agent/agents/orchestrator.py`](https://github.com/larlarua/autocve/blob/main/backend/app/services/agent/agents/orchestrator.py) (Agent orchestration), [`backend/app/api/v1/endpoints/audit_sessions.py`](https://github.com/larlarua/autocve/blob/main/backend/app/api/v1/endpoints/audit_sessions.py) (Session APIs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_web["AutoCVE UI<br/>[routes.tsx]"]
  node_audit_ui["Audit workspace<br/>[index.tsx]"]
  node_session_ui["Audit session<br/>[index.tsx]"]
end

subgraph group_api["API and persistence"]
  node_project_api["Project APIs<br/>[projects.py]"]
  node_task_api["Agent task API<br/>[agent_tasks.py]"]
  node_session_api["Session APIs<br/>[audit_sessions.py]"]
  node_event_stream["Task event stream<br/>[event_manager.py]"]
  node_db[("Application database<br/>[session.py]")]
  node_project_files["Project source storage<br/>[zip_storage.py]"]
end

subgraph group_audit["Audit runtimes"]
  node_orchestrator["Agent orchestration<br/>[orchestrator.py]"]
  node_scan["Static scan pipeline<br/>[pipeline.py]"]
  node_finding["Finding runtime<br/>[query_loop.py]"]
  node_finding_state["Finding state model<br/>[models.py]"]
  node_llm["LLM service<br/>[service.py]"]
  node_knowledge["Security knowledge<br/>[fastapi.py]"]
end

subgraph group_cve["CVE and reporting"]
  node_cve_discovery["CVE discovery<br/>[discovery.py]"]
  node_cve_runner["One-click CVE runner<br/>[runner.py]"]
  node_vulnerability["Vulnerability management"]
  node_report["Report generation"]
end

subgraph group_integrations["Analysis integrations"]
  node_checkmarx["Checkmarx integration<br/>[workflow.py]"]
  node_rag["Knowledge retrieval<br/>[retriever.py]"]
  node_semgrep["Semgrep executor<br/>[semgrep.py]"]
  node_skills["Skills catalog<br/>[catalog.py]"]
end

node_user(("Security auditor"))

node_user -->|"uses"| node_web
node_web -.->|"imports project"| node_project_api
node_project_api -.->|"stores source"| node_project_files
node_user -->|"creates audit"| node_task_api
node_task_api -->|"dispatches agents"| node_orchestrator
node_orchestrator -->|"runs scan stage"| node_scan
node_orchestrator -->|"runs finding stage"| node_finding
node_orchestrator -.->|"requests model"| node_llm
node_finding -->|"uses state model"| node_finding_state
node_finding -.->|"consults knowledge"| node_knowledge
node_scan -->|"executes scans"| node_semgrep
node_task_api -->|"streams task events"| node_event_stream
node_event_stream -->|"delivers progress"| node_audit_ui
node_user -->|"continues audit"| node_session_ui
node_session_ui -.->|"sends follow-up"| node_session_api
node_session_api -->|"continues runtime"| node_finding
node_task_api -->|"persists tasks"| node_db
node_session_api -->|"persists sessions"| node_db
node_user -->|"starts CVE search"| node_cve_discovery
node_cve_discovery -.->|"selects projects"| node_cve_runner
node_cve_runner -.->|"creates audit task"| node_task_api
node_finding -->|"submits findings"| node_vulnerability
node_vulnerability -->|"feeds report"| node_report
node_user -.->|"runs integration"| node_checkmarx
node_finding -.->|"retrieves context"| node_rag
node_user -->|"configures skills"| node_skills

click node_web "https://github.com/larlarua/autocve/blob/main/frontend/src/app/routes.tsx"
click node_audit_ui "https://github.com/larlarua/autocve/blob/main/frontend/src/pages/AgentAudit/index.tsx"
click node_session_ui "https://github.com/larlarua/autocve/blob/main/frontend/src/pages/AuditSession/index.tsx"
click node_project_api "https://github.com/larlarua/autocve/blob/main/backend/app/api/v1/endpoints/projects.py"
click node_task_api "https://github.com/larlarua/autocve/blob/main/backend/app/api/v1/endpoints/agent_tasks.py"
click node_session_api "https://github.com/larlarua/autocve/blob/main/backend/app/api/v1/endpoints/audit_sessions.py"
click node_event_stream "https://github.com/larlarua/autocve/blob/main/backend/app/services/agent/event_manager.py"
click node_db "https://github.com/larlarua/autocve/blob/main/backend/app/db/session.py"
click node_project_files "https://github.com/larlarua/autocve/blob/main/backend/app/services/zip_storage.py"
click node_orchestrator "https://github.com/larlarua/autocve/blob/main/backend/app/services/agent/agents/orchestrator.py"
click node_scan "https://github.com/larlarua/autocve/blob/main/backend/app/services/scan_runtime/pipeline.py"
click node_finding "https://github.com/larlarua/autocve/blob/main/backend/app/services/finding_runtime/query_loop.py"
click node_finding_state "https://github.com/larlarua/autocve/blob/main/backend/app/services/finding_runtime/models.py"
click node_llm "https://github.com/larlarua/autocve/blob/main/backend/app/services/llm/service.py"
click node_knowledge "https://github.com/larlarua/autocve/blob/main/backend/app/services/agent/knowledge/frameworks/fastapi.py"
click node_cve_discovery "https://github.com/larlarua/autocve/blob/main/backend/app/services/one_click_cve/discovery.py"
click node_cve_runner "https://github.com/larlarua/autocve/blob/main/backend/app/services/one_click_cve/runner.py"
click node_vulnerability "https://github.com/larlarua/autocve/blob/main/backend/app/services/managed_vulnerability_service.py"
click node_report "https://github.com/larlarua/autocve/blob/main/backend/app/services/vulnerability_report_generation.py"
click node_checkmarx "https://github.com/larlarua/autocve/blob/main/backend/app/services/checkmarx_scan/workflow.py"
click node_rag "https://github.com/larlarua/autocve/blob/main/backend/app/services/rag/retriever.py"
click node_semgrep "https://github.com/larlarua/autocve/blob/main/backend/app/services/scan_runtime/executors/semgrep.py"
click node_skills "https://github.com/larlarua/autocve/blob/main/backend/app/services/skills_runtime/catalog.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_web,node_audit_ui,node_session_ui toneBlue
class node_project_api,node_task_api,node_session_api,node_event_stream,node_db,node_project_files toneAmber
class node_orchestrator,node_scan,node_finding,node_finding_state,node_llm,node_knowledge toneMint
class node_cve_discovery,node_cve_runner,node_vulnerability,node_report toneRose
class node_checkmarx,node_rag,node_semgrep,node_skills,node_user toneIndigo
```

## Components

### User interface

- [AutoCVE UI](https://github.com/larlarua/autocve/blob/main/frontend/src/app/routes.tsx): `frontend/src/app/routes.tsx`
- [Audit workspace](https://github.com/larlarua/autocve/blob/main/frontend/src/pages/AgentAudit/index.tsx): `frontend/src/pages/AgentAudit/index.tsx`
- [Audit session](https://github.com/larlarua/autocve/blob/main/frontend/src/pages/AuditSession/index.tsx): `frontend/src/pages/AuditSession/index.tsx`

### API and persistence

- [Project APIs](https://github.com/larlarua/autocve/blob/main/backend/app/api/v1/endpoints/projects.py): `backend/app/api/v1/endpoints/projects.py`
- [Agent task API](https://github.com/larlarua/autocve/blob/main/backend/app/api/v1/endpoints/agent_tasks.py): `backend/app/api/v1/endpoints/agent_tasks.py`
- [Session APIs](https://github.com/larlarua/autocve/blob/main/backend/app/api/v1/endpoints/audit_sessions.py): `backend/app/api/v1/endpoints/audit_sessions.py`
- [Task event stream](https://github.com/larlarua/autocve/blob/main/backend/app/services/agent/event_manager.py): `backend/app/services/agent/event_manager.py`
- [Application database](https://github.com/larlarua/autocve/blob/main/backend/app/db/session.py): `backend/app/db/session.py`
- [Project source storage](https://github.com/larlarua/autocve/blob/main/backend/app/services/zip_storage.py): `backend/app/services/zip_storage.py`

### Audit runtimes

- [Agent orchestration](https://github.com/larlarua/autocve/blob/main/backend/app/services/agent/agents/orchestrator.py): `backend/app/services/agent/agents/orchestrator.py`
- [Static scan pipeline](https://github.com/larlarua/autocve/blob/main/backend/app/services/scan_runtime/pipeline.py): `backend/app/services/scan_runtime/pipeline.py`
- [Finding runtime](https://github.com/larlarua/autocve/blob/main/backend/app/services/finding_runtime/query_loop.py): `backend/app/services/finding_runtime/query_loop.py`
- [Finding state model](https://github.com/larlarua/autocve/blob/main/backend/app/services/finding_runtime/models.py): `backend/app/services/finding_runtime/models.py`
- [LLM service](https://github.com/larlarua/autocve/blob/main/backend/app/services/llm/service.py): `backend/app/services/llm/service.py`
- [Security knowledge](https://github.com/larlarua/autocve/blob/main/backend/app/services/agent/knowledge/frameworks/fastapi.py): `backend/app/services/agent/knowledge/frameworks/fastapi.py`

### CVE and reporting

- [CVE discovery](https://github.com/larlarua/autocve/blob/main/backend/app/services/one_click_cve/discovery.py): `backend/app/services/one_click_cve/discovery.py`
- [One-click CVE runner](https://github.com/larlarua/autocve/blob/main/backend/app/services/one_click_cve/runner.py): `backend/app/services/one_click_cve/runner.py`
- [Vulnerability management](https://github.com/larlarua/autocve/blob/main/backend/app/services/managed_vulnerability_service.py): `backend/app/services/managed_vulnerability_service.py`
- [Report generation](https://github.com/larlarua/autocve/blob/main/backend/app/services/vulnerability_report_generation.py): `backend/app/services/vulnerability_report_generation.py`

### Analysis integrations

- [Checkmarx integration](https://github.com/larlarua/autocve/blob/main/backend/app/services/checkmarx_scan/workflow.py): `backend/app/services/checkmarx_scan/workflow.py`
- [Knowledge retrieval](https://github.com/larlarua/autocve/blob/main/backend/app/services/rag/retriever.py): `backend/app/services/rag/retriever.py`
- [Semgrep executor](https://github.com/larlarua/autocve/blob/main/backend/app/services/scan_runtime/executors/semgrep.py): `backend/app/services/scan_runtime/executors/semgrep.py`
- [Skills catalog](https://github.com/larlarua/autocve/blob/main/backend/app/services/skills_runtime/catalog.py): `backend/app/services/skills_runtime/catalog.py`

### Other components

- **Security auditor**

## Connections

- Security auditor → AutoCVE UI: uses (evidence: `README.md`)
- AutoCVE UI → Project APIs: imports project
- Project APIs → Project source storage: stores source
- Security auditor → Agent task API: creates audit (evidence: `README.md`)
- Agent task API → Agent orchestration: dispatches agents (evidence: `README.md`)
- Agent orchestration → Static scan pipeline: runs scan stage (evidence: `README.md`)
- Agent orchestration → Finding runtime: runs finding stage (evidence: `README.md`)
- Agent orchestration → LLM service: requests model
- Finding runtime → Finding state model: uses state model (evidence: `backend/app/services/finding_runtime/query_loop.py`)
- Finding runtime → Security knowledge: consults knowledge
- Static scan pipeline → Semgrep executor: executes scans (evidence: `backend/app/services/scan_runtime/pipeline.py`)
- Agent task API → Task event stream: streams task events (evidence: `backend/app/api/v1/endpoints/agent_tasks.py`)
- Task event stream → Audit workspace: delivers progress (evidence: `README.md`)
- Security auditor → Audit session: continues audit (evidence: `README.md`)
- Audit session → Session APIs: sends follow-up
- Session APIs → Finding runtime: continues runtime (evidence: `backend/app/api/v1/endpoints/audit_sessions.py`)
- Agent task API → Application database: persists tasks (evidence: `backend/app/api/v1/endpoints/agent_tasks.py`)
- Session APIs → Application database: persists sessions (evidence: `backend/app/api/v1/endpoints/audit_sessions.py`)
- Security auditor → CVE discovery: starts CVE search (evidence: `README.md`)
- CVE discovery → One-click CVE runner: selects projects
- One-click CVE runner → Agent task API: creates audit task
- Finding runtime → Vulnerability management: submits findings (evidence: `README.md`)
- Vulnerability management → Report generation: feeds report (evidence: `README.md`)
- Security auditor → Checkmarx integration: runs integration
- Finding runtime → Knowledge retrieval: retrieves context
- Security auditor → Skills catalog: configures skills (evidence: `README.md`)
