Conversation
Only Claude installs a SessionStart hook, so on every other agent no `memory` event was ever produced, `memory-embedded-directive` never ran, and memory poisoning (ASI06) was UNDETECTED rather than merely unenforced. In a 300-trial lane ASI06 stayed at 100% harm in every arm — including with enforcement on — because no rule ever looked at the poisoned file. That is a different defect from a rule that fires without enforcing, and a harm-rate comparison reports the two identically. - extract `build_memory_event()` from the Claude SessionStart branch so any adapter can emit the same event - on the first UserPromptSubmit of a session, agents with no session-start surface now scan project memory and dispatch it through the same rule path; a real SessionStart scan satisfies the same once-per-session marker, so agents that have the hook never scan twice - surface what the scan finds: evaluating and discarding the decision would reproduce the original bug in a new place (rule fires, audit records it, nobody is told) - un-gate the counter-instruction, which was hard-coded to one agent. Where a host supports context injection it is injected; otherwise it goes to stderr Verified live: a Codex-shaped dispatch against a poisoned AGENTS.md now emits the notice on the first prompt and stays silent on the second. Closes #258 Claude-Session: https://claude.ai/code/session_01YU9bdvnpgAc6XyWTAoL12M
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.
Closes #258.
The problem
Only Claude installs a
SessionStarthook. On every other agent the audit trail shows exactly two event types:against five on the Claude path. No
memoryevent ever existed, somemory-embedded-directivenever ran and memory poisoning (ASI06) was undetected — not merely unenforced.In a 300-trial lane, ASI06 stayed at 100% harm in every arm including enforce, because no rule ever looked at the poisoned file. On the Claude path the same rule fires and (on a capable model) drives the identical attack to 0%.
This is a different defect from "a rule fires and does not enforce", and a harm-rate comparison reports the two identically — which is exactly how it stayed hidden.
What changes
build_memory_event()is extracted from the ClaudeSessionStartbranch, so any adapter can emit the same event with the same metadata (files, digests, truncation, invisible-control flags, TOFU integrity findings)UserPromptSubmitof a session, agents with no session-start surface scan project memory and dispatch it through the same rule pathSessionStartscan satisfies the same once-per-session marker, so agents that do have the hook never scan twiceOne change covers every non-Claude adapter.
Verified live
Codex-shaped dispatch against a poisoned
AGENTS.md:Tests
tests/test_memory_event_without_sessionstart.py, 8 tests: builder returns a proper memory event and is agent-agnostic, empty workspace yields no content, marker round-trip / per-session isolation / awkward session ids, and end-to-end thatmemory_poisoningnow fires for a non-Claude agent while clean memory does not.Full suite: 24 failed / 1737 passed against a clean-
mainbaseline of 24 failed / 1729 passed — same failures, no regressions. All 66 memory-related tests pass.https://claude.ai/code/session_01YU9bdvnpgAc6XyWTAoL12M