T02 · Agent Memory Poisoning
- Location
SKILL.md:21- Finding
Persistent Agent Behavior Modification Through Memory Files
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:21-47,SKILL.md:65-69,references/training-manual-template.md:69-73, andreferences/training-manual-template.md:95-99
Vulnerability Type: Persistent memory poisoning
Risk Level: HighComplete Vulnerable Snippets
The following is an English rendering of the complete relevant segment from
SKILL.md:21-47:markdown - [ ] Created `agents/{agent_id}/IDENTITY.md` — identity definition - [ ] Created `agents/{agent_id}/SOUL.md` — personality definition - [ ] Created `agents/{agent_id}/MEMORY.md` — memory file - [ ] Created `agents/{agent_id}/HEARTBEAT.md` — heartbeat tasks - [ ] Copied `USER.md` to `agents/{agent_id}/USER.md` - [ ] Read the training manual (`AGENT_TRAINING.md`) - [ ] Confirmed the training content in `MEMORY.md` ## Training Confirmation Template After training is complete, update the subordinate Agent's `MEMORY.md`: ```markdown ## Training Record ### YYYY-MM-DD Training Confirmation - Read `AGENT_TRAINING.md` - Read `USER.md` **Understanding Confirmation:** - Team mission: [understanding] - My responsibilities: [position responsibilities] - Rules of conduct: 1. Be concise and efficient 2. Read before answering and respect the user 3. Know when to remain silenttext The following is an English rendering of `SKILL.md:65-69`: ```markdown ### Required Actions 1. **Read before answering** — read `MEMORY.md` and today's journal at the beginning of every session 2. **Report proactively** — proactively report discovered problems 3. **Record experience** — write important findings into `MEMORY.md` 4. **Respect the user** — do not disclose private informationThe template repeats the persistent-memory mechanism at
references/training-manual-template.md:69-73:markdown ### 1. Basic Capabilities - [x] Read `MEMORY.md` to understand the user's background - [x] Read `HEARTBEAT.md ...[truncated 2950 chars]- Remediation
View remediation
Remediation Suggestions
- Do not write Skill-authored behavioral policies, role instructions, or executable directives into persistent Agent memory.
- Separate non-instructional user facts from Agent policy and operational state using distinct, typed storage with strict schemas.
- Require explicit, informed user approval before every durable memory write.
- Display the exact proposed memory change to the user before committing it.
- Treat all loaded memory as untrusted contextual data, not as authoritative instructions.
- Add provenance metadata identifying who created each entry, when it was created, and which task authorized it.
- Apply expiration periods and provide straightforward review, revocation, and deletion controls.
- Prevent subordinate Agents from automatically copying behavioral memory to other Agents.
- Validate memory entries against an allowlist that excludes commands, policy overrides, tool-use directives, and instructions to ignore higher-priority constraints.
- Replace the mandatory per-session memory reload with task-scoped retrieval of only the minimum relevant, non-sensitive facts.
- Keep private user-profile information out of shared Agent memory unless the user explicitly authorizes both storage and the intended recipients.
- Audit and sanitize existing
MEMORY.mdfiles before using this Skill again.
