T02 · Agent Memory Poisoning
Warning
- Location
- SKILL.md:23
- Finding
- Conversation-Derived Learnings Can Be Promoted into Persistent Agent Instructions## Vulnerability Details **File Location**: `SKILL.md:23-26`, `SKILL.md:262-289`, `SKILL.md:346-360` **Vulnerability Type**: Persistent agent memory poisoning **Risk Level**: Medium ### Vulnerable Code Snippet ```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 ## Promoting to Project Memory When a learning is broadly applicable (not a one-off fix), promote it to permanent project memory. ### 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` ``` ```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 ``` ### Technical Analysis The skill directs agents to derive learnings from conversations, user corrections, errors, and tool behavior, then promote selected content into persistent files such as `SOUL.md`, `AGENTS.md`, `TOOLS.md`, and `CLAUDE.md`. These files can be injected into subsequent sessions and can influence future agent behavior. The promotion criteria focus on recurrence, applicability, and time windows. They do not require validation of the source's trust level, explicit human approval, or a security review of the proposed in ...[truncated 1574 chars]
- Remediation
- ## Remediation Suggestions 1. Require explicit human approval before writing any conversation-derived rule into persistent agent-context files. 2. Track provenance for every learning, including the originating user, session, task, and supporting evidence. 3. Treat recurrence as supporting evidence only; do not treat it as proof that content is trustworthy. 4. Prohibit promoted rules from changing safety boundaries, authorization requirements, trusted tool definitions, credential handling, or instruction priority. 5. Sanitize and rewrite promoted content instead of copying raw user or tool output. 6. Introduce a review queue that displays the exact proposed change and destination before modification. 7. Limit automatic writes to `.learnings/`; reserve `SOUL.md`, `AGENTS.md`, `TOOLS.md`, and similar prompt files for reviewed changes. 8. Add rollback metadata and an audit log for all promotions.
