T02 · Agent Memory Poisoning
- Location
SKILL.md:29- Finding
Unsanitized Conversation Content Can Poison Persistent Agent Memory
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:29-49
Vulnerability Type:T02: Agent Memory Poisoning
Risk Level: MediumVulnerable Code
markdown 1. **Save checkpoint to memory file:** - Read current memory/YYYY-MM-DD.md - Add key context: decisions, pending tasks, important details - Write back to memory file 2. **Alert user:** Say: "⚠️ Approaching context limit (~160k tokens). Saving checkpoint to memory before continuing." 3. **Ask user:** - Continue and accept compaction? - Summarize and restart fresh? - Pause until ready? ## What to Save Essential information that must survive compaction: - **Decisions made** in this conversation - **Pending tasks** not yet completed - **Important context** (project state, configurations, preferences)Technical Analysis
The checkpoint protocol instructs the agent to copy conversation-derived decisions, pending tasks, configurations, preferences, and other important details into a persistent daily memory file. It does not require content sanitization, provenance tracking, secret detection, an allowlist of safe fields, or explicit user approval before writing.
Because conversation content may be controlled by an untrusted user or obtained from untrusted material, malicious instructions can be represented as decisions, pending tasks, preferences, or important context. Once written to persistent memory, those instructions may be treated as trusted context by later sessions. This allows an indirect prompt-injection payload to survive context compaction and session boundaries.
The same mechanism can persist sensitive project details or plaintext configuration values. The Skill does not instruct the agent to exclude credentials, access tokens, private keys, personal information, or other secrets.
Attack Path
- An attacker supplies a prompt or document containing a malicious directive, such as a purported pro ...[truncated 1527 chars]
- Remediation
View remediation
Remediation Suggestions
- Require explicit user confirmation immediately before creating or updating a persistent checkpoint.
- Use a strict allowlist of factual fields that may be persisted, rather than broadly storing “important details,” configurations, or preferences.
- Never persist credentials, tokens, private keys, authentication cookies, personal information, confidential configuration values, or raw untrusted document content.
- Treat all conversation-derived content as untrusted data. Remove or neutralize imperative statements and prompt-like directives before persistence.
- Record provenance for every saved item, including its source, timestamp, and whether the user explicitly approved it.
- Clearly label checkpoint content as reference data that must not override system instructions, developer instructions, security policies, or current user intent.
- Present the exact proposed checkpoint to the user for review and redaction before writing it.
- Apply restrictive filesystem permissions and defined retention periods to memory files, and provide a reliable deletion mechanism.
- On later reads, parse memory into a constrained data structure instead of inserting raw memory-file text into the agent's instruction context.
- Add tests confirming that injected instructions and representative secret formats are rejected or redacted.
