T02 · Agent Memory Poisoning
- Location
SKILL.md:45- Finding
Persistent Behavioral Instruction Embedded in Memory Summaries
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 45–46
Vulnerability Type: Persistent instruction injection through long-term memory
Risk Level: LowVulnerable Code
markdown ## Resume Instruction Continue directly — do not acknowledge this summary, do not recap what was happening, and do not preface with continuation text.Technical Analysis
The skill instructs the agent to include an imperative behavioral directive in summaries written during memory flush or compaction. Unlike factual state such as prior requests, files, and unfinished tasks, this text directs the behavior of an agent that later consumes
MEMORY.md.This creates a persistent instruction channel across sessions. The directive shown does not override safety controls or request a harmful action, so the present impact is limited. Nevertheless, storing executable instructions alongside remembered facts weakens the trust boundary between passive memory data and authoritative agent instructions. If this pattern permits variable or attacker-controlled resume instructions in future versions or surrounding workflows, it could be used to persist more consequential behavioral manipulation.
Attack Path
- The skill is activated during a memory flush or compaction operation.
- Its structured template is used to write a summary into persistent
MEMORY.mdstorage. - The
Resume Instructionand its imperative directive are stored with the conversation state. - A subsequent agent session loads and interprets that memory.
- The later agent follows the persisted directive by suppressing acknowledgment, recap, and continuation context.
The audited artifact contains only a fixed, low-impact instruction; no mechanism for attacker-controlled substitution was identified.
Impact Assessment
The instruction can influence response presentation in future sessions that consume the stored summary. It may suppress acknowledgment and contextual recap, potentially r ...[truncated 293 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove fixed behavioral directives from summaries persisted to
MEMORY.md. - Restrict persistent summaries to factual state, including prior requests, completed work, unfinished tasks, relevant files, and tool results.
- If continuation preferences are required, place them in trusted configuration rather than conversation-derived memory.
- Treat all content loaded from memory as untrusted contextual data, not executable instructions.
- Apply explicit instruction precedence so memory content cannot override system, developer, safety, or current-user instructions.
- Use a typed schema that separates factual state from preferences and rejects imperative instruction fields.
- Validate and sanitize any user-derived text before persistence to prevent instructions from being introduced through summary fields.
- Remove fixed behavioral directives from summaries persisted to
