# anythinglinux/artex architecture

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

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

## Overview

ARTEX is a self-hosted autonomous penetration-testing platform. An operator starts a task through the web interface; the event-driven engine plans uncovered intents, workers run tools, and their observations update linked exploration and asset graphs. Findings retain traffic evidence for review and retesting. Scope gates, approvals, and budgets constrain execution. The README documents these product flows and capabilities; sampled source and the source index confirm key modules and imports, but many runtime details were not excerpted, so uncertain connections are omitted.

Main entry points: [`server/server.go`](https://github.com/anythinglinux/artex/blob/main/server/server.go) (HTTP API), [`agent/worker.go`](https://github.com/anythinglinux/artex/blob/main/agent/worker.go) (Planner and workers), [`server/engine.go`](https://github.com/anythinglinux/artex/blob/main/server/engine.go) (Task engine), [`db`](https://github.com/anythinglinux/artex/tree/main/db) (PostgreSQL graphs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Operator interface"]
  node_web_tasks["Task interface<br/>[page.tsx]"]
  node_web_findings["Findings interface<br/>[page.tsx]"]
  node_web_traffic["Traffic interface<br/>[page.tsx]"]
end

subgraph group_orchestration["Task orchestration"]
  node_api["HTTP API<br/>[server.go]"]
  node_engine["Task engine<br/>[engine.go]"]
  node_manager["Task manager<br/>[manager.go]"]
  node_planner_worker["Planner and workers<br/>[worker.go]"]
end

subgraph group_graphs["Knowledge and evidence"]
  node_postgres[("PostgreSQL graphs")]
  node_scan_ingest["Scan ingestion<br/>[scan_ingest.go]"]
  node_evidence[("Traffic evidence<br/>[store.go]")]
  node_reporting["Reports and quality"]
end

subgraph group_execution["Controlled execution"]
  node_guard["Scope and approvals<br/>[guard.go]"]
  node_egress["Egress controls<br/>[egress.go]"]
  node_traffic_proxy["Recording proxy<br/>[traffic.go]"]
  node_budgets["Run budgets<br/>[engine_budget.go]"]
  node_llm_records[("LLM audit records<br/>[llmrec.go]")]
end

subgraph group_integrations["External integrations"]
  node_llm_provider["LLM provider<br/>[pool.go]"]
  node_external_tools["Security tools"]
  node_browser_extension["Browser capture<br/>[background.js]"]
  node_archive[("Object archive<br/>[s3.go]")]
  node_notifications["Notifications<br/>[notify.go]"]
end

node_operator(("Operator"))

node_operator -->|"starts task"| node_web_tasks
node_web_tasks -->|"submits requests"| node_api
node_api -->|"controls tasks"| node_engine
node_engine -->|"plans and dispatches"| node_planner_worker
node_planner_worker -->|"writes graph results"| node_postgres
node_planner_worker -->|"runs tools"| node_external_tools
node_planner_worker -.->|"requests model calls"| node_llm_provider
node_engine -.->|"coordinates task state"| node_manager
node_manager -.->|"loads task data"| node_postgres
node_planner_worker -->|"ingests scan output"| node_scan_ingest
node_scan_ingest -->|"records assets and facts"| node_postgres
node_engine -->|"enforces limits"| node_budgets
node_budgets -->|"meters usage"| node_llm_records
node_planner_worker -->|"gates actions"| node_guard
node_guard -.->|"constrains network access"| node_egress
node_egress -.->|"routes traffic"| node_traffic_proxy
node_browser_extension -->|"captures traffic"| node_traffic_proxy
node_traffic_proxy -.->|"stores captured evidence"| node_evidence
node_evidence -->|"links traffic to records"| node_postgres
node_api -->|"serves finding data"| node_web_findings
node_api -.->|"serves traffic data"| node_web_traffic
node_api -.->|"provides report data"| node_reporting
node_api -.->|"manages task archives"| node_archive
node_api -.->|"configures notifications"| node_notifications

click node_web_tasks "https://github.com/anythinglinux/artex/blob/main/web/src/app/(main)/function/tasks/page.tsx"
click node_web_findings "https://github.com/anythinglinux/artex/blob/main/web/src/app/(main)/function/findings/page.tsx"
click node_web_traffic "https://github.com/anythinglinux/artex/blob/main/web/src/app/(main)/function/traffic/page.tsx"
click node_api "https://github.com/anythinglinux/artex/blob/main/server/server.go"
click node_engine "https://github.com/anythinglinux/artex/blob/main/server/engine.go"
click node_manager "https://github.com/anythinglinux/artex/blob/main/server/manager.go"
click node_planner_worker "https://github.com/anythinglinux/artex/blob/main/agent/worker.go"
click node_postgres "https://github.com/anythinglinux/artex/tree/main/db"
click node_scan_ingest "https://github.com/anythinglinux/artex/blob/main/agent/scan_ingest.go"
click node_evidence "https://github.com/anythinglinux/artex/blob/main/evidence/store.go"
click node_reporting "https://github.com/anythinglinux/artex/tree/main/report"
click node_guard "https://github.com/anythinglinux/artex/blob/main/guard/guard.go"
click node_egress "https://github.com/anythinglinux/artex/blob/main/egress/egress.go"
click node_traffic_proxy "https://github.com/anythinglinux/artex/blob/main/traffic/traffic.go"
click node_budgets "https://github.com/anythinglinux/artex/blob/main/server/engine_budget.go"
click node_llm_records "https://github.com/anythinglinux/artex/blob/main/llmrec/llmrec.go"
click node_llm_provider "https://github.com/anythinglinux/artex/blob/main/llmpool/pool.go"
click node_browser_extension "https://github.com/anythinglinux/artex/blob/main/extension/background.js"
click node_archive "https://github.com/anythinglinux/artex/blob/main/archivestore/s3.go"
click node_notifications "https://github.com/anythinglinux/artex/blob/main/notify/notify.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_web_tasks,node_web_findings,node_web_traffic toneBlue
class node_api,node_engine,node_manager,node_planner_worker toneAmber
class node_postgres,node_scan_ingest,node_evidence,node_reporting toneMint
class node_guard,node_egress,node_traffic_proxy,node_budgets,node_llm_records toneRose
class node_llm_provider,node_external_tools,node_browser_extension,node_archive,node_notifications,node_operator toneIndigo
```

## Components

### Operator interface

- [Task interface](https://github.com/anythinglinux/artex/blob/main/web/src/app/(main)/function/tasks/page.tsx): `web/src/app/(main)/function/tasks/page.tsx`
- [Findings interface](https://github.com/anythinglinux/artex/blob/main/web/src/app/(main)/function/findings/page.tsx): `web/src/app/(main)/function/findings/page.tsx`
- [Traffic interface](https://github.com/anythinglinux/artex/blob/main/web/src/app/(main)/function/traffic/page.tsx): `web/src/app/(main)/function/traffic/page.tsx`

### Task orchestration

- [HTTP API](https://github.com/anythinglinux/artex/blob/main/server/server.go): `server/server.go`
- [Task engine](https://github.com/anythinglinux/artex/blob/main/server/engine.go): `server/engine.go`
- [Task manager](https://github.com/anythinglinux/artex/blob/main/server/manager.go): `server/manager.go`
- [Planner and workers](https://github.com/anythinglinux/artex/blob/main/agent/worker.go): `agent/worker.go`

### Knowledge and evidence

- [PostgreSQL graphs](https://github.com/anythinglinux/artex/tree/main/db): `db`
- [Scan ingestion](https://github.com/anythinglinux/artex/blob/main/agent/scan_ingest.go): `agent/scan_ingest.go`
- [Traffic evidence](https://github.com/anythinglinux/artex/blob/main/evidence/store.go): `evidence/store.go`
- [Reports and quality](https://github.com/anythinglinux/artex/tree/main/report): `report`

### Controlled execution

- [Scope and approvals](https://github.com/anythinglinux/artex/blob/main/guard/guard.go): `guard/guard.go`
- [Egress controls](https://github.com/anythinglinux/artex/blob/main/egress/egress.go): `egress/egress.go`
- [Recording proxy](https://github.com/anythinglinux/artex/blob/main/traffic/traffic.go): `traffic/traffic.go`
- [Run budgets](https://github.com/anythinglinux/artex/blob/main/server/engine_budget.go): `server/engine_budget.go`
- [LLM audit records](https://github.com/anythinglinux/artex/blob/main/llmrec/llmrec.go): `llmrec/llmrec.go`

### External integrations

- [LLM provider](https://github.com/anythinglinux/artex/blob/main/llmpool/pool.go): `llmpool/pool.go`
- **Security tools**
- [Browser capture](https://github.com/anythinglinux/artex/blob/main/extension/background.js): `extension/background.js`
- [Object archive](https://github.com/anythinglinux/artex/blob/main/archivestore/s3.go): `archivestore/s3.go`
- [Notifications](https://github.com/anythinglinux/artex/blob/main/notify/notify.go): `notify/notify.go`

### Other components

- **Operator**

## Connections

- Operator → Task interface: starts task
- Task interface → HTTP API: submits requests
- HTTP API → Task engine: controls tasks
- Task engine → Planner and workers: plans and dispatches
- Planner and workers → PostgreSQL graphs: writes graph results
- Planner and workers → Security tools: runs tools
- Planner and workers → LLM provider: requests model calls
- Task engine → Task manager: coordinates task state
- Task manager → PostgreSQL graphs: loads task data (evidence: `server/manager.go`)
- Planner and workers → Scan ingestion: ingests scan output
- Scan ingestion → PostgreSQL graphs: records assets and facts (evidence: `agent/scan_ingest.go`)
- Task engine → Run budgets: enforces limits (evidence: `server/engine_budget.go`)
- Run budgets → LLM audit records: meters usage (evidence: `server/engine_budget.go`)
- Planner and workers → Scope and approvals: gates actions
- Scope and approvals → Egress controls: constrains network access
- Egress controls → Recording proxy: routes traffic
- Browser capture → Recording proxy: captures traffic
- Recording proxy → Traffic evidence: stores captured evidence
- Traffic evidence → PostgreSQL graphs: links traffic to records (evidence: `evidence/store.go`)
- HTTP API → Findings interface: serves finding data
- HTTP API → Traffic interface: serves traffic data
- HTTP API → Reports and quality: provides report data (evidence: `server/server.go`)
- HTTP API → Object archive: manages task archives
- HTTP API → Notifications: configures notifications
