T02 · Agent Memory Poisoning
- Location
SKILL.md:21- Finding
Persistent Agent-State Poisoning Through Untrusted Learning Promotion
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 21-27, 39-42, and 65-68
Vulnerability Type: Persistent memory and instruction poisoning
Risk Level: HighVulnerable Code Snippets
markdown .learnings/ ├── ERRORS.md # Erros cometidos ├── LEARNINGS.md # Aprendizados ├── FEATURE_REQUESTS.md # Features solicitadas └── CORRECTIONS.md # Correções de usuáriomarkdown ### ✅ Correções - Usuário corrige: "Não, isso está errado..." - Usuário melhora: "Na verdade, faça assim..." - Usuário especifica: "Quero que seja..."markdown Aprendizados importantes são promovidos para: - `AGENTS.md` - Conhecimento do agente - `TOOLS.md` - Notas de ferramentas - `SKILL.md` - Melhorias de skillsTechnical Analysis
The skill directs the agent to capture user-supplied corrections and promote selected learning content into persistent files such as
AGENTS.md,TOOLS.md, andSKILL.md. These files can affect the agent's behavior, tool usage, and skill instructions in later sessions.No validation, sanitization, provenance enforcement, approval workflow, or distinction between declarative knowledge and executable agent instructions is specified. Consequently, attacker-controlled text presented as a correction or learning can be incorporated into persistent agent state. Once promoted, embedded instructions can be interpreted as trusted operational guidance during future sessions.
This is a persistent memory-poisoning issue rather than ordinary current-session prompt injection because the documented promotion mechanism allows untrusted content to survive beyond the originating interaction. Modification of
SKILL.mdis especially sensitive because poisoned content may be loaded whenever the skill is subsequently activated.Attack Path
- An attacker submits a correction or learning containing concealed or explicit agent instructions.
- The skill classif ...[truncated 1185 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not automatically promote user-controlled content into
AGENTS.md,TOOLS.md, orSKILL.md. - Restrict automatic writes to isolated
.learnings/data files that are never interpreted as agent instructions. - Require explicit approval from a trusted operator before promoting any learning. Display the source, destination, provenance, and complete diff.
- Store learning records in a structured schema that separates factual observations from proposed instructions.
- Reject or quarantine content containing imperative agent directives, role changes, tool commands, safety overrides, encoded instructions, or requests to modify trusted configuration.
- Preserve provenance metadata, including the originating user, session, timestamp, trust level, and approval identity.
- Apply least-privilege filesystem permissions so the learning process cannot directly modify trusted instruction files.
- Maintain version history and provide an audited rollback mechanism for every approved change.
- Treat all learned content as untrusted data when it is later loaded into an agent context.
- Add tests demonstrating that malicious corrections cannot modify persistent agent policy or skill behavior without trusted human authorization.
- Do not automatically promote user-controlled content into
