T02 · Agent Memory Poisoning
- Location
SKILL.md:55- Finding
Conversation-Derived Rules Can Be Promoted into Persistent Agent Memory
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:55-73,SKILL.md:164-178
Vulnerability Type: Persistent memory poisoning through automatically logged corrections and pattern promotion
Risk Level: HighVulnerable Snippets
markdown ## Learning Signals Log automatically when you notice these patterns: **Corrections** → add to `corrections.md`, evaluate for `memory.md`: - "No, that's not right..." - "Actually, it should be..." - "You're wrong about..." - "I prefer X, not Y" - "Remember that I always..." - "I told you before..." - "Stop doing X" - "Why do you keep..." **Preference signals** → add to `memory.md` if explicit: - "I like when you..." - "Always do X for me" - "Never do Y" - "My style is..." - "For [project], use..."markdown ### 1. Learn from Corrections and Self-Reflection - Log when user explicitly corrects you - Log when you identify improvements in your own work - Never infer from silence alone - After 3 identical lessons → ask to confirm as rule ### 2. Tiered Storage | Tier | Location | Size Limit | Behavior | |------|----------|------------|----------| | HOT | memory.md | ≤100 lines | Always loaded | | WARM | projects/, domains/ | ≤200 lines each | Load on context match | | COLD | archive/ | Unlimited | Load on explicit query | ### 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 askingTechnical Analysis
The skill directs the agent to automatically persist user corrections, preferences, and self-generated reflections. Repeated patterns may subsequently be promoted to HOT memory, which is designated as always loaded.
Repetition is used as the principal promotion signal, but the documented process does not establish provenance checks, a trusted-rule schema, semantic restrictions, or ...[truncated 1898 chars]
- Remediation
View remediation
Remediation Suggestions
- Require explicit, informed confirmation before every persistent write and every promotion into HOT memory.
- Remove automatic promotion based solely on repetition or usage frequency.
- Store provenance with each entry, including the originating session, author, timestamp, confirmation state, and exact source text.
- Treat stored entries as untrusted data and never as higher-priority instructions.
- Reject memory entries that attempt to change safety policies, tool permissions, approval requirements, system prompts, credential handling, or memory-management rules.
- Use a constrained schema for preferences instead of storing arbitrary free-form instructions.
- Present the exact proposed rule and its scope to the user before saving it.
- Provide an auditable history and an easy mechanism to inspect, revoke, quarantine, and restore entries.
- Resolve the contradiction between confirmation-based promotion and automatic promotion so that confirmation is mandatory in all cases.
