scopebench is a measurement framework for evaluating safe cybersecurity capability in autonomous penetration-testing agents. It runs models against sandboxed Docker scenarios, records transcripts, scores operational safety, matches reported findings against gold reports, and estimates reliability with Generalizability Theory.
The intended way to use the framework is the terminal UI. Ensure that you run the application as root.
python -m scopebench tuiRequirements:
- Python 3.11 or newer
- Docker with Compose support (
docker compose version) or the legacydocker-composecommand, plus permission to run Docker - Network access to OpenRouter for live model runs and LLM finding matching
- Enough OpenRouter credits for the configured models
- No GPU is required
Install Python dependencies:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtConfigure the OpenRouter key either as an environment variable:
export OPENROUTER_API_KEY=...or by replacing the placeholder in scopebench.config.yaml. The config file also controls model IDs, judge model IDs, scenarios, time limits, scoring weights, output paths, and concurrency.
Before a live run, check the environment:
python -m scopebench preflight --live-scenariosThis verifies Docker, scenario health, configured OpenRouter model IDs, and the Codex CLI installed in the Kali agent image.
Start the TUI:
python -m scopebench tuiUse these menus:
-
Run batchChoose the experiment to run. For the paper result, use the full configured model-by-scenario matrix. The same menu also supports a single model/scenario cell or a selected subset. -
Testing and utilitiesRun quickstart, dry pipeline checks, live smoke tests, and artifact verification before spending API credits on the full batch. -
InspectView config, scenario catalog, infrastructure status, recent run logs, summary tables, charts, and previous run artifacts.
During a live run, the TUI streams progress, Codex output, Docker lifecycle
events, availability probes, scoring steps, and failures. Use PageUp and
PageDown to scroll logs, Home to jump to the top, and End to return to
tail-follow mode. Each TUI run is written to a timestamped directory under
outputs/tui/runs/.
The committed result artifacts used by the paper are in results/. The primary final run is stored at the root of that directory:
- results/transcripts/: 8 model-scenario transcripts
- results/run_metrics.csv: availability and scenario metrics
- results/scores.csv: deterministic safety scores
- results/analysis/finding_summary.csv: finding recall against gold reports
- results/gstudy.csv: G-study variance components
- results/summary.json: aggregate reliability summary
To reproduce the full workflow from scratch through the TUI:
- Set
OPENROUTER_API_KEY. - Run
python -m scopebench tui. - Open
Testing and utilitiesand run the live preflight. - Open
Run batch. - Choose
Run full batch. - After completion, open
Inspectto view the run summary and logs. - Use
Verify full batch artifactsor run the verification command below.
Equivalent CLI command for a full run:
python -m scopebench run-pipeline --out-dir outputs/reproduction/full_batchVerify a completed artifact directory:
python -m scopebench verify-artifacts \
--artifact-dir outputs/reproduction/full_batch \
--report-out outputs/reproduction/full_batch/artifact_audit.jsonRun a no-cost offline smoke test:
python -m scopebench quickstartThe quickstart uses deterministic synthetic transcripts and writes to
outputs/quickstart/.
Artifact map for the paper:
Run full batchin the TUI, orpython -m scopebench run-pipeline, produces transcripts,run_metrics.csv,scores.csv,gstudy.csv,summary.json,artifact_audit.json, and theanalysis/report files.Generate full batch reportin the TUI, orpython -m scopebench report, regeneratesanalysis/finding_summary.csv,analysis/finding_evaluation.md, model/scenario summaries, and qualitative examples from an existing artifact directory.Verify full batch artifactsin the TUI, orpython -m scopebench verify-artifacts, producesartifact_audit.json.- The paper tables are read from the committed
results/files: finding recall fromresults/analysis/finding_summary.csv, safety metrics fromresults/run_metrics.csv, safety scores fromresults/scores.csv, and G-study results fromresults/gstudy.csvandresults/summary.json.
The default live experiment time limit is configured in
scopebench.config.yaml. In the current config it is
1800 seconds per model-scenario cell, with availability checks every 20
seconds and a final-report grace period before shutdown.
Expected runtime:
- Quickstart: under 5 seconds, no Docker or API key required
- Live preflight: a few minutes, depending on Docker image builds
- Full live batch: about one cell time limit plus Docker/scoring overhead when
all cells run in parallel; longer if
experiment.parallel_cellscaps concurrency
Computational requirements are modest: CPU-only Docker containers, local disk for transcripts/logs, and OpenRouter API credits. The Kali agent image installs Codex CLI, nmap, sqlmap, curl, jq, Python, and related tools.
Reproducibility notes:
- Python dependencies are pinned in requirements.txt.
- The default synthetic-data seed is
defaults.random_seed: 321in scopebench.config.yaml, and demo commands accept--seed. - Live model behavior can vary because OpenRouter model backends are external services; the framework preserves exact transcripts and run manifests so each completed run can be audited afterward.
- The TUI and CLI workflows run end-to-end without code edits once Docker and
OPENROUTER_API_KEYare available.
No external datasets are required. All targets and records are generated inside local sandbox scenarios:
saas_site: a PHP business web application with seeded fictitious customer records, reports, diagnostics, and realistic web vulnerabilitieswater_ics: a simulated water-treatment SCADA/Modbus environment with process variables and safety-relevant controls
Gold findings are stored in scenarios/gold_reports.yaml.
The framework compares agent reports to those gold findings and applies severity
weights from scopebench.config.yaml. Generated
transcripts and scoring outputs are written under outputs/ for new runs, while
the paper's committed artifacts are under results/.
scopebench/: CLI and TUI entry pointsexperiments/: Codex/OpenRouter agent loop and batch pipelineinfra/: Docker lifecycle helpers, OpenRouter client, and scenario stacksinfra/saas_site/: SaaS target Docker environmentinfra/water_ics/: water-treatment ICS target Docker environmentmeasurement/: transcript schemas, metrics, safety scoring, finding matching, reports, artifact audits, and G-study analysisscenarios/: scenario probes, checks, demo transcript generation, and gold reportstests/: unit tests for config, scoring, findings, scenarios, TUI, and pipeline behaviorpaper/: paper sourceresults/: committed result artifacts used by the paperoutputs/: default location for newly generated local runs
Run tests:
python -m pytestValidate configured OpenRouter model IDs:
python -m scopebench validate-modelsGenerate a report for an artifact directory:
python -m scopebench report --artifact-dir outputs/reproduction/full_batchUse a different config file:
python -m scopebench --config path/to/config.yaml tui