T02 · Agent Memory Poisoning
- Location
SKILL.md:132- Finding
Persistent Agent Policy Modification Through Error-Recovery Guidance
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 132-137
Vulnerability Type: Persistent modification of agent instruction state
Risk Level: MediumVulnerable Code
markdown □ Is there a systemic issue? → Suggest process improvement → Update AGENTS.md if neededTechnical Analysis
The skill directs the agent to update
AGENTS.mdwhen it identifies an apparently systemic issue. This file commonly contains persistent workspace-level instructions that affect the behavior of the agent in future tasks or sessions.The guidance does not require explicit user approval, distinguish trusted observations from attacker-controlled error content, restrict which sections may be modified, or validate proposed instructions before they become persistent. Consequently, information obtained from an untrusted command, repository, tool, or error message could be transformed into a durable behavioral rule.
This is classified as agent memory poisoning because the vulnerable behavior targets persistent agent state rather than merely changing the current response. Exploitation remains conditional on the hosting agent having permission to modify
AGENTS.md; the included CLI does not perform this write itself.Attack Path
- An attacker controls or influences a repository, command, tool response, or other input processed by the agent.
- The controlled operation produces a crafted failure or misleading diagnostic context.
- The error-recovery skill directs the agent to identify a systemic lesson from that failure.
- Following the instruction to update
AGENTS.md, the agent converts the attacker-influenced lesson into a persistent rule. - Future agent sessions load the modified instructions.
- The poisoned rule affects subsequent decisions, tool usage, or security behavior until it is detected and removed.
Impact Assessment
Successful exploitation can obtain persistent influence over a ...[truncated 510 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the instruction to modify
AGENTS.mdautomatically. - Require explicit, informed user approval before changing any persistent agent instruction file.
- Present proposed changes as a reviewable patch that shows the exact content and destination.
- Never derive persistent instructions directly from raw error messages or other untrusted output.
- Validate proposals against a strict schema and reject instructions that alter security constraints, permissions, tool policy, or instruction precedence.
- Store troubleshooting observations in a dedicated non-instructional document rather than
AGENTS.md. - Record the source and justification for every approved persistent change.
- Provide an easy rollback mechanism and review existing persistent instructions for unintended changes.
- Remove the instruction to modify
