test(ioscan): red-team the injection path and publish the miss rate - #6709
Merged
clubanderson merged 1 commit intoSep 11, 2026
Merged
Conversation
CNCF TAG-Security asked, on the ioscan section of the self-assessment (cncf/toc#2286): "have you red teamed to know how well this works? Is this perfect defense, works decently well, a partial mitigation, etc.?" The honest answer was no. pkg/ioscan has 56 unit tests, but they assert that KNOWN shapes are caught — by construction every one passes, and they cannot produce a detection rate. The self-assessment recorded efficacy as "unmeasured" and committed to measuring it. Measured now, against 43 adversarial payloads through the production entry point (ioscan.ScanInput, shipped defaults): blocked (withheld from the agent) 16 37% detected but injected anyway 8 19% missed entirely 19 44% ------------------------------------------------ reached the agent verbatim 27 63% Per family, detection is very uneven: unicode 6/8 blocked, smuggling 4/7, direct-override 2/10, split-payload 0/4. Plus 2 of 6 benign controls were redacted — including an issue *reporting* a prompt-injection bug. Three findings worth more than the headline number: - The middle bucket is not obvious. blockedInput requires Critical, or Injection at High+, so every Medium finding is recorded for audit and the raw text is still injected. "ioscan findings" is not "attacks stopped", and nothing said so before. - Split payloads score 0% structurally, not for want of a rule. Each untrusted segment is scanned separately, so a phrase split across two comments is never a single string to match. - Two single characters (U+FF29 fullwidth I, U+00AD soft hyphen) defeat the STRONGEST family outright. Filed as hivecommons#6708; the U08 fix is verified to be a one-character addition to isInvisibleControl. Item 3 of the issue — does the network layer still contain what gets through — is measured rather than claimed: TestRedTeamContainmentHoldsForEveryMode checks POST /pulls and PUT /pulls/{n}/merge against all four ACMM modes on every run. That is the real finding: the injection defense of record is the proxy deny rule, not the text scanner. The corpus is a RATCHET, not a snapshot. TestRedTeamCorpusOutcomesAreStable pins each observed outcome and fails in BOTH directions — a regression, and equally an improvement, because an improvement makes the published miss rate wrong. Both branches were verified by deliberately breaking and deliberately improving a rule; the improvement path prints "re-run the report and republish". So the document's numbers cannot silently drift from the code. Not measured, and said so in the document rather than estimated: the optional LLM classifier (default-off, and fails open, so the deterministic floor here is the worst case either way), the output path, and the canary egress path (hivecommons#6686). Fixes hivecommons#6685 Signed-off-by: Danathar <Danathar@users.noreply.github.com>
This was referenced Sep 11, 2026
Member
|
/approve |
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: clubanderson The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
clubanderson
added a commit
that referenced
this pull request
Sep 11, 2026
…6728) #6709 pinned the measured corpus outcomes; #6714 then closed the two Unicode gaps the report identified. Merged independently, each green, together they trip the stability ratchet: U05 and U08 now score blocked. Update the pinned expectations and republish the document — the unicode family is 8/8, overall misses 19->17 (44%%->40%%). Signed-off-by: Andrew Anderson <andy@clubanderson.com>
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.
The question, and the measured answer
TAG-Security asked on the
ioscansection (cncf/toc#2286): "have you red teamed to know how well this works? Is this perfect defense, works decently well, a partial mitigation, etc.?"The answer was no.
pkg/ioscanhas 56 unit tests, but they assert that known shapes are caught — by construction every one passes, and they cannot produce a detection rate.Measured now, 43 adversarial payloads through the production entry point (
ioscan.ScanInput, shipped defaults):Detection is very uneven by family — unicode 6/8 blocked, smuggling 4/7, direct-override 2/10, split-payload 0/4 — and 2 of 6 benign controls were redacted, including an issue reporting a prompt-injection bug.
Three findings worth more than the headline
1. The middle bucket is not obvious.
blockedInputrequires Critical, or Injection at High+, so every Medium finding is recorded for audit and the raw text is still injected.injection.role_override,pretend_act_as,reveal_prompt,developer_system_modeand three of sevendangerous.*rules all land there. "ioscan findings" is not "attacks stopped", and nothing said so before.2. Split payloads score 0% structurally, not for want of a rule. Each untrusted segment (title, body, each comment) is scanned separately, so a phrase split across two comments is never a single string for any rule to match. No rule change fixes that family.
3. Two single characters defeat the strongest family. U+FF29 fullwidth
Iand U+00AD soft hyphen produce zero findings — not "detected but not blocked". Unicode is the one family where the design beats a regex (hidden characters are themselves a High finding that blocks on their own), and one character bypasses it. Filed as #6708, with the U08 fix verified to be a one-character addition toisInvisibleControl.Item 3 is measured, not claimed
The issue asks whether the network layer still contains what gets through.
TestRedTeamContainmentHoldsForEveryModechecksPOST /pullsandPUT /pulls/{n}/mergeagainst all four ACMM modes on every run — 8 combinations, all denied.That is the real finding, and the document says it plainly: the injection defense of record is the proxy deny rule, not the text scanner. ioscan reduces how often an agent is exposed; the proxy is what stops an exposed agent from doing the thing that matters.
The corpus is a ratchet, not a snapshot
TestRedTeamCorpusOutcomesAreStablepins each observed outcome and fails in both directions — a regression, and equally an improvement, because an improvement makes the published miss rate wrong. I verified both branches rather than assuming them:So the document's numbers cannot silently drift from the code, and #6708's fix will correctly fail this test until the tables are republished.
A case recorded as
missedis a published miss. None of the 19 misses were removed or reworded until they passed — that was the point.What I did not measure, and said so
TestIoscanClassifierConfig_DefaultOff), and measuring it needs a live endpoint and would yield a number specific to one model at one moment. Deliberately absent rather than estimated. It also fails open, so the deterministic floor measured here is the worst case either way.Estimating any of these would have reproduced exactly the problem this issue exists to fix.
Files
src/pkg/ioscan/redteam_test.go— corpus + harness + containment check + report generator.src/docs/ioscan-red-team.md— methodology, per-family and per-case results, miss analysis, containment, limits.src/docs/security-self-assessment.md— the "unmeasured" paragraph and the review-response row now cite measured results.src/docs/README.md— index entry.Verified:
go test ./pkg/ioscan/ ./pkg/config/ ./pkg/proxy/green,go vetclean,gofmtclean,check-docs-links.py src/docs— 150 files, all links and anchors resolve.Fixes #6685
— hive: backend=claude model=claude-opus-5