Skip to content

bench: seeded-vulnerability security bench and scorer - #1968

Closed
remigiusz-antczak wants to merge 2 commits into
mainfrom
feat/security-seeded-bench
Closed

remigiusz-antczak wants to merge 2 commits into
mainfrom
feat/security-seeded-bench

Conversation

@remigiusz-antczak

Copy link
Copy Markdown
Collaborator

Adds a seeded-vulnerability bench so the security review path can be scored on precision and recall against a rival security-review tool, instead of on judge preference.

  • scripts/eval-fixtures/security-seeded/: 12 small synthetic diffs, one seeded vulnerability each, plus 4 look-alike decoys that are safe. The seeded classes are SQL injection, XSS, SSRF, path traversal, missing authorization, a hardcoded secret, unsafe deserialization, command injection, open redirect, IDOR, TOCTOU and weak crypto. keys.json maps each diff to its CWE and line, with a short list of equivalent parent and child CWEs. All code and data are fictional, and the fake secret uses an obviously fake shape.
  • scripts/security_bench_score.py scores each arm's findings (<diff-id>.json, a list of {file, line, cwe}):
    • It reports per arm: precision, recall, decoy false positives, duplicate findings and CWE-missing findings.
    • It normalizes CWE forms and file paths.
    • Line tolerance is 1.
    • Duplicate findings on one vulnerability collapse before precision is computed.
    • A finding with no CWE is scored on file and line, and flagged.
    • It fails closed (exit 2) on a missing arm directory, malformed JSON, a bad keys schema or a duplicate arm name.
  • scripts/test_security_bench_score.py (16 tests) is wired into scripts/test-ci-gates.sh. It checks that each keyed line holds the vulnerable statement and covers the tolerance boundary, normalization, equivalence and the fail-closed paths.

No paid run yet. The next step is one capped run of each arm on the 16 diffs, then a scored comparison.

Tests: 16/16 (test_security_bench_score.py), run on the commit's own tree. Independent review: 0🔴; the 9🟡 and 2🔵 are fixed here.

🤖 Generated with Claude Code

https://claude.ai/code/session_014QNFFPWVcPUbeuvwM5fk2Z

Remigiusz Antczak and others added 2 commits October 23, 2026 22:55
12 synthetic diffs each seeding one known vulnerability plus 4 safe look-alike decoys, keys.json with expected CWE, file:line, marker token and CWE equivalents, and security_bench_score.py scoring any arms on precision, recall (bootstrap CI via rival_eval.boot) and decoy false positives. Normalizes CWE ids and paths, collapses duplicate findings, scores file+line when a tool gives no CWE, and fails closed (exit 2) on a missing arm dir or findings file, malformed findings, invalid keys or duplicate arm names. Offline; no model calls.

Tests: 16/16

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014QNFFPWVcPUbeuvwM5fk2Z
@remigiusz-antczak

Copy link
Copy Markdown
Collaborator Author

Superseded by #1973 (merged).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant