T02 · Agent Memory Poisoning
- Location
SKILL.md:367- Finding
Untrusted Learnings Can Be Promoted into Persistent Agent Instructions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:367-381
Additional Locations:SKILL.md:464-469,references/openclaw-integration.md:115-142
Vulnerability Type: Persistent agent-context poisoning
Risk Level: HighVulnerable 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: - `CLAUDE.md` - `AGENTS.md` - `.github/copilot-instructions.md` - `SOUL.md` / `TOOLS.md` for OpenClaw workspace-level guidance when applicable Write promoted rules as short prevention rules (what to do before/while coding), not long incident write-ups.The broader promotion guidance also states:
markdown 7. **Promote aggressively** - if in doubt, add to CLAUDE.md or .github/copilot-instructions.mdTechnical Analysis
The Skill captures information originating from conversations, command failures, user corrections, and external tool behavior. Those sources can contain attacker-controlled or otherwise untrusted text.
The promotion process permits this information to be transformed into rules stored in
CLAUDE.md,AGENTS.md,.github/copilot-instructions.md,SOUL.md, orTOOLS.md. These files are described as Agent context or system-prompt inputs loaded in later sessions. The recurrence threshold only measures how frequently a pattern appears; it does not establish that the content is safe or accurate.No mandatory approval, provenance validation, instruction-content filtering, or trust-boundary check is required before promotion. An attacker can therefore phrase malicious instructions as plausible corrections, workflow improvements, behavioral guidance, or tool gotchas. Once promoted, those instructions can affect future sessions independently of the original co ...[truncated 1536 chars]
- Remediation
View remediation
Remediation Suggestions
- Require explicit, informed user approval before modifying any persistent Agent-context file.
- Treat all conversation-derived learning text as untrusted data, including repeated or apparently project-specific corrections.
- Never copy free-form learning content directly into instruction files. Convert it into a restricted structured schema containing facts, evidence, provenance, and expiration information.
- Reject entries containing instruction-like directives, requests to bypass safeguards, tool invocations, external URLs, encoded content, credential handling, or changes to trust policy.
- Require independent verification against trusted project documentation or source code before promotion.
- Record the originating session, author, related files, supporting evidence, reviewer, and promotion timestamp.
- Replace “promote aggressively” with a conservative default: keep entries in
.learnings/unless the user approves a reviewed and sanitized rule. - Present an exact diff before changing
CLAUDE.md,AGENTS.md,SOUL.md,TOOLS.md, or.github/copilot-instructions.md. - Add integrity monitoring and straightforward rollback for persistent instruction files.
- Keep learned facts clearly separated from executable instructions and higher-priority security policies.
