T02 · Agent Memory Poisoning
- Location
SKILL.md:23- Finding
Untrusted learnings can be promoted into persistent agent instructions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:23-26, 262-289, 350-361, 443-448;references/openclaw-integration.md:103-142
Vulnerability Type: Persistent agent-memory poisoning
Risk Level: MediumVulnerable Code and Instructions
SKILL.md:23-26defines persistent agent-context files as promotion targets:markdown | 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) |SKILL.md:262-289instructs the agent to transfer learnings into those files:markdown ## Promoting to Project Memory When a learning is broadly applicable (not a one-off fix), promote it to permanent project memory. ### When to Promote - Learning applies across multiple files/features - Knowledge any contributor (human or AI) should know - Prevents recurring mistakes - Documents project-specific conventions ### Promotion Targets | Target | What Belongs There | |--------|-------------------| | `CLAUDE.md` | Project facts, conventions, gotchas for all Claude interactions | | `AGENTS.md` | Agent-specific workflows, tool usage patterns, automation rules | | `.github/copilot-instructions.md` | Project context and conventions for GitHub Copilot | | `SOUL.md` | Behavioral guidelines, communication style, principles (OpenClaw workspace) | | `TOOLS.md` | Tool capabilities, usage patterns, integration gotchas (OpenClaw workspace) | ### How to Promote 1. **Distill** the learning into a concise rule or fact 2. **Add** to appropriate section in target file (create file if needed) 3. **Update** original entry: - Change `**Status**: pending` → `**Status**: promoted` - Add `**Promoted**: CLAUDE.md`, `AGENTS.md`, or `.github/copilot-instructi ...[truncated 2748 chars]- Remediation
View remediation
Remediation Suggestions
- Treat every conversation-derived learning as untrusted data, even when labeled as a correction or best practice.
- Require explicit, informed user approval immediately before writing to persistent agent-context files.
- Add a mandatory security review that rejects rules which:
- Override safety or authorization constraints.
- Request secrets, credentials, or unrelated private data.
- Change tool routing or command-execution policy.
- Authorize external communication or data transfer.
- Instruct the agent to ignore higher-priority instructions.
- Preserve structured provenance, including the originating session, author, timestamp, supporting evidence, and reviewer.
- Never copy raw user text directly into instruction files. Convert validated facts into narrowly scoped declarative statements.
- Keep unreviewed entries in
.learnings/as quoted data rather than active instructions. - Remove the “promote aggressively” recommendation and default to no promotion when trust or applicability is uncertain.
- Require separate approval for shared or globally injected files such as
SOUL.md,AGENTS.md, andTOOLS.md. - Add tests using prompt-injection examples to ensure malicious learning content cannot be promoted automatically.
