T02 · Agent Memory Poisoning
Error
- Location
- SKILL.md:23
- Finding
- Conversation-Derived Content Can Poison Persistent Agent Instructions<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:23-26`, `SKILL.md:262-289`, `SKILL.md:334-360`, `SKILL.md:443-448` **Vulnerability Type**: Persistent agent memory poisoning **Risk Level**: High ### Vulnerable Code ```markdown | Broadly applicable learning | Promote to `CLAUDE.md`, `AGENTS.md`, and/or `.github/copilot-instructions.md` | | Workflow improvements | Promote to `AGENTS.md` (OpenClaw workspace) | | Tool gotchas | Promote to `TOOLS.md` (OpenClaw workspace) | | Behavioral patterns | Promote to `SOUL.md` (OpenClaw workspace) | ``` ```markdown Promote recurring patterns into agent context/system prompt files when all are true: - `Recurrence-Count >= 3` - Seen across at least 2 distinct tasks - Occurred within a 30-day window Promotion targets: - `CLAUDE.md` - `AGENTS.md` - `.github/copilot-instructions.md` - `SOUL.md` / `TOOLS.md` for OpenClaw workspace-level guidance when applicable ``` ```markdown 7. **Promote aggressively** - if in doubt, add to CLAUDE.md or .github/copilot-instructions.md ``` ### Technical Analysis The Skill directs the agent to convert information derived from conversations, user corrections, errors, and tool output into persistent instruction files. Files such as `AGENTS.md`, `SOUL.md`, `TOOLS.md`, `CLAUDE.md`, and `.github/copilot-instructions.md` may be loaded automatically in later sessions and can influence agent behavior. The recurrence rules only measure how often a pattern appears. They do not validate whether its source is trustworthy or whether the content contains embedded instructions. There is no mandatory human approval, provenance enforcement, instruction-content filtering, or restriction preventing security-sensitive behavioral rules from being promoted. An attacker who can repeatedly influence conversations can therefore frame malicious instructions as corrections, best practices, or recurring project conventions. ### Attack Path 1. An attacker submits a plausible but malicious “correction” ...[truncated 1101 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Prohibit automatic promotion of raw or lightly transformed conversation content into agent instruction files. 2. Require explicit human review and approval for every promotion. 3. Record immutable provenance for each candidate, including session, author, timestamp, and source message. 4. Reject content containing instructions to weaken security controls, expose data, alter authorization, execute commands, or override higher-priority instructions. 5. Restrict automatic promotion to narrowly scoped, verifiable project facts rather than behavioral or system-level rules. 6. Treat `SOUL.md`, `AGENTS.md`, `TOOLS.md`, `CLAUDE.md`, and Copilot instructions as protected configuration. 7. Generate a reviewable patch instead of directly modifying protected files. 8. Add rollback support and an audit log for all accepted promotions. ]]>
