T02 · Agent Memory Poisoning
- Location
SKILL.md:47- Finding
Untrusted Conversational Content Can Poison Persistent Agent Memory
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:47-61,SKILL.md:76-78,SKILL.md:103-107
Vulnerability Type: Persistent memory poisoning through insufficiently validated conversational content
Risk Level: HighVulnerable Code
markdown ### 2. On user remember request Triggered when the user explicitly or implicitly states something lasting: - **Explicit**: "remember that...", "save this...", "note that...", "from now on...", "always...", "never...", "the rule is..." - **Implicit**: corrections ("no, we use X not Y"), preferences ("I prefer tabs"), decisions ("we're going with Postgres"), team facts ("Alice owns auth"), environment info ("staging is port 3001") Do not compose your response yet. First write the entry to MEMORY.md in the appropriate section (`## User`, `## Knowledge`, `## Rules`, etc.):- {content} | EXPLICIT | from:YYYY-MM-DD
text If the content is detailed (multi-step procedure, analysis, etc.), create a project workspace instead and add a pointer to MEMORY.md. Then respond to the user and confirm. Persistence before acknowledgment.markdown 4. Promote qualifying entries to MEMORY.md: - EXPLICIT entries: promote immediately with `from:YYYY-MM-DD`. - INFERRED entries: only promote if the same pattern appears in 3+ daily files from the last 7 days.markdown If the search finds relevant entries in daily files, present findings to the user. If the information deserves long-term persistence, promote it to MEMORY.md with `from:YYYY-MM-DD`.Technical Analysis
The Skill directs the Agent to place broadly matched user statements into
MEMORY.mdbefore responding or obtaining confirmation. The trigger includes not only explicit memory requests but also implicit corrections, preferences, decisions, team facts, and environment information.Elsewhere, the Skill states that
MEMORY.mdis always injected into the Agent context. Consequentl ...[truncated 1985 chars]- Remediation
View remediation
Remediation Suggestions
- Require explicit user confirmation before writing any new persistent-memory entry, especially rules, corrections, and operational facts.
- Do not persist instructions found inside quoted text, documents, search results, tool output, or other third-party content unless the user separately confirms the exact normalized entry.
- Separate informational data from executable Agent instructions. Stored facts should never be interpreted as higher-priority behavioral directives.
- Apply a strict schema and allowlist for persistent-memory entry types. Reject content containing prompt-control language, tool directives, privilege requests, or instructions to ignore existing policies.
- Present the proposed memory entry verbatim and identify its source before asking for confirmation.
- Record provenance, including whether content came directly from the user, a retrieved file, a tool, or an external source.
- Require renewed confirmation before promoting retrieved daily-memory entries into
MEMORY.md. - Provide commands to inspect, edit, and remove persistent entries, and maintain an append-only audit history of changes.
- Treat all memory content as untrusted data when it is reloaded and ensure it cannot override system, developer, safety, or current-session instructions.
