T02 · Agent Memory Poisoning
Error
- Location
- SKILL.md:245
- Finding
- Persistent instruction poisoning through promotion of conversation-derived learnings## Vulnerability Details **File Location**: `SKILL.md:245-270`; related guidance at `SKILL.md:8`, `SKILL.md:21-24`, `SKILL.md:44-51`, and `SKILL.md:392` **Vulnerability Type**: Persistent agent memory and instruction poisoning **Risk Level**: High ### Vulnerable Code Snippet ```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 associated best-practice guidance further states: ```markdown 7. **Promote aggressively** - if in doubt, add to CLAUDE.md or .github/copilot-instructions.md ``` ### Technical Analysis The skill captures information originating from conversations, including user corrections, errors, and suggested behavioral patterns. It then instructs the agent to promote selected entries into persistent files such as `CLAUDE.md`, `AGENTS.md`, `SOUL.md`, `TOOLS. ...[truncated 2260 chars]
- Remediation
- ## Remediation Suggestions 1. Require explicit approval from a trusted human maintainer before promoting any learning into an automatically loaded instruction file. 2. Treat user messages, external API output, tool output, and other session-derived text as untrusted data. 3. Store provenance for every entry, including source session, author, timestamp, related task, and approving reviewer. 4. Replace free-form promotion with a restrictive structured schema that permits project facts but rejects executable commands and behavioral overrides. 5. Prohibit promotion of content that requests secret access, network transmission, tool invocation, permission changes, safety-policy changes, or suppression of future warnings. 6. Remove the “promote aggressively” instruction and require demonstrated recurrence, verification, and security review. 7. Separate passive knowledge records from authoritative agent instructions. Learning logs should not automatically become prompt-injected policy. 8. Display and review the exact proposed diff before modifying `CLAUDE.md`, `AGENTS.md`, `SOUL.md`, `TOOLS.md`, or Copilot instructions. 9. Add integrity monitoring, version control, audit logs, and a documented rollback process for persistent instruction files. 10. Limit cross-session scope so project-specific or user-specific observations cannot silently affect unrelated sessions.
