T02 · Agent Memory Poisoning
- Location
SKILL.md:262- Finding
Untrusted learning content can poison persistent agent instructions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:262-289andSKILL.md:333-360
Vulnerability Type: Persistent agent-context poisoning
Risk Level: HighVulnerable Code
SKILL.md:262-289: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-instructions.md`SKILL.md:333-360:markdown ### Ingestion Workflow 1. Read `simplify_and_harden.learning_loop.candidates` from the task summary. 2. For each candidate, use `pattern_key` as the stable dedupe key. 3. Search `.learnings/LEARNINGS.md` for an existing entry with that key: - `grep -n "Pattern-Key: <pattern_key>" .learnings/LEARNINGS.md` 4. If found: - Increment `Recurrence-Count` - Update `Last-Seen` - Add `See Also` links to related entries/tasks 5. If not found: - Create a new `L ...[truncated 2813 chars]- Remediation
View remediation
Remediation Suggestions
- Require explicit human approval before modifying any persistent agent-context file.
- Present the exact target path and a complete diff before promotion.
- Never promote raw user text, command output, task summaries, or external content.
- Preserve provenance for every candidate, including source, author, session, timestamp, and supporting evidence.
- Reject candidates containing imperative instructions, safety-policy changes, credential-handling rules, requests to suppress review, or instructions to execute commands.
- Treat recurrence only as a relevance signal, not as evidence that content is trustworthy.
- Store promoted facts in a clearly delimited, non-authoritative data section rather than mixing them with executable agent instructions.
- Restrict automated writes to
.learnings/; require a separate reviewed process to modifyCLAUDE.md,AGENTS.md,SOUL.md,TOOLS.md, or Copilot instructions. - Record and review all promotions through version-control changes with designated code owners.
- Add tests using prompt-injection payloads to verify that hostile learning entries cannot become persistent instructions.
