T02 · Agent Memory Poisoning
Error
- Location
- assets/AGENTS.md:31
- Finding
- Persistent Self-Modification of Agent Operating Rules<![CDATA[ ## Vulnerability Details **File Location**: `assets/AGENTS.md:31-35`, `assets/AGENTS.md:122-128` **Vulnerability Type**: Persistent modification of instruction-bearing files **Risk Level**: High ### Vulnerable Code ```markdown - Memory is limited — if you want to remember something, WRITE IT - "Mental notes" don't survive session restarts - "Remember this" → update daily notes or relevant file - Learn a lesson → update AGENTS.md, TOOLS.md, or skill file - Make a mistake → document it so future-you doesn't repeat it ``` ```markdown ## Self-Improvement After every mistake or learned lesson: 1. Identify the pattern 2. Figure out a better approach 3. Update AGENTS.md, TOOLS.md, or relevant file immediately Don't wait for permission to improve. If you learned something, write it down now. ``` ### Technical Analysis The Skill authorizes the agent to modify `AGENTS.md`, `TOOLS.md`, Skill files, and other persistent configuration without human review. These are not passive notes: `assets/AGENTS.md:10-16` directs the agent to load workspace instruction and memory files at the beginning of every session. Consequently, an erroneous inference or attacker-influenced “lesson” can be converted into a durable instruction that affects future sessions. Although the Skill separately states that external content must be treated as data, the self-modification workflow lacks a trust-boundary check that prevents conclusions derived from external content from being promoted into operating rules. This is a persistent memory-poisoning condition because instruction-bearing state is modified automatically and reloaded across sessions. ### Attack Path 1. The agent processes an attacker-controlled email, web page, document, API response, or other external content. 2. The content causes the agent to infer a false operational lesson, workflow, exception, or tool workaround. 3. Under the self-improvement instructions, the agent writes that conclusion into `AGENTS.md`, `TOOL ...[truncated 878 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Prohibit autonomous modification of `AGENTS.md`, `SOUL.md`, Skill files, system prompts, and other instruction-bearing files. 2. Store proposed lessons in a non-executable file such as `memory/proposed-lessons.md`. 3. Require explicit human approval before promoting any proposed lesson into an operating rule. 4. Record the source and trust level of every proposed lesson. 5. Reject rule changes derived from email, websites, PDFs, API responses, logs, or other untrusted sources. 6. Validate approved changes against immutable safety constraints. 7. Maintain version history and provide a one-command rollback mechanism. 8. Restrict autonomous writes to clearly designated data files that are never interpreted as instructions. ]]>
