# failsafe-security/artex architecture

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

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

## Overview

ARTEX is a locally hosted, multi-agent security-testing harness. A user configures a task in the console; the backend API and event-driven engine coordinate planning and worker execution, which invokes security tools and records results. Findings can retain HTTP evidence, be reported, and enter a retest workflow. The README documents additional operational controls and integrations. Sampled source confirms key engine, storage, and capture responsibilities; some capability links rely on README statements because their implementation was not sampled.

Main entry points: [`server/server.go`](https://github.com/failsafe-security/artex/blob/main/server/server.go) (HTTP API), [`agent/worker.go`](https://github.com/failsafe-security/artex/blob/main/agent/worker.go) (Intent workers), [`web/src/app/(main)/function/tasks/page.tsx`](https://github.com/failsafe-security/artex/blob/main/web/src/app/(main)/function/tasks/page.tsx) (Web console), [`server/engine.go`](https://github.com/failsafe-security/artex/blob/main/server/engine.go) (Task engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime orchestration"]
  node_entry["Process entry<br/>[main.go]"]
  node_api["HTTP API<br/>[server.go]"]
  node_engine["Task engine<br/>[engine.go]"]
  node_manager["Task manager<br/>[manager.go]"]
  node_planner["Event planner<br/>[planner.go]"]
end

subgraph group_testing["Security testing"]
  node_worker["Intent workers<br/>[worker.go]"]
  node_tools["Security tools<br/>[tools.go]"]
  node_recon["Recon skills"]
end

subgraph group_evidence["Evidence and results"]
  node_store[("Task data stores")]
  node_traffic[("Traffic capture<br/>[traffic.go]")]
  node_evidence[("Finding evidence<br/>[store.go]")]
  node_findings["Finding workflows"]
  node_reports["Finding reports<br/>[findings.go]"]
end

subgraph group_operations["Operations and integrations"]
  node_intercept["Tool interception<br/>[intercept.go]"]
  node_guard["Execution guard<br/>[guard.go]"]
  node_llmrec["LLM recording<br/>[llmrec.go]"]
  node_notify["Notifications<br/>[notify.go]"]
  node_mcp["MCP integration<br/>[client.go]"]
end

subgraph group_console["Web console"]
  node_web["Web console<br/>[page.tsx]"]
  node_findingui["Findings console<br/>[page.tsx]"]
  node_trafficui["Traffic console<br/>[page.tsx]"]
end

node_user(("Authorized tester"))

node_user -->|"configures tasks"| node_web
node_web -->|"uses JSON API"| node_api
node_entry -->|"opens stores"| node_manager
node_entry -->|"starts server"| node_api
node_api -->|"starts runs"| node_engine
node_engine -->|"plans intents"| node_planner
node_engine -->|"runs intents"| node_worker
node_worker -->|"calls tools"| node_tools
node_tools -->|"records results"| node_store
node_worker -->|"gates tool calls"| node_guard
node_guard -->|"checks rules"| node_intercept
node_worker -.->|"uses recon skills"| node_recon
node_worker -.->|"uses MCP tools"| node_mcp
node_manager -->|"starts proxy"| node_traffic
node_traffic -->|"indexes exchanges"| node_store
node_evidence -->|"preserves exchange evidence"| node_traffic
node_api -->|"serves retests"| node_findings
node_findings -->|"binds evidence"| node_evidence
node_reports -->|"reads findings"| node_store
node_api -.->|"generates reports"| node_reports
node_web -.->|"opens findings"| node_findingui
node_web -.->|"reviews traffic"| node_trafficui
node_worker -.->|"records model calls"| node_llmrec
node_api -.->|"configures notifications"| node_notify
node_user -->|"controls runs"| node_api

click node_entry "https://github.com/failsafe-security/artex/blob/main/cmd/artex/main.go"
click node_api "https://github.com/failsafe-security/artex/blob/main/server/server.go"
click node_engine "https://github.com/failsafe-security/artex/blob/main/server/engine.go"
click node_manager "https://github.com/failsafe-security/artex/blob/main/server/manager.go"
click node_planner "https://github.com/failsafe-security/artex/blob/main/agent/planner.go"
click node_worker "https://github.com/failsafe-security/artex/blob/main/agent/worker.go"
click node_tools "https://github.com/failsafe-security/artex/blob/main/agent/tools.go"
click node_recon "https://github.com/failsafe-security/artex/tree/main/skills/api-recon/scripts"
click node_store "https://github.com/failsafe-security/artex/tree/main/db"
click node_traffic "https://github.com/failsafe-security/artex/blob/main/traffic/traffic.go"
click node_evidence "https://github.com/failsafe-security/artex/blob/main/evidence/store.go"
click node_findings "https://github.com/failsafe-security/artex/blob/main/server/finding_workflow.go"
click node_reports "https://github.com/failsafe-security/artex/blob/main/report/findings.go"
click node_intercept "https://github.com/failsafe-security/artex/blob/main/intercept/intercept.go"
click node_guard "https://github.com/failsafe-security/artex/blob/main/guard/guard.go"
click node_llmrec "https://github.com/failsafe-security/artex/blob/main/llmrec/llmrec.go"
click node_notify "https://github.com/failsafe-security/artex/blob/main/notify/notify.go"
click node_mcp "https://github.com/failsafe-security/artex/blob/main/mcphttp/client.go"
click node_web "https://github.com/failsafe-security/artex/blob/main/web/src/app/(main)/function/tasks/page.tsx"
click node_findingui "https://github.com/failsafe-security/artex/blob/main/web/src/app/(main)/function/findings/page.tsx"
click node_trafficui "https://github.com/failsafe-security/artex/blob/main/web/src/app/(main)/function/traffic/page.tsx"

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_entry,node_api,node_engine,node_manager,node_planner toneBlue
class node_worker,node_tools,node_recon toneAmber
class node_store,node_traffic,node_evidence,node_findings,node_reports toneMint
class node_intercept,node_guard,node_llmrec,node_notify,node_mcp toneRose
class node_web,node_findingui,node_trafficui,node_user toneIndigo
```

## Components

### Runtime orchestration

- [Process entry](https://github.com/failsafe-security/artex/blob/main/cmd/artex/main.go): `cmd/artex/main.go`
- [HTTP API](https://github.com/failsafe-security/artex/blob/main/server/server.go): `server/server.go`
- [Task engine](https://github.com/failsafe-security/artex/blob/main/server/engine.go): `server/engine.go`
- [Task manager](https://github.com/failsafe-security/artex/blob/main/server/manager.go): `server/manager.go`
- [Event planner](https://github.com/failsafe-security/artex/blob/main/agent/planner.go): `agent/planner.go`

### Security testing

- [Intent workers](https://github.com/failsafe-security/artex/blob/main/agent/worker.go): `agent/worker.go`
- [Security tools](https://github.com/failsafe-security/artex/blob/main/agent/tools.go): `agent/tools.go`
- [Recon skills](https://github.com/failsafe-security/artex/tree/main/skills/api-recon/scripts): `skills/api-recon/scripts`

### Evidence and results

- [Task data stores](https://github.com/failsafe-security/artex/tree/main/db): `db`
- [Traffic capture](https://github.com/failsafe-security/artex/blob/main/traffic/traffic.go): `traffic/traffic.go`
- [Finding evidence](https://github.com/failsafe-security/artex/blob/main/evidence/store.go): `evidence/store.go`
- [Finding workflows](https://github.com/failsafe-security/artex/blob/main/server/finding_workflow.go): `server/finding_workflow.go`
- [Finding reports](https://github.com/failsafe-security/artex/blob/main/report/findings.go): `report/findings.go`

### Operations and integrations

- [Tool interception](https://github.com/failsafe-security/artex/blob/main/intercept/intercept.go): `intercept/intercept.go`
- [Execution guard](https://github.com/failsafe-security/artex/blob/main/guard/guard.go): `guard/guard.go`
- [LLM recording](https://github.com/failsafe-security/artex/blob/main/llmrec/llmrec.go): `llmrec/llmrec.go`
- [Notifications](https://github.com/failsafe-security/artex/blob/main/notify/notify.go): `notify/notify.go`
- [MCP integration](https://github.com/failsafe-security/artex/blob/main/mcphttp/client.go): `mcphttp/client.go`

### Web console

- [Web console](https://github.com/failsafe-security/artex/blob/main/web/src/app/(main)/function/tasks/page.tsx): `web/src/app/(main)/function/tasks/page.tsx`
- [Findings console](https://github.com/failsafe-security/artex/blob/main/web/src/app/(main)/function/findings/page.tsx): `web/src/app/(main)/function/findings/page.tsx`
- [Traffic console](https://github.com/failsafe-security/artex/blob/main/web/src/app/(main)/function/traffic/page.tsx): `web/src/app/(main)/function/traffic/page.tsx`

### Other components

- **Authorized tester**

## Connections

- Authorized tester → Web console: configures tasks (evidence: `README.md`)
- Web console → HTTP API: uses JSON API
- Process entry → Task manager: opens stores (evidence: `cmd/artex/main.go`)
- Process entry → HTTP API: starts server (evidence: `cmd/artex/main.go`)
- HTTP API → Task engine: starts runs (evidence: `server/server.go`)
- Task engine → Event planner: plans intents (evidence: `server/engine.go`)
- Task engine → Intent workers: runs intents (evidence: `server/engine.go`)
- Intent workers → Security tools: calls tools (evidence: `agent/worker.go`)
- Security tools → Task data stores: records results (evidence: `agent/tools.go`)
- Intent workers → Execution guard: gates tool calls (evidence: `agent/worker.go`)
- Execution guard → Tool interception: checks rules (evidence: `guard/guard.go`)
- Intent workers → Recon skills: uses recon skills (evidence: `README.md`)
- Intent workers → MCP integration: uses MCP tools (evidence: `README.md`)
- Task manager → Traffic capture: starts proxy (evidence: `server/manager.go`)
- Traffic capture → Task data stores: indexes exchanges (evidence: `traffic/traffic.go`)
- Finding evidence → Traffic capture: preserves exchange evidence (evidence: `evidence/store.go`)
- HTTP API → Finding workflows: serves retests (evidence: `README.md`)
- Finding workflows → Finding evidence: binds evidence (evidence: `evidence/store.go`)
- Finding reports → Task data stores: reads findings (evidence: `report/findings.go`)
- HTTP API → Finding reports: generates reports (evidence: `README.md`)
- Web console → Findings console: opens findings (evidence: `README.md`)
- Web console → Traffic console: reviews traffic (evidence: `README.md`)
- Intent workers → LLM recording: records model calls (evidence: `README.md`)
- HTTP API → Notifications: configures notifications (evidence: `README.md`)
- Authorized tester → HTTP API: controls runs (evidence: `README.md`)
