T02 · Agent Memory Poisoning
- Location
SKILL.md:89- Finding
Persistent Agent Memory and Personality Poisoning
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 89-116
Vulnerability Type: Persistent storage of conversation-derived content in instruction-bearing memory and identity files
Risk Level: HighVulnerable Segment
The following is a faithful English translation of the complete relevant source segment:
markdown 1. Read `SOUL.md` — AI personality 2. Read `USER.md` — user information 3. Read `memory/YYYY-MM-DD.md` (today and yesterday) 4. **Main session**: Read `MEMORY.md` 5. Check the `knowledge/` directory ## Saving Memory When the user says "remember...": - Update the record in `memory/YYYY-MM-DD.md` - Synchronize important content to `MEMORY.md` - Optionally store it in the vector database ```bash # Add memory with an importance score python3 ~/.openclaw/workspace/scripts/memory-system/context-memory.py add "content" 8 # Add tags python3 ~/.openclaw/workspace/scripts/memory-system/memory-py.py add "content" "tag1,tag2"Update Rules
Files That Must Be Updated
- memory/YYYY-MM-DD.md - every session
- MEMORY.md - new lessons or important information
- SOUL.md - personality changes
- USER.md - user preference changes
text ### Technical Analysis The Skill instructs the agent to persist conversation-derived information into files that are automatically loaded during later sessions. These files do not serve only as passive records: `SOUL.md` defines agent personality, `MEMORY.md` supplies long-term context, and `USER.md` influences behavior based on supposed user preferences. No trust boundary or validation mechanism separates ordinary user data from executable natural-language instructions. The Skill also lacks provenance tracking, instruction filtering, confirmation requirements, integrity controls, and a distinction between trusted policy and untrusted remembered content. Consequently, attacker-controlled text can be stored in a con ...[truncated 1789 chars]- Remediation
View remediation
Remediation Suggestions
- Prohibit automatic modification of
SOUL.md, core policy files, and other instruction-bearing resources. - Store remembered information in a structured data format with fixed fields rather than unrestricted Markdown instructions.
- Treat all persisted conversation content as untrusted data when it is loaded into a future prompt.
- Reject or quarantine content containing role directives, policy overrides, tool instructions, or requests to alter future behavior.
- Require explicit, informed user confirmation before writing any long-term memory.
- Record provenance, timestamp, initiating user, and approval status for every memory entry.
- Separate factual user preferences from system policy and agent personality definitions.
- Apply access controls so ordinary Skill execution cannot write to identity or global instruction files.
- Provide review, expiry, deletion, and rollback mechanisms for persisted entries.
- Load only memory records relevant to the current task instead of automatically importing unrestricted files into every session.
- Prohibit automatic modification of
