T02 · Agent Memory Poisoning
- Location
SKILL.md:262- Finding
Untrusted Learnings Can Be Promoted into Persistent Agent Instructions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:262-289,SKILL.md:326-360, andSKILL.md:440-449
Vulnerability Type: Persistent agent memory poisoning
Risk Level: HighVulnerable Code
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`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 ...[truncated 2614 chars]- Remediation
View remediation
Remediation Suggestions
- Require explicit human approval before writing any learning into persistent agent-context files.
- Remove the “promote aggressively” instruction and make promotion deny-by-default.
- Store observations as quoted, non-executable data rather than agent directives.
- Preserve provenance for every entry, including the originating user, session, task, date, and supporting evidence.
- Reject or quarantine entries containing imperative instructions, role changes, requests to bypass safeguards, tool-use directives, credential handling rules, or external download commands.
- Use an allowlisted schema for promotable facts, such as package manager, test command, or documented repository convention.
- Require independent validation against trusted project files before promotion.
- Present a reviewable diff and require confirmation before modifying
CLAUDE.md,AGENTS.md,.github/copilot-instructions.md,SOUL.md, orTOOLS.md. - Record promotions in an audit log and provide a rollback mechanism.
