T02 · Agent Memory Poisoning
- Location
SKILL.md:381- Finding
Persistent Cross-Session Experience Store Enables Agent Memory Poisoning
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 381-394 and 734-736
Vulnerability Type: Persistent ingestion and reuse of task-derived agent instructions
Risk Level: HighVulnerable Instructions
The following is a faithful English rendering of the relevant instructions:
text - The experience bank is stored in YAML format at `/workspace/.agent-experience/experience-bank.yaml`. - At the end of each task, append newly distilled principles to the experience bank. 5. Application injection: Inject matching principles into Plan and Repair strategies. - Trace recording is mandatory: Generate a complete `loop_trace` after every loop, including failed iterations. - Experience distillation is mandatory: After every 3–5 similar tasks, perform offline distillation and store successful and failed patterns as principles. - Principle application is mandatory: At the beginning of a new task, retrieve relevant principles from the experience bank and inject them into Plan and Repair strategies.Technical Analysis
The skill creates a persistent feedback channel between attacker-influenced task content and future agent behavior:
- Task execution produces traces containing goals, actions, observations, errors, and repair strategies.
- The skill requires those traces to be distilled into reusable principles.
- The resulting principles are appended to a persistent YAML file.
- Future sessions retrieve those principles and inject them into planning and repair decisions.
No trust-boundary separation, provenance validation, instruction sanitization, cryptographic integrity verification, per-user isolation, or mandatory human review is specified before a principle becomes persistent behavioral guidance.
Consequently, attacker-controlled task descriptions, tool output, documents, or failure messages can potentially be converted into trusted-looking principles. Persis ...[truncated 1853 chars]
- Remediation
View remediation
Remediation Suggestions
- Disable cross-session persistence by default and require explicit, informed user consent before creating or updating an experience bank.
- Isolate experience stores by user, tenant, project, and trust domain. Do not use one shared workspace-level memory file.
- Treat task text, repository content, retrieved documents, tool output, and model-generated conclusions as untrusted data.
- Permit only a strict structured schema for principles. Reject shell commands, URLs, credentials, executable fragments, role-changing instructions, and directives that modify safety constraints.
- Require human approval before promoting a task-derived pattern into persistent memory.
- Record provenance for every principle, including source task, source fields, author, creation time, validation evidence, and trust level.
- Do not automatically inject stored text as instructions. Present principles as untrusted contextual suggestions and revalidate them against current policies.
- Apply restrictive filesystem permissions, integrity checks, version history, expiration dates, and rollback support to the experience bank.
- Provide users with inspection, deletion, and complete memory-reset controls.
- Evaluate retrieved principles against current safety policies and task constraints before they can affect Plan or Repair behavior.
