# tsingpig/harnesssecurity-benchmark architecture

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

- Interactive diagram: https://gitdiagram.com/tsingpig/harnesssecurity-benchmark
- Repository: https://github.com/tsingpig/harnesssecurity-benchmark

## Overview

HarnessSecurity-Bench is a corpus for evaluating security mechanisms in coding-agent harnesses, not a single runtime application. Its user-facing workflow is to select a mechanism suite, work through its task packages, and use their environments and reference solutions or utility checks; the README says the full evaluation runner is maintained separately. The tree shows varied task targets, including scoring, parsing, search, maze, storage, and ordering. Relationships among those targets are not inferred; the README establishes the suite and package structure but does not document per-task execution wiring.

Main entry points: [`tasks`](https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks) (Task corpus), [`tasks/al-bench/tasks/risk-score-weights-attack/environment/scoring/cli.py`](https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/al-bench/tasks/risk-score-weights-attack/environment/scoring/cli.py) (Scoring CLI), [`tasks/mcp-bench/tasks/doc-search-index-attack/environment/docsearch/search.py`](https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/mcp-bench/tasks/doc-search-index-attack/environment/docsearch/search.py) (Document search), [`tasks/pif-bench/tasks/grid-maze-csharp-attack/environment/src/MazeEngine.cs`](https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/pif-bench/tasks/grid-maze-csharp-attack/environment/src/MazeEngine.cs) (Maze engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_benchmark["Benchmark structure"]
  node_corpus["Task corpus"]
  node_scoring["Risk scoring<br/>[score.py]"]
  node_scorecli["Scoring CLI<br/>[cli.py]"]
  node_docquery["Query parsing<br/>[query.py]"]
  node_docsearch["Document search<br/>[search.py]"]
  node_maze["Maze engine<br/>[MazeEngine.cs]"]
  node_level["Level definition<br/>[LevelDefinition.cs]"]
  node_snapshot["Snapshot builder"]
  node_orderweb["Order web app<br/>[app.rb]"]
  node_orderbook["Order book<br/>[order_book.rb]"]
end

subgraph group_aa["Approval and audit"]
  node_approval["Automatic approval"]
  node_audit["Audit logging"]
end

subgraph group_commands["Command controls"]
  node_allowlists["Command allowlists"]
  node_denylists["Command denylists"]
  node_argparser["Argument parser<br/>[parser.py]"]
  node_argtokens["Option tokens<br/>[tokens.py]"]
end

subgraph group_boundaries["Access boundaries"]
  node_filesystem["Filesystem boundaries"]
  node_network["Network isolation"]
  node_readonly["Read-only mode"]
end

subgraph group_trust["Trust and permissions"]
  node_injection["Injection filtering"]
  node_mcp["MCP permissions"]
  node_projecttrust["Project trust"]
end

node_researcher(("Benchmark user"))

node_researcher -->|"uses"| node_corpus
node_corpus -->|"includes suite"| node_approval
node_corpus -->|"includes suite"| node_audit
node_corpus -->|"includes suite"| node_allowlists
node_corpus -->|"includes suite"| node_denylists
node_corpus -->|"includes suite"| node_filesystem
node_corpus -->|"includes suite"| node_network
node_corpus -->|"includes suite"| node_readonly
node_corpus -->|"includes suite"| node_injection
node_corpus -->|"includes suite"| node_mcp
node_corpus -->|"includes suite"| node_projecttrust
node_scorecli -->|"calls"| node_scoring
node_argparser -->|"imports"| node_argtokens
node_docsearch -->|"parses with"| node_docquery
node_maze -->|"reads level"| node_level
node_orderweb -->|"routes requests"| node_orderbook

click node_corpus "https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks"
click node_approval "https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks"
click node_audit "https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks"
click node_allowlists "https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks"
click node_denylists "https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks"
click node_filesystem "https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks"
click node_network "https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks"
click node_readonly "https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks"
click node_injection "https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks"
click node_mcp "https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks"
click node_projecttrust "https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks"
click node_scoring "https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/al-bench/tasks/risk-score-weights-attack/environment/scoring/score.py"
click node_scorecli "https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/al-bench/tasks/risk-score-weights-attack/environment/scoring/cli.py"
click node_argparser "https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/cal-bench/tasks/cli-arg-parser-attack/environment/optparse_lite/parser.py"
click node_argtokens "https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/cal-bench/tasks/cli-arg-parser-attack/environment/optparse_lite/tokens.py"
click node_docquery "https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/mcp-bench/tasks/doc-search-index-attack/environment/docsearch/query.py"
click node_docsearch "https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/mcp-bench/tasks/doc-search-index-attack/environment/docsearch/search.py"
click node_maze "https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/pif-bench/tasks/grid-maze-csharp-attack/environment/src/MazeEngine.cs"
click node_level "https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/pif-bench/tasks/grid-maze-csharp-attack/environment/src/LevelDefinition.cs"
click node_snapshot "https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/pr-bench/tasks/mvcc-lsm-compaction-attack/environment/app/src/snapshot_context.cc"
click node_orderweb "https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/ro-bench/tasks/meal-order-web-attack/environment/app.rb"
click node_orderbook "https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/ro-bench/tasks/meal-order-web-attack/environment/lib/order_book.rb"

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_corpus,node_scoring,node_scorecli,node_docquery,node_docsearch,node_maze,node_level,node_snapshot,node_orderweb,node_orderbook,node_researcher toneBlue
class node_approval,node_audit toneAmber
class node_allowlists,node_denylists,node_argparser,node_argtokens toneMint
class node_filesystem,node_network,node_readonly toneRose
class node_injection,node_mcp,node_projecttrust toneIndigo
```

## Components

### Benchmark structure

- [Task corpus](https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks): `tasks`
- [Risk scoring](https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/al-bench/tasks/risk-score-weights-attack/environment/scoring/score.py): `tasks/al-bench/tasks/risk-score-weights-attack/environment/scoring/score.py`
- [Scoring CLI](https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/al-bench/tasks/risk-score-weights-attack/environment/scoring/cli.py): `tasks/al-bench/tasks/risk-score-weights-attack/environment/scoring/cli.py`
- [Query parsing](https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/mcp-bench/tasks/doc-search-index-attack/environment/docsearch/query.py): `tasks/mcp-bench/tasks/doc-search-index-attack/environment/docsearch/query.py`
- [Document search](https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/mcp-bench/tasks/doc-search-index-attack/environment/docsearch/search.py): `tasks/mcp-bench/tasks/doc-search-index-attack/environment/docsearch/search.py`
- [Maze engine](https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/pif-bench/tasks/grid-maze-csharp-attack/environment/src/MazeEngine.cs): `tasks/pif-bench/tasks/grid-maze-csharp-attack/environment/src/MazeEngine.cs`
- [Level definition](https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/pif-bench/tasks/grid-maze-csharp-attack/environment/src/LevelDefinition.cs): `tasks/pif-bench/tasks/grid-maze-csharp-attack/environment/src/LevelDefinition.cs`
- [Snapshot builder](https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/pr-bench/tasks/mvcc-lsm-compaction-attack/environment/app/src/snapshot_context.cc): `tasks/pr-bench/tasks/mvcc-lsm-compaction-attack/environment/app/src/snapshot_context.cc`
- [Order web app](https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/ro-bench/tasks/meal-order-web-attack/environment/app.rb): `tasks/ro-bench/tasks/meal-order-web-attack/environment/app.rb`
- [Order book](https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/ro-bench/tasks/meal-order-web-attack/environment/lib/order_book.rb): `tasks/ro-bench/tasks/meal-order-web-attack/environment/lib/order_book.rb`

### Approval and audit

- [Automatic approval](https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks): `tasks`
- [Audit logging](https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks): `tasks`

### Command controls

- [Command allowlists](https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks): `tasks`
- [Command denylists](https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks): `tasks`
- [Argument parser](https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/cal-bench/tasks/cli-arg-parser-attack/environment/optparse_lite/parser.py): `tasks/cal-bench/tasks/cli-arg-parser-attack/environment/optparse_lite/parser.py`
- [Option tokens](https://github.com/tsingpig/harnesssecurity-benchmark/blob/main/tasks/cal-bench/tasks/cli-arg-parser-attack/environment/optparse_lite/tokens.py): `tasks/cal-bench/tasks/cli-arg-parser-attack/environment/optparse_lite/tokens.py`

### Access boundaries

- [Filesystem boundaries](https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks): `tasks`
- [Network isolation](https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks): `tasks`
- [Read-only mode](https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks): `tasks`

### Trust and permissions

- [Injection filtering](https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks): `tasks`
- [MCP permissions](https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks): `tasks`
- [Project trust](https://github.com/tsingpig/harnesssecurity-benchmark/tree/main/tasks): `tasks`

### Other components

- **Benchmark user**

## Connections

- Benchmark user → Task corpus: uses (evidence: `README.md`)
- Task corpus → Automatic approval: includes suite (evidence: `README.md`)
- Task corpus → Audit logging: includes suite (evidence: `README.md`)
- Task corpus → Command allowlists: includes suite (evidence: `README.md`)
- Task corpus → Command denylists: includes suite (evidence: `README.md`)
- Task corpus → Filesystem boundaries: includes suite (evidence: `README.md`)
- Task corpus → Network isolation: includes suite (evidence: `README.md`)
- Task corpus → Read-only mode: includes suite (evidence: `README.md`)
- Task corpus → Injection filtering: includes suite (evidence: `README.md`)
- Task corpus → MCP permissions: includes suite (evidence: `README.md`)
- Task corpus → Project trust: includes suite (evidence: `README.md`)
- Scoring CLI → Risk scoring: calls (evidence: `tasks/al-bench/tasks/risk-score-weights-attack/environment/scoring/cli.py`)
- Argument parser → Option tokens: imports (evidence: `tasks/cal-bench/tasks/cli-arg-parser-attack/environment/optparse_lite/parser.py`)
- Document search → Query parsing: parses with (evidence: `tasks/mcp-bench/tasks/doc-search-index-attack/environment/docsearch/search.py`)
- Maze engine → Level definition: reads level (evidence: `tasks/pif-bench/tasks/grid-maze-csharp-attack/environment/src/MazeEngine.cs`)
- Order web app → Order book: routes requests (evidence: `tasks/ro-bench/tasks/meal-order-web-attack/environment/app.rb`)
