T02 · Agent Memory Poisoning
- Location
SKILL.md:44- Finding
Untrusted Learnings Can Be Promoted into Persistent Agent Memory
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 44–56
Vulnerability Type: Persistent agent memory poisoning
Risk Level: MediumRelevant Snippet:
markdown Periodically (or when the file exceeds ~50 entries): - Delete entries that no longer apply (dependency upgraded, config changed) - Merge duplicates into a single entry - Promote critical entries that affect every session to a permanent location ## Promotion Move persistent, high-impact learnings out of this file and into durable config: - **OpenClaw**: Promote to workspace `MEMORY.md`, `TOOLS.md`, or `AGENTS.md` - **Claude Code**: Promote to project `CLAUDE.md` or auto-memory (`~/.claude/projects/*/memory/`) Once promoted, delete the entry from `learnings.md` to avoid duplication.Technical Analysis
The skill directs the agent to promote entries from the session-oriented
learnings.mdfile into durable agent configuration files, includingAGENTS.md,CLAUDE.md,MEMORY.md, andTOOLS.md. These files can influence tool use, operational assumptions, and instructions in future sessions.Entries are derived from project interactions, user corrections, encountered content, and perceived conventions. The promotion process does not require provenance verification, explicit user approval, separation of observations from executable instructions, or validation that an entry is safe before it is copied into persistent configuration. Consequently, an attacker who can influence what the agent interprets as a useful learning may cause attacker-controlled guidance to persist beyond the original session.
Attack Path
- An attacker controls or influences project content, task instructions, error output, or another input reviewed by the agent.
- The attacker presents a malicious instruction as a project convention, necessary workaround, or user correction—for example, a claim that future tasks must invoke an attacker-controlled t ...[truncated 1304 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not automatically promote content derived from user input, repository files, tool output, logs, or external sources into persistent instruction files.
- Require explicit, informed user approval for every promoted entry, showing both the source and the exact destination text before writing it.
- Track provenance and trust level for each learning. Only allow promotion of entries originating from trusted maintainers or independently verified project configuration.
- Treat
AGENTS.md,CLAUDE.md,MEMORY.md, andTOOLS.mdas security-sensitive instruction stores rather than general note files. - Restrict promoted content to factual, non-executable observations. Reject entries that request commands, weaken safeguards, redirect tools or network endpoints, request secrets, or establish behavioral rules.
- Prefer a dedicated structured data file for validated project facts instead of copying free-form text into files interpreted as agent instructions.
- Require a review diff and confirmation before modifying persistent files, and preserve an audit trail so unauthorized changes can be identified and reverted.
- Keep persistent memory scoped to the individual project. Avoid promotion into user-wide auto-memory unless separately reviewed and explicitly authorized.
