T02 · Agent Memory Poisoning
Error
- Location
- SKILL.md:262
- Finding
- Untrusted Learnings Can Be Promoted into Persistent Agent Instruction Files<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:23-26`, `SKILL.md:262-289`, `SKILL.md:346-361`, `SKILL.md:448`; `references/openclaw-integration.md:125-142` **Vulnerability Type**: Persistent agent memory and instruction poisoning **Risk Level**: High ### Vulnerable Code or Instructions ```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. ### 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` ``` ```markdown ### Promotion Rule (System Prompt Feedback) Promote recurring patterns into agent context/system prompt files when all are true: - `Recurrence-Count ...[truncated 2567 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove automatic or agent-decided promotion into prompt-bearing files. 2. Require explicit, per-entry human approval before modifying `CLAUDE.md`, `AGENTS.md`, `SOUL.md`, `TOOLS.md`, or Copilot instructions. 3. Treat all conversation-derived learning content as untrusted data. 4. Store learnings in a non-executable knowledge repository that is not automatically injected as authoritative instructions. 5. Define an allowlisted structured schema for promotable facts and reject commands, role changes, safety-policy changes, external URLs, and instructions requesting access to secrets. 6. Record provenance, originating session, author, review status, and an immutable audit trail for each promoted item. 7. Remove the “promote aggressively” guidance and default to no promotion when trust or applicability is uncertain. 8. Require a diff preview and confirmation before creating or changing any persistent agent-context file. ]]>
