Repository navigation
fix: bound what the hook classifies, and ask in block mode on what it skipped - #349
Merged
Merged
Conversation
… skipped 0.10.3 raised the classification bound from 4 KiB to 64 KiB. Several frozen patterns are quadratic on contrived input, and the classifier runs before the tool does: one long token with no slash held the hook for minutes, and `printenv ` repeated to 64 KiB took 34 s. The hook posts only after classifying, so an agent that timed it out ran the call with nothing recorded and nothing blocked. Arguments with no command or path key reached the same patterns with no bound at all, in every earlier release. The hook now classifies 8 KiB, and past that the first and last 4 KiB. Runs of path-like characters over 128 keep their two ends, whitespace runs keep their line breaks, and structured arguments share one 8 KiB budget. The worst shape found takes about 0.55 s at 8 KiB; 60 shapes at 1 MiB finish under 0.5 s. The frozen files are untouched (fingerprint 15846a0915769d4a). Anything shortened in a way that drops content now carries tool.classification "partial", and with tool_policy_mode block a partial call asks on a pre-execution hook, or is denied where the agent ignores an ask (#348). A deny rule or a DLP block still wins; log mode only records. Two DLP rules on unbounded input were not linear either: image_proxy_exfil_host took 10 s on 64 KiB of `http://`, and markdown_image_exfil backtracked cubically. Both rewritten; no DLP rule takes more than 0.2 s on 1 MiB of any shape that was slow. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…S release Opener 5 said 5 of 178 ATLAS techniques. ATLAS 2026.10 lists 221, and the five ids emitted are unchanged in it, so the line now says 5 of 221, about 2%, and names the release. Opener 2 still credited a post with "fifteen clean releases" and a 1.0.16 one-line change, which the private queue corrected on 2026-10-23, and said the tools/list fingerprint is taken per session when it is taken as the listing passes through the MCP proxy. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Closes #348. Also fixes a hook stall that 0.10.3's 64 KiB classification bound made reachable, found while testing it.
The hook stalled on contrived input
Several patterns in the frozen files are quadratic, and the classifier runs before the tool does:
ENV_FILEandPRIVATE_KEY_PATHopen with an unanchored[\w.~$-]*[/\\]: one long token with no slash took 0.3 s at 4 KiB and 4.7 s at 16 KiB, per pass.PIPE_TO_SHELL's\bcurl\b[^|;&]*[|]scan from every keyword to the end when no separator follows:printenvrepeated to 64 KiB took 34 s.ENV_FILE's^\s*\.envis quadratic on a long run of blank lines.The hook posts its event only after classifying, so an agent that times the hook out runs the call with nothing recorded and nothing blocked.
The frozen files are untouched (fingerprint
15846a0915769d4a). Inhooks/ingest.py:CLASSIFY_MAX_LENgoes from 64 KiB to 8 KiB; past it the head and tail 4 KiB are read, so the PUB-01 case (payload at the end of a long script) is still caught. The worst shape found takes about 0.55 s at 8 KiB, under 0.10.2's worst case.[\w.~$-]run over 128 characters keeps its two ends.Worst case for traits plus ATT&CK,
printenvrepeated:Re-swept 60 shapes at 1 MiB through
_hash_tool_args: the slowest is 0.47 s.Block mode asks on what it could not read (#348)
tool.classification: "partial", in any mode, so an empty trait list is not read as a clean command.ask(reasontool_policy:classification_partial), ordenywhere the agent is not known to honour an ask, using the same capability matrix as ask rules.DLP
DLP scans the whole argument JSON with no bound. Two shipped rules were not linear:
image_proxy_exfil_host(10 s on 64 KiB ofhttp://) andmarkdown_image_exfil(3.3 s on 64 KiB of. Both are rewritten so that no two runs can trade characters. On 1 MiB of every slow shape, no DLP rule takes more than 0.2 s. The existing positive and benign DLP tests pass unchanged. The markdown rule no longer reads an IPv6 literal host.Not fixed here
The quadratic patterns themselves. They are in the frozen files, so anchoring them belongs to the next ruleset change (with #55, #345, #346), after which the bound can grow again.
Openers doc
docs/commercial/outreach-openers.md: opener 5 said 5 of 178 ATLAS techniques; ATLAS 2026.10 lists 221 and the five emitted ids are unchanged, so it now says 5 of 221, about 2%. Opener 2 is brought in line with the code (thetools/listfingerprint is taken at the MCP proxy, not per session) and with what the postmark-mcp post actually says.Checks
15846a0915769d4aruff check agentmetry tests: cleanagentmetry benchmark: 26 of 26 detected, 0 missed, 0 false positivestests/test_fail_closed_partial.py(29 tests); full suite locally 2062 passed, 6 skipped, 3 failed, the three being the dogfood machine's documented cases: the OTel and trail tests pass with.envmoved aside, and the README count (updated to 2069) is 2 high locally from gitignored launch entries🤖 Generated with Claude Code