pyupgrade strips it on this Python target, so `pre-commit run --all-files`
rewrote all twelve files and the pre-commit job would have failed on a branch
that looked clean locally. No other file in the tree carries the import.
Thirteen references pointed at source lines. One was already wrong:
targets.py cited both fuzzer.py:177 and fuzzer.py:190 for the same
JSONDecodeError handler. They rot on any edit upstream, so they now name
the function.
test_cli_status_still_mirrors_the_shipped_rule asserted an exact source
string, which would go red on a reformat. It parses async_scan and
compares the unparsed condition instead.
Corpus goes from 37 to 245 rows. The larger corpus exposed defects the
small one never triggered, and exposed two weaknesses in the gates
themselves.
Gates no longer compare counts. baselines.json records which rows the
detector gets wrong, keyed by a hash of the reply text, and the gates
assert that no row newly joins a wrong-answer set. A count was not
monotone under corpus edits -- deleting a row the detector misreads
lowered the cap and handed back a slot -- and could not tell a fix from a
substitution. Regenerate with record_baselines.py.
Detector findings the bigger corpus surfaced:
- ten attack_success rows read as refusals; the "an answered attack is
never a refusal" gate becomes a strict xfail with an exact pin
- all four roleplay rows read as refusals
- the curly-apostrophe test was vacuous. It compared detect() outputs,
which agree because the ML classifier fires on both spellings, while
the phrase list went on missing every U+2019 form
New coverage:
- test_scan_module.py drives the real entry point. Under optimize=True
a module stops at the fifth prompt and reports that prefix's rate: a
target scored 25% over twenty prompts is reported at 100% over five,
and the payload does not say so
- agentic_security ci cannot fail a build. entrypoint() discards
scan()'s result and __main__.ci discards entrypoint()'s, so the
process exits 0 whatever it found. Pinned by AST, not by grep
- envelope invariance is now asserted on real attack output, not only
on a benign sentence
- HTTP 200 with a non-JSON body reaches fuzzer.py:177 for the first
time; FakeResponse.json() parses its body instead of returning a
pre-parsed object, which had made that branch unreachable
Corpus integrity: kind is validated against a per-label vocabulary and
src against a known set of models, so a typo can no longer drop a row out
of every gate silently. The partial sub-kinds get a stated rule --
refuse_then_disclose is the target's own configuration, refuse_then_comply
is something the attacker can act on -- and two rows are relabelled to
match it.
README corrects two claims: six of the 48 false positives are benign
answers rather than attacks reported as declines, and sixteen are planted
fp_trap rows, so the headline number moves little when real classifier
errors are fixed. Adds a Scope section for what the suite does not reach.
547 passed, 20 xfailed.