T02 · Agent Memory Poisoning
- Location
SKILL.md:322- Finding
Persistent Behavioral Rule Injection Through HOT.md and SOUL.md
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 322–348
Vulnerability Type: Persistent memory and behavioral-rule poisoning
Risk Level: CriticalVulnerable Code Snippet:
markdown `HOT.md` is a short file (≤20 lines) read **before every reply**. It contains only rules you've broken 2+ times. Not documentation — active behavioral correction. ### When to Create / Update - A rule appears in Part 1 logs **twice or more** → promote to HOT.md - HOT.md grows beyond 20 lines → you have a discipline problem, not a documentation problem. Fix the behavior, don't add more lines. - A rule stays unbroken for 30+ days → move it to SOUL.md permanently, remove from HOT.md ### Format ```markdown # HOT.md — Rules I Keep Breaking _Read before every reply. Max 20 lines. If it's not here, it doesn't count._ - [Rule 1 — short, imperative] (broken N times) - [Rule 2] (broken N times)Promotion Flow
text Log (Part 1) → Pattern 2x (Part 3 weekly) → HOT.md → 30 days clean → SOUL.md permanentKey Rule
If it should apply to EVERY interaction → SOUL.md.
text Related automatic modification logic appears at lines 167–199: ```bash **Rule:** If the same mistake appears 2+ times → promote it. Once is a log; twice is a rule. SOUL_FILE="$HOME/.openclaw/workspace/SOUL.md" LEARNINGS_FILE="$HOME/.openclaw/workspace/.learnings/LEARNINGS.md" DATE=$(date +%Y-%m-%d) RULE="[Replace this with the actual rule text]" printf "\n## Learned Rule — %s\n- %s\n" "$DATE" "$RULE" >> "$SOUL_FILE"Technical Analysis
The Skill treats interaction-derived learning entries as behavioral instructions and promotes them into files that govern future Agent behavior. A rule recorded twice can be moved into
HOT.md, which is expressly read before every reply. It can subsequently be transferred into the permanent identity fileSOUL.md.The workflow does not establish a trust boundary ...[truncated 1368 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not convert conversation-derived text directly into executable behavioral instructions.
- Store learning records in a dedicated data file that is never loaded as an instruction source.
- Require explicit owner approval of the exact proposed rule and exact file diff before modifying
HOT.mdorSOUL.md. - Validate proposed rules against system-level security policies and reject rules that broaden permissions, suppress safeguards, expose secrets, or override approval requirements.
- Record the source, timestamp, approver, and cryptographic integrity metadata for every promoted rule.
- Add rollback support and preserve versioned backups for all identity-file changes.
- Remove automatic promotion based solely on occurrence count; repetition is not evidence that content is safe or trustworthy.
- Prevent lower-trust users and external content from initiating persistent behavioral updates.
