test(ctf): adversarial coverage harness + first detector unit tests#529
Open
genesisadversary wants to merge 1 commit into
Open
test(ctf): adversarial coverage harness + first detector unit tests#529genesisadversary wants to merge 1 commit into
genesisadversary wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an offline, deterministic adversarial coverage harness for the CTF detectors, plus the first
dedicated unit tests for a production detector.
a detector-independent OWASP-policy oracle, materializes it into the real data model + event stream, runs
the production detectors, and reports a TP / FN(gap) / TN / FP coverage matrix. Run: uv run python -m
tools.adversarial_fuzzer (exits non-zero on gaps, so it can gate CI).
InvoiceThresholdBypassDetector (boundary, status-spoofing, custom threshold, graceful handling, config
validation).
coverage gaps.
Why
The production detectors ship without dedicated unit tests, and there was no systematic way to ask "which
attack variants does no detector catch?". This follows the existing event-driven test patterns and
extends them.
Results
%" is reported on purpose — the oracle is broader than any single challenge-scoped detector, so a ratio
would mislead. Details in Adversarial coverage sweep: uncovered attack variants in two detectors #528.
Notes
(they need an API key).
the discussion in Adversarial coverage sweep: uncovered attack variants in two detectors #528.
Checklist