# yahmadi45/artex architecture

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

- Interactive diagram: https://gitdiagram.com/yahmadi45/artex
- Repository: https://github.com/yahmadi45/artex

## Overview

ARTEX is a self-hosted, LLM-driven penetration-testing platform. Operators configure and start tasks through the web UI; the backend engine coordinates planning and worker execution, then persists discoveries and evidence for review. The README documents the planner/worker loop, linked asset and exploration graphs, traffic capture, scope and approval controls, and budgets. Several links below are based on those documented capabilities; sampled excerpts do not expose all runtime wiring.

Main entry points: [`agent/worker.go`](https://github.com/yahmadi45/artex/blob/main/agent/worker.go) (Worker), [`server/engine.go`](https://github.com/yahmadi45/artex/blob/main/server/engine.go) (Task engine), [`db/db.go`](https://github.com/yahmadi45/artex/blob/main/db/db.go) (PostgreSQL), [`web/src/app/(main)/function/tasks/page.tsx`](https://github.com/yahmadi45/artex/blob/main/web/src/app/(main)/function/tasks/page.tsx) (Web UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Operator interface"]
  node_webui["Web UI<br/>[page.tsx]"]
  node_httpapi["HTTP API<br/>[routes.go]"]
end

subgraph group_orchestration["Task orchestration"]
  node_engine["Task engine<br/>[engine.go]"]
  node_planner["Planner<br/>[planner.go]"]
  node_worker["Worker<br/>[worker.go]"]
  node_llm["Model providers<br/>[provider.go]"]
end

subgraph group_execution["Testing and safeguards"]
  node_sandbox["Isolated execution<br/>[client.go]"]
  node_scope["Scope and egress<br/>[egress.go]"]
  node_approvals["Action approvals<br/>[intercept.go]"]
  node_guard["Safety gates<br/>[guard.go]"]
end

subgraph group_knowledge["Discovery and evidence"]
  node_scan["Scan ingestion<br/>[scan_ingest.go]"]
  node_traffic["Traffic capture<br/>[traffic.go]"]
  node_findings["Finding workflow"]
  node_evidence["Evidence store<br/>[store.go]"]
end

subgraph group_storage["Persistence and services"]
  node_assetgraph[("Shared asset graph<br/>[assets.go]")]
  node_exploration[("Exploration graph<br/>[exploration.go]")]
  node_database[("PostgreSQL<br/>[db.go]")]
  node_archive["Task archives<br/>[s3.go]"]
end

node_operator(("Operator"))
node_target(("Test targets"))

node_operator -->|"configures tasks"| node_webui
node_webui -->|"uses API"| node_httpapi
node_httpapi -.->|"controls tasks"| node_engine
node_engine -->|"dispatches rounds"| node_planner
node_engine -->|"dispatches intents"| node_worker
node_planner -.->|"judges goals"| node_llm
node_worker -.->|"requests analysis"| node_llm
node_worker -->|"runs tools"| node_sandbox
node_worker -->|"constrained by"| node_scope
node_worker -->|"gated by"| node_approvals
node_worker -->|"gated by"| node_guard
node_target -->|"exchanges traffic"| node_traffic
node_traffic -->|"records evidence"| node_evidence
node_worker -.->|"ingests scans"| node_scan
node_worker -->|"writes findings"| node_findings
node_worker -->|"writes assets"| node_assetgraph
node_worker -->|"writes progress"| node_exploration
node_findings -->|"links traffic proof"| node_evidence
node_assetgraph -->|"persists in"| node_database
node_exploration -->|"persists in"| node_database
node_database -.->|"archives tasks"| node_archive

click node_webui "https://github.com/yahmadi45/artex/blob/main/web/src/app/(main)/function/tasks/page.tsx"
click node_httpapi "https://github.com/yahmadi45/artex/blob/main/server/routes.go"
click node_engine "https://github.com/yahmadi45/artex/blob/main/server/engine.go"
click node_planner "https://github.com/yahmadi45/artex/blob/main/agent/planner.go"
click node_worker "https://github.com/yahmadi45/artex/blob/main/agent/worker.go"
click node_llm "https://github.com/yahmadi45/artex/blob/main/agent/provider.go"
click node_sandbox "https://github.com/yahmadi45/artex/blob/main/sandbox/client.go"
click node_scope "https://github.com/yahmadi45/artex/blob/main/egress/egress.go"
click node_approvals "https://github.com/yahmadi45/artex/blob/main/intercept/intercept.go"
click node_guard "https://github.com/yahmadi45/artex/blob/main/guard/guard.go"
click node_scan "https://github.com/yahmadi45/artex/blob/main/agent/scan_ingest.go"
click node_traffic "https://github.com/yahmadi45/artex/blob/main/traffic/traffic.go"
click node_findings "https://github.com/yahmadi45/artex/blob/main/agent/finding_workflow.go"
click node_evidence "https://github.com/yahmadi45/artex/blob/main/evidence/store.go"
click node_assetgraph "https://github.com/yahmadi45/artex/blob/main/db/assets.go"
click node_exploration "https://github.com/yahmadi45/artex/blob/main/db/exploration.go"
click node_database "https://github.com/yahmadi45/artex/blob/main/db/db.go"
click node_archive "https://github.com/yahmadi45/artex/blob/main/archivestore/s3.go"

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_webui,node_httpapi toneBlue
class node_engine,node_planner,node_worker,node_llm toneAmber
class node_sandbox,node_scope,node_approvals,node_guard toneMint
class node_scan,node_traffic,node_findings,node_evidence toneRose
class node_assetgraph,node_exploration,node_database,node_archive,node_operator,node_target toneIndigo
```

## Components

### Operator interface

- [Web UI](https://github.com/yahmadi45/artex/blob/main/web/src/app/(main)/function/tasks/page.tsx): `web/src/app/(main)/function/tasks/page.tsx`
- [HTTP API](https://github.com/yahmadi45/artex/blob/main/server/routes.go): `server/routes.go`

### Task orchestration

- [Task engine](https://github.com/yahmadi45/artex/blob/main/server/engine.go): `server/engine.go`
- [Planner](https://github.com/yahmadi45/artex/blob/main/agent/planner.go): `agent/planner.go`
- [Worker](https://github.com/yahmadi45/artex/blob/main/agent/worker.go): `agent/worker.go`
- [Model providers](https://github.com/yahmadi45/artex/blob/main/agent/provider.go): `agent/provider.go`

### Testing and safeguards

- [Isolated execution](https://github.com/yahmadi45/artex/blob/main/sandbox/client.go): `sandbox/client.go`
- [Scope and egress](https://github.com/yahmadi45/artex/blob/main/egress/egress.go): `egress/egress.go`
- [Action approvals](https://github.com/yahmadi45/artex/blob/main/intercept/intercept.go): `intercept/intercept.go`
- [Safety gates](https://github.com/yahmadi45/artex/blob/main/guard/guard.go): `guard/guard.go`

### Discovery and evidence

- [Scan ingestion](https://github.com/yahmadi45/artex/blob/main/agent/scan_ingest.go): `agent/scan_ingest.go`
- [Traffic capture](https://github.com/yahmadi45/artex/blob/main/traffic/traffic.go): `traffic/traffic.go`
- [Finding workflow](https://github.com/yahmadi45/artex/blob/main/agent/finding_workflow.go): `agent/finding_workflow.go`
- [Evidence store](https://github.com/yahmadi45/artex/blob/main/evidence/store.go): `evidence/store.go`

### Persistence and services

- [Shared asset graph](https://github.com/yahmadi45/artex/blob/main/db/assets.go): `db/assets.go`
- [Exploration graph](https://github.com/yahmadi45/artex/blob/main/db/exploration.go): `db/exploration.go`
- [PostgreSQL](https://github.com/yahmadi45/artex/blob/main/db/db.go): `db/db.go`
- [Task archives](https://github.com/yahmadi45/artex/blob/main/archivestore/s3.go): `archivestore/s3.go`

### Other components

- **Operator**
- **Test targets**

## Connections

- Operator → Web UI: configures tasks (evidence: `README.md`)
- Web UI → HTTP API: uses API (evidence: `README.md`)
- HTTP API → Task engine: controls tasks
- Task engine → Planner: dispatches rounds (evidence: `README.md`)
- Task engine → Worker: dispatches intents (evidence: `README.md`)
- Planner → Model providers: judges goals
- Worker → Model providers: requests analysis
- Worker → Isolated execution: runs tools (evidence: `README.md`)
- Worker → Scope and egress: constrained by (evidence: `README.md`)
- Worker → Action approvals: gated by (evidence: `README.md`)
- Worker → Safety gates: gated by (evidence: `README.md`)
- Test targets → Traffic capture: exchanges traffic (evidence: `README.md`)
- Traffic capture → Evidence store: records evidence (evidence: `README.md`)
- Worker → Scan ingestion: ingests scans
- Worker → Finding workflow: writes findings (evidence: `README.md`)
- Worker → Shared asset graph: writes assets (evidence: `README.md`)
- Worker → Exploration graph: writes progress (evidence: `README.md`)
- Finding workflow → Evidence store: links traffic proof (evidence: `README.md`)
- Shared asset graph → PostgreSQL: persists in (evidence: `README.md`)
- Exploration graph → PostgreSQL: persists in (evidence: `README.md`)
- PostgreSQL → Task archives: archives tasks
