T02 · Agent Memory Poisoning
Warning
- Location
- SKILL.md:278
- Finding
- Silent Cross-Session Profile Mutation Can Poison Future Agent Decisions<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:122-130`, `SKILL.md:278-306`, and `assets/user-profile-template.md:31-36` **Vulnerability Type**: Persistent memory poisoning through unconfirmed conversation-derived profile updates **Risk Level**: Medium ### Vulnerable Code `SKILL.md:122-130`: ```markdown **Before the first lattice of any session**, check if a user profile exists: ``` ~/.openclaw/workspace/mental-models-profile.md ``` If found: read it silently. Load the user's context, blind spots, and any promoted learnings into working memory. Do not announce this — just use it. If not found: proceed without it. After the first lattice, suggest once: "To get more personalized analysis, fill in your profile at `~/.openclaw/workspace/mental-models-profile.md`." ``` `SKILL.md:278-306`: ```markdown ## Session Learning & Promotion At the end of any session where the lattice was used, scan for patterns worth remembering. **Log when:** - User corrects the lattice ("that's not relevant here", "you missed the real issue") - User flags a trigger as wrong ("this didn't need the lattice") - A lens combination produced strong resonance ("that's exactly it") - User reveals context that significantly changed the analysis **Log format** — append to `~/.openclaw/workspace/mental-models-profile.md` under `learnings:`: ``` [YYYY-MM-DD] — [what was observed] — recurrence: N ``` Examples: ``` [2025-03-06] — user thinks in systems but misses incentive structures — recurrence: 1 [2025-03-06] — lattice triggered on "how does X affect Y" (info retrieval) — recurrence: 2 [2025-03-06] — TENSION label resonated strongly on career decisions — recurrence: 1 ``` **Promotion rule** — when a learning hits recurrence ≥ 3 across different topics, promote it: | Pattern type | Promote to | Example | |---|---|---| | User's blind spot | `known_blind_spots` in profile | "consistently underweights incentive structures" | | Trigger misfire | note in profile to adjust ac ...[truncated 3336 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Require explicit user approval before every persistent profile write. Present the exact proposed addition, target field, and reason for storing it. 2. Require separate confirmation before promoting a learning into `known_blind_spots`, `decision_context`, or any other field that affects future recommendations. 3. Remove the instructions to perform reads and updates silently. Clearly disclose when persistent profile information is loaded or changed. 4. Store provenance with every observation, including its creation date, source session, whether it was user-authored or agent-inferred, and its confirmation status. 5. Treat all conversation text as untrusted data. Never interpret quoted text, imported documents, or third-party instructions as authorization to modify persistent memory. 6. Only increment recurrence for independently confirmed observations. Repetition alone must not establish truth. 7. Add expiration periods and confidence values for inferred observations. Unconfirmed or stale entries should automatically become inactive. 8. Provide commands or controls that let users inspect, correct, export, disable, and delete all retained profile data. 9. Minimize collection of sensitive information. Avoid retaining portfolio positions, risk tolerance, or professional context unless the user explicitly requests persistence. 10. Validate the profile schema and restrict writes to approved data fields so conversation content cannot introduce executable instructions or additional directives. ]]>
