T02 · Agent Memory Poisoning
- Location
SKILL.md:19- Finding
Untrusted Conversation Content Can Poison Persistent Agent Memory
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:19-25,SKILL.md:67-74,SKILL.md:284-314,hooks/openclaw/handler.js:13-25,hooks/openclaw/handler.ts:14-26,references/openclaw-integration.md:126-142
Vulnerability Type: Persistent memory poisoning through insufficiently validated promotion of conversational content
Risk Level: HighVulnerable Code
markdown | User corrects you | Log to `.learnings/LEARNINGS.md` with category `correction` | | User wants missing feature | Log to `.learnings/FEATURE_REQUESTS.md` | | Knowledge was outdated | Log to `.learnings/LEARNINGS.md` with category `knowledge_gap` | | Found better approach | Log to `.learnings/LEARNINGS.md` with category `best_practice` | | 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) |The OpenClaw hook reinforces the same promotion workflow:
javascript **Log when:** - User corrects you → `.learnings/LEARNINGS.md` - Command/operation fails → `.learnings/ERRORS.md` - User wants missing capability → `.learnings/FEATURE_REQUESTS.md` - You discover your knowledge was wrong → `.learnings/LEARNINGS.md` - You find a better approach → `.learnings/LEARNINGS.md` **Promote when pattern is proven:** - Behavioral patterns → `SOUL.md` - Workflow improvements → `AGENTS.md` - Tool gotchas → `TOOLS.md`Technical Analysis
The Skill treats user corrections, model-generated conclusions, and observed behavioral patterns as candidates for persistent storage. It subsequently directs the agent to promote selected entries into files such as
SOUL.md,AGENTS.md,TOOLS.md,CLAUDE.md, and.github/copilot-instructions.md.These files may be injected into later agent sessions and can function as durable behavioral or operational ...[truncated 1845 chars]
- Remediation
View remediation
Remediation Suggestions
- Require explicit human approval before promoting any learning into an automatically loaded agent-context file.
- Present the exact target-file diff and the source conversation before requesting approval.
- Preserve provenance, including the originating user, session, timestamp, source message, and whether the claim was independently verified.
- Never promote raw user or model text. Convert verified facts into constrained, declarative project documentation.
- Reject proposed entries that modify safety controls, access boundaries, approval requirements, credential handling, or tool permissions.
- Separate factual project memory from executable agent instructions and apply stricter controls to the latter.
- Require independent evidence before incrementing recurrence counters; repeated claims from one user or session must not establish trust.
- Remove or revise guidance encouraging aggressive promotion.
- Provide rollback and audit-history mechanisms for all modifications to persistent context files.
- Treat shared memory files as security-sensitive configuration and protect them with repository review or ownership rules.
