Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:0xSteph Pentest ai Scoring JuiceShop

From Leeroopedia
Knowledge Sources
Domains Benchmark, Scoring, Juice_Shop
Last Updated 2026-10-23 00:00 GMT

Overview

Concrete tool for loading Juice Shop challenges and computing in-scope HTTP-automatable scoreboard metrics, provided by the pentest-ai benchmark scoring module.

Description

The scoring.juiceshop module reads Juice Shop's challenges.yml, applies an in-scope HTTP-automatable filter, and produces GroundTruthEntry records. It classifies challenges as http, will_not_chase, or out_of_scope based on category and tags. The scoreboard_metrics function computes headline metrics: in-scope HTTP count, verified proofs, candidates, refuted, and oracle precision. OSINT/Web3/UI-only/manual challenges are excluded from the chase.

Usage

Import this module when you need to score pentest-ai findings against Juice Shop's challenge set. Used by score_juiceshop.py.

Code Reference

Source Location

Signature

def classify_challenge(item: dict) -> str:  # "http" | "will_not_chase" | "out_of_scope"
def is_http_automatable(item: dict) -> bool: ...
def count_will_not_chase(challenges_yml: Path) -> int: ...
def scoreboard_metrics(findings_raw: list[dict], challenges_yml: Path) -> dict[str, float | int]: ...
def load_challenges(challenges_yml: Path) -> list[GroundTruthEntry]: ...

Import

from benchmarks.scoring.juiceshop import load_challenges, scoreboard_metrics, classify_challenge

I/O Contract

Inputs

Name Type Required Description
challenges_yml Path Yes Path to Juice Shop challenges.yml file
findings_raw list[dict] Yes (scoreboard_metrics) Raw findings dicts with verdict, title, etc.

Outputs

Name Type Description
list[GroundTruthEntry] list In-scope HTTP-automatable challenge entries
metrics dict in_scope_http, verified_proofs, candidates, refuted, precision

Usage Examples

Load and Score Challenges

from pathlib import Path
from benchmarks.scoring.juiceshop import load_challenges, scoreboard_metrics

challenges_yml = Path("challenges.yml")
in_scope = load_challenges(challenges_yml)
print(f"In-scope HTTP challenges: {len(in_scope)}")

# Compute scoreboard metrics from raw findings
import json
findings_raw = json.loads(Path("findings.json").read_text())
metrics = scoreboard_metrics(findings_raw, challenges_yml)
print(f"Verified proofs: {metrics['verified_proofs']}")
print(f"Precision: {metrics['precision']:.2%}")

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment