T02 · Agent Memory Poisoning
- Location
SKILL.md:46- Finding
Persistent Agent Steering Through Automatically Promoted Memory
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:46-55, 84-105, 202-217, 241-246, 260-268
Vulnerability Type: Persistent agent memory poisoning
Risk Level: HighVulnerable Code Snippet
markdown Memory lives in `~/self-improving/` with tiered structure. If `~/self-improving/` does not exist, run `setup.md`. Workspace setup should add the standard self-improving steering to the workspace AGENTS, SOUL, and `HEARTBEAT.md` files, with recurring maintenance routed through `heartbeat-rules.md`. ```text ~/self-improving/ ├── memory.md # HOT: ≤100 lines, always loaded ├── index.md # Topic index with line counts ├── heartbeat-state.md # Heartbeat state: last run, reviewed change, action notes ├── projects/ # Per-project learnings ├── domains/ # Domain-specific (code, writing, comms) ├── archive/ # COLD: decayed patterns └── corrections.md # Last 50 corrections logLog automatically when you notice these patterns:
Preference signals → add to
memory.mdif explicit:- "I like when you..."
- "Always do X for me"
- "Never do Y"
- "My style is..."
- "For [project], use..."
3. Automatic Promotion/Demotion
- Pattern used 3x in 7 days → promote to HOT
- Pattern unused 30 days → demote to WARM
- Pattern unused 90 days → archive to COLD
- Never delete without asking
7. Transparency
- Every action from memory → cite source: "Using X (from projects/foo.md:12)"
- Weekly digest available: patterns learned, demoted, archived
- Full export on demand: all files as ZIP
This skill ONLY:
- Learns from user corrections and self-reflection
- Stores preferences in local files (
~/self-improving/) - Maintains heartbeat state in
~/self-improving/heartbeat-state.mdwhen the workspace integrates heartbeat - Reads its own memory files on activation
text ### Technical Analysis The skill treats user-supplied natural-language preferences and corrections as persistent behavioral rules. It automatic ...[truncated 2826 chars]- Remediation
View remediation
Remediation Suggestions
- Do not modify
AGENTS,SOUL,HEARTBEAT.md, or other agent-control files as part of memory setup. Keep the feature isolated to an explicitly authorized, project-scoped data directory. - Store preferences as inert structured data with a restrictive schema, such as a category, normalized value, provenance, scope, creation time, and expiration time. Never execute or directly interpolate stored free-form text as agent instructions.
- Require explicit user confirmation before every promotion to HOT memory. Display the exact proposed rule, destination, scope, and expected behavioral effect.
- Replace repetition-based trust with authorization and safety validation. Repeating a statement must not bypass policy checks.
- Reject memory entries that request tool execution, policy changes, secret disclosure, safety-check bypasses, role changes, or access beyond the stated task.
- Bind memory to a verified user and project. Prevent one user, repository, or untrusted document from creating rules that affect another scope.
- Apply stored preferences only through a precedence layer subordinate to system, developer, security, and current-task instructions.
- Add provenance, audit history, expiration, review, and one-step deletion controls. Provide a safe mode that disables persistent loading.
- Make setup and maintenance files part of the reviewed package. Do not instruct the agent to run absent
setup.md,boundaries.md, orheartbeat-rules.mdresources. - Add tests proving that instruction-like preference text remains inert and cannot trigger execution, weaken safeguards, or propagate into workspace steering files.
- Do not modify
