T02 · Agent Memory Poisoning
- Location
SKILL.md:390- Finding
Untrusted Learnings Can Be Promoted into Persistent Agent Instructions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:390-407
Additional Locations:SKILL.md:269-298,SKILL.md:495
Vulnerability Type: Persistent agent memory poisoning
Risk Level: MediumVulnerable Code Snippet
markdown ### Promotion Rule (System Prompt Feedback) 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: `SOUL.md`, `TOOLS.md`, or `AGENTS.md` (workspace), or the project's own agent file when the pattern is project-specific. Write promoted rules as short prevention rules (what to do before/while coding), not long incident write-ups.Related guidance further increases the risk:
markdown 7. **Promote aggressively** - if in doubt, add to `TOOLS.md` or `SOUL.md`Technical Analysis
The skill permits content derived from conversations, user corrections, error reports, and task summaries to be transformed into rules stored in
SOUL.md,TOOLS.md, orAGENTS.md. OpenClaw injects these files into subsequent sessions, so promoted content can persistently influence future agent behavior.The recurrence threshold limits accidental promotion, but it is not a security boundary. The workflow does not require approval from a trusted workspace owner, verify the provenance of a learning, or prohibit promotion of rules concerning authorization, safety controls, credential handling, tool execution, or instruction priority. A party capable of supplying repeated task content could therefore cause an attacker-selected behavioral rule to appear legitimate and become persistent context.
This is distinct from ordinary note-taking because the specified promotion targets are agent instruction files rather than passive records.
Attack Path
- An attacker or untrusted user submits a crafted correction or purported best practice during a task.
- The agent records it in `. ...[truncated 1128 chars]
- Remediation
View remediation
Remediation Suggestions
- Require explicit confirmation from a trusted workspace owner before writing any learning into
SOUL.md,TOOLS.md,AGENTS.md, or another automatically injected prompt file. - Replace “promote aggressively” with a conservative policy that treats promotion as a privileged, security-sensitive action.
- Prohibit automatic promotion of rules related to:
- Safety or authorization boundaries
- Credential and secret handling
- Instruction priority
- Network access
- Tool execution
- Cross-session data access
- Permission changes
- Store provenance with every candidate, including the originating user, session, task, date, and exact source learning.
- Require review by a trusted identity distinct from the user who supplied the original content.
- Maintain an allowlisted schema for promotable rules and reject imperative content that attempts to override higher-priority instructions.
- Present a diff before modifying persistent prompt files and provide a rollback mechanism.
- Keep unreviewed learnings in passive
.learnings/storage rather than agent instruction files. - Add tests confirming that repeated untrusted input cannot cause automatic or unapproved prompt-file modification.
- Require explicit confirmation from a trusted workspace owner before writing any learning into
