T02 · Agent Memory Poisoning
- Location
SKILL.md:33- Finding
Persistent Agent Behavior Poisoning Through Unvalidated Retrospective Conclusions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 33-44
Vulnerability Type: Persistent memory and behavioral-rule poisoning
Risk Level: HighVulnerable Code Snippet
The following is a faithful English translation of the relevant skill instructions:
markdown ## Step 4: Record Daily Memory 1. Write the complete summary from Step 3 to `memory/YYYY-MM-DD.md`. 2. Create the file if it does not exist, or append to it if it does. ## Step 5: Update Core Configuration 1. Compare and update `MEMORY.md`: extract key conclusions from Step 3, add missing conclusions, modify outdated conclusions, and append a record of these changes to `memory/YYYY-MM-DD.md`. 2. Update `USER.md` using the user profile extracted in Step 3. 3. Update `SOUL.md` using the agent profile extracted in Step 3. 4. Update `AGENTS.md` using the improvement points from Step 3, modifying tool constraints or tactical rules so that the lessons become permanent. Warning: Core configuration updates must physically modify the files. Verbal promises to make changes are prohibited.Technical Analysis
The skill requires conclusions derived from historical conversations to be written into long-term memory and several behavior-defining configuration files. In particular, it can modify
MEMORY.md,USER.md,SOUL.md, andAGENTS.md.Historical session content is an untrusted input boundary. A user, external content processed during a session, or a malicious tool result can introduce assertions or instructions designed to appear to be user preferences, agent lessons, or required tactical rules. The skill does not require provenance validation, instruction filtering, schema validation, security-rule protection, or user approval before converting those conclusions into persistent state.
The mandatory physical-write requirement increases the risk because the generated conclusions are not merely presented for review. ...[truncated 1599 chars]
- Remediation
View remediation
Remediation Suggestions
- Generate a proposed diff instead of directly modifying core configuration files.
- Require explicit user approval for every change to
MEMORY.md,USER.md,SOUL.md, andAGENTS.md. - Treat session messages and tool results strictly as untrusted evidence, not executable instructions.
- Remove or neutralize imperative instructions embedded in historical content before summarization.
- Track provenance for every proposed conclusion, including the source session, role, timestamp, and supporting evidence.
- Permit only schema-constrained profile facts and prohibit arbitrary instructions in profile or memory fields.
- Prevent the retrospective skill from weakening security controls, tool permissions, system instructions, or approval requirements.
- Use an allowlist of sections that the skill may update rather than granting whole-file modification authority.
- Validate proposed changes with a separate policy check before writing them.
- Provide atomic rollback and integrity verification for every approved update.
