Implementation:0xSteph Pentest ai Score JuiceShop Script
| Knowledge Sources | |
|---|---|
| Domains | Benchmark, Scoring, CLI |
| Last Updated | 2026-10-23 00:00 GMT |
Overview
Concrete tool for scoring a Juice Shop engagement's findings against challenges.yml and writing scored manifests, provided by the pentest-ai benchmark scripts.
Description
The score_juiceshop script reads a findings JSON dump and a copy of Juice Shop's challenges.yml, matches findings to ground-truth challenges, computes catch rate and precision, and writes raw findings plus a scored manifest to an output directory. Exit code 0 if catch rate ≥ 20% floor, exit code 2 if below.
Usage
Run this script to score a completed Juice Shop engagement. Provide the findings JSON path, challenges.yml path, and output directory.
Code Reference
Source Location
- Repository: 0xSteph_Pentest_ai
- File: benchmarks/scripts/score_juiceshop.py
- Lines: 1-95
Signature
CATCH_RATE_FLOOR = 0.20
def main(findings_json: Path, challenges_yml: Path, out_dir: Path) -> int:
"""Score findings, write manifest. Return 0 if catch_rate >= floor, 2 otherwise."""
Import
from benchmarks.scripts.score_juiceshop import main, CATCH_RATE_FLOOR
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| findings_json | Path | Yes | Path to findings JSON dump |
| challenges_yml | Path | Yes | Path to Juice Shop challenges.yml |
| out_dir | Path | Yes | Output directory for scored manifest |
Outputs
| Name | Type | Description |
|---|---|---|
| findings.json | file | Copy of raw findings in out_dir |
| manifest.json | file | Scored manifest with catches, catch_rate, precision |
| exit code | int | 0 if ≥20% catch rate, 2 if below |
Usage Examples
Score a Juice Shop Engagement
from pathlib import Path
from benchmarks.scripts.score_juiceshop import main
exit_code = main(
findings_json=Path("benchmarks/results/2026-05-12/juice-shop/ptai-sweep/authed-findings.json"),
challenges_yml=Path("challenges.yml"),
out_dir=Path("benchmarks/results/2026-05-12-juiceshop-scored"),
)
print(f"Exit code: {exit_code}") # 0 = pass, 2 = below floor