T02 · Agent Memory Poisoning
- Location
- SKILL.md:27
- Finding
- Persistent Poisoning of Agent Instruction and Memory Files<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 27–31, 51–61, 78–86, and 399 **Vulnerability Type**: `T02: 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 OpenClaw injects these files into every session: ~/.openclaw/workspace/ ├── AGENTS.md # Multi-agent workflows, delegation patterns ├── SOUL.md # Behavioral guidelines, personality, principles ├── TOOLS.md # Tool capabilities, integration gotchas ├── MEMORY.md # Long-term memory (main session only) ├── memory/ # Daily memory files │ └── YYYY-MM-DD.md └── .learnings/ # This skill's log files ``` ```markdown | Learning Type | Promote To | Example | |---------------|------------|---------| | Behavioral patterns | `SOUL.md` | "Be concise, avoid disclaimers" | | Workflow improvements | `AGENTS.md` | "Spawn sub-agents for long tasks" | | Tool gotchas | `TOOLS.md` | "Git push needs auth configured first" | ``` ```markdown 7. **Promote aggressively** - if in doubt, add to CLAUDE.md or .github/copilot-instructions.md ``` ### Technical Analysis The skill instructs an agent to convert conversation-derived corrections, behavioral patterns, workflow guidance, and tool observations into persistent instruction files. OpenClaw subsequently injects these files into future sessions. This creates a memory-poisoning path because content influenced by an untrusted conversation can be elevated from an ordinary learning record into authoritative agent instructions. The document encourages aggressive promotion but does not require trusted provenance, security review, explicit user approval, c ...[truncated 1588 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Prohibit automatic promotion of conversation content into instruction-bearing files. 2. Require explicit, informed human approval for every promotion. 3. Preserve provenance, including the originating session, user, timestamp, and exact source content. 4. Separate passive learning records from executable or authoritative agent instructions. 5. Reject promotion of content that changes safety policy, permissions, tool behavior, authentication handling, or command-execution rules. 6. Apply an allowlist of permitted factual content and remove imperative instructions from proposed promotions. 7. Present a diff before writing to `SOUL.md`, `AGENTS.md`, `TOOLS.md`, `CLAUDE.md`, or Copilot instructions. 8. Add integrity monitoring, version history, rollback support, and periodic review of persistent instruction files. 9. Replace “promote aggressively” with a conservative policy that defaults to no promotion. ]]>
