T02 · Agent Memory Poisoning
Error
- Location
- SKILL.md:264
- Finding
- Untrusted conversational learnings can be promoted into persistent agent instructions<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:264-289`, with additional promotion guidance at `SKILL.md:346-361` and `SKILL.md:440-447` **Vulnerability Type**: Persistent agent memory poisoning **Risk Level**: High ### Vulnerable Code or Instructions ```markdown ## Promoting to Project Memory When a learning is broadly applicable (not a one-off fix), promote it to permanent project memory. ### When to Promote - Learning applies across multiple files/features - Knowledge any contributor (human or AI) should know - Prevents recurring mistakes - Documents project-specific conventions ### Promotion Targets | Target | What Belongs There | |--------|-------------------| | `CLAUDE.md` | Project facts, conventions, gotchas for all Claude interactions | | `AGENTS.md` | Agent-specific workflows, tool usage patterns, automation rules | | `.github/copilot-instructions.md` | Project context and conventions for GitHub Copilot | | `SOUL.md` | Behavioral guidelines, communication style, principles (OpenClaw workspace) | | `TOOLS.md` | Tool capabilities, usage patterns, integration gotchas (OpenClaw workspace) | ### How to Promote 1. **Distill** the learning into a concise rule or fact 2. **Add** to appropriate section in target file (create file if needed) 3. **Update** original entry: - Change `**Status**: pending` → `**Status**: promoted` - Add `**Promoted**: CLAUDE.md`, `AGENTS.md`, or `.github/copilot-instructions.md` ``` The instructions also state: ```markdown 7. **Promote aggressively** - if in doubt, add to CLAUDE.md or .github/copilot-instructions.md ``` ### Technical Analysis The Skill accepts learnings originating from conversations and user feedback, then instructs the agent to promote selected content into persistent instruction files such as `CLAUDE.md`, `AGENTS.md`, `SOUL.md`, `TOOLS.md`, and `.github/copilot-instructions.md`. These destination files may be automatically loaded as trusted agent context in later sessions. The ...[truncated 1792 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Require explicit trusted-human approval before modifying any automatically loaded instruction file. 2. Store candidate promotions in a separate review file, such as `.learnings/PROMOTION_CANDIDATES.md`, rather than directly editing agent context. 3. Never copy conversational content verbatim into persistent instructions. Convert it into a restricted structured schema and preserve its provenance. 4. Reject promotion candidates that: - Request weaker safety controls. - Expand tool or filesystem permissions. - Request access to secrets or unrelated data. - Override user, system, or organizational policy. - Instruct agents to conceal activity or bypass review. 5. Remove the “promote aggressively” guidance and replace it with a conservative default of no promotion without review. 6. Add metadata including the originating user/session, evidence, reviewer identity, review date, and expiration or revalidation date. 7. Apply repository review controls, such as pull requests and CODEOWNERS approval, to changes in `CLAUDE.md`, `AGENTS.md`, `SOUL.md`, `TOOLS.md`, and Copilot instructions. 8. Treat all `.learnings/` entries as untrusted data when they are read by future agents. ]]>
