T02 · Agent Memory Poisoning
- Location
SKILL.md:346- Finding
Conversation-derived learnings can poison persistent agent instruction files
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:346-360
Related Locations:SKILL.md:23-26,SKILL.md:120-128,SKILL.md:262-289
Vulnerability Type: Persistent agent memory and instruction 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 Skill also explicitly accepts user feedback as a learning source and promotes broadly applicable material:
markdown | User corrects you | Log to `.learnings/LEARNINGS.md` with category `correction` | | 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) |Technical Analysis
The Skill creates a pipeline from user-controlled conversation content to persistent agent-context files. User corrections and feedback can be recorded in
.learnings/LEARNINGS.md, after which recurring entries can be promoted intoCLAUDE.md,AGENTS.md,.github/copilot-instructions.md,SOUL.md, orTOOLS.md.These destinations are described as files that are injected into subsequent agent sessions. The promotion criteria check recurrence, task count, and time window, but do not establish trusted provenance, require human approval, detect embedded instructions, or prevent promoted rules from altering authorization and safety behavior. ...[truncated 2006 chars]
- Remediation
View remediation
Remediation Suggestions
- Require explicit human approval before writing any learning into
CLAUDE.md,AGENTS.md,SOUL.md,TOOLS.md, or.github/copilot-instructions.md. - Treat conversations, command output, external documentation, issue text, and existing learning entries as untrusted data.
- Do not promote content verbatim. Convert it into a structured record containing provenance, evidence, scope, confidence, reviewer identity, and review date.
- Reject promoted rules that attempt to:
- Override system or safety instructions.
- Disable validation or authorization checks.
- Expand tool permissions.
- Request secrets or sensitive output.
- Require unreviewed command execution.
- Suppress warnings, logging, or user confirmation.
- Separate factual project memory from behavioral instructions. Conversation-derived facts should not automatically become agent policy.
- Use an allowlisted schema for promotion rather than arbitrary Markdown.
- Add ownership and mandatory review controls, such as repository branch protection or
CODEOWNERS, for agent-context files. - Preserve an auditable link from every promoted rule to its source evidence.
- Provide an automated rollback mechanism for promoted instructions.
- Clarify that recurrence only prioritizes review and never establishes trust.
- Require explicit human approval before writing any learning into
