Repository navigation
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.
This is L2 from the 2026-10-24 security review.
Peer records and journal rows read back from the mod store were only shape-checked. A corrupt or edited store file could:
running: -1000;limit.kind, whichwindowNameprints as it is;/agent-guard report, which Claude reads with its next request, through a row'stool,ruleorkind;kind.Writing to the store already needs the user's own file access, so this is defence in depth.
Changes
isPeerRecord:runningmust be a whole number, 0 or more;startsanddormantResumesmust be finite numbers;agentTokensmust be finite pairs with tokens 0 or more. A record that fails doesn't count.isLimitReading(new):kindmust match^[a-z_]{1,32}$,percentmust be from 0 to 1,000 (spend limits can pass 100), and the times must be finite. A peer whose reading fails keeps its counts and loses only the reading. The API declareskindas an openstring, so a new window name can't make the guard drop a session's counts.isJournalRow:evandanswermust come from the guard's own sets,ctxmust be one of its buckets,rule,tool,kindand the session prefix must match plain patterns, and the numbers must be finite.PR #42's fail-closed test made the gate throw with a peer record whose
kindwas a number, which this PR now filters out. It now throws through a plan reading fromsession.measure, so it still exercises the catch path.Test plan
claude plugin test .on 2.1.310: 105 pass. Withcore/state.tsandcore/journal.tsstashed, both new tests fail.tscis clean