T02 · Agent Memory Poisoning
- Location
SKILL.md:439- Finding
Untrusted Learnings Can Be Promoted into Persistent Agent Instruction Files
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:439-447
Additional Locations:SKILL.md:23-26,SKILL.md:262-289,SKILL.md:351-360,hooks/openclaw/handler.ts:19-24,hooks/openclaw/handler.js:18-23
Vulnerability Type: Persistent agent memory and instruction poisoning
Risk Level: HighVulnerable Code
markdown ## Best Practices 1. **Log immediately** - context is freshest right after the issue 2. **Be specific** - future agents need to understand quickly 3. **Include reproduction steps** - especially for errors 4. **Link related files** - makes fixes easier 5. **Suggest concrete fixes** - not just "investigate" 6. **Use consistent categories** - enables filtering 7. **Promote aggressively** - if in doubt, add to CLAUDE.md or .github/copilot-instructions.md 8. **Review regularly** - stale learnings lose valueRelated promotion destinations are explicitly defined as follows:
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) |The bootstrap reminder reinforces these destinations:
typescript **Promote when pattern is proven:** - Behavioral patterns → \`SOUL.md\` - Workflow improvements → \`AGENTS.md\` - Tool gotchas → \`TOOLS.md\`Technical Analysis
The Skill captures information originating from conversations, user corrections, command failures, and tool behavior. It then instructs the agent to promote selected information into files such as
CLAUDE.md,AGENTS.md,SOUL.md,TOOLS.md, and.github/copilot-instructions.md.These files can function as persistent agent instructions and may be loaded into future sessions. The promotion workflow does not require a human ...[truncated 1882 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the “promote aggressively” instruction and make promotion opt-in and conservative.
- Require explicit human approval before modifying
CLAUDE.md,AGENTS.md,SOUL.md,TOOLS.md, or Copilot instruction files. - Store raw learnings as non-executable data that is never automatically interpreted as agent policy.
- Attach provenance to every entry, including source session, author, timestamp, related task, and reviewer.
- Reject promotions containing behavioral overrides, security-policy changes, tool-execution instructions, secret-handling rules, or unrelated commands.
- Use an allowlisted schema for promoted content and separate factual project notes from agent instructions.
- Present a reviewable diff before any persistent instruction file is changed.
- Require corroboration from trusted project documentation or reviewed code before promoting user-provided claims.
- Provide a rollback mechanism and audit log for every promotion.
