T02 · Agent Memory Poisoning
- Location
SKILL.md:38- Finding
Untrusted Learning Content Can Be Promoted into Persistent Agent Instructions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:38-43,SKILL.md:302-309,SKILL.md:462; related workflow inreferences/openclaw-integration.md:112-143
Vulnerability Type: T02: Agent Memory Poisoning
Risk Level: HighVulnerable Code Snippet
markdown | Simplify/Harden recurring patterns | Log/update `.learnings/LEARNINGS.md` with `Source: simplify-and-harden` and a stable `Pattern-Key` | | Similar to existing entry | Link with `**See Also**`, consider priority bump | | 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) |markdown ### 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 7. **Promote aggressively** - if in doubt, add to CLAUDE.md or .github/copilot-instructions.mdTechnical Analysis
The Skill captures information originating from conversations, user corrections, command errors, and external tool behavior. Some of this content can therefore be controlled or influenced by an untrusted user, repository, command output, or external service.
The promotion workflow permits these learnings to be distilled into persistent instruction files such as
CLAUDE.md,AGENTS.md,.github/copilot-instructions.md,SOUL.md, andTOOLS.md. These files may be injected into future agent sessions as trusted context. Although the Skill defines recurrence and promotion criteria, it does not require an explicit approval step, provenance v ...[truncated 1779 chars]- Remediation
View remediation
Remediation Suggestions
- Require explicit, informed user approval before every write to persistent agent-context files.
- Display the destination path and exact proposed diff before promotion.
- Treat all learning text, command output, repository content, and external-service responses as untrusted data.
- Permit promotion only through a structured schema containing narrowly defined factual fields.
- Reject promoted content that attempts to:
- Override system or user instructions.
- Weaken security controls or approval requirements.
- Direct access to secrets, credentials, or unrelated files.
- Initiate external communication or cross-session sharing.
- Modify tools, hooks, permissions, or execution policy.
- Record provenance for every promoted rule, including source session, author, original entry, timestamp, and approving user.
- Separate factual project memory from behavioral and security-policy instructions.
- Replace “promote aggressively” with a conservative policy requiring verification, necessity, and least scope.
- Add automated checks that reject instruction-like or security-sensitive content before persistent writes.
- Provide a rollback mechanism and periodically review persistent prompt files for unauthorized changes.
