T02 · Agent Memory Poisoning
- Location
SKILL.md:16- Finding
Persistent Instruction Propagation Through HANDOFF.md
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:16-43,SKILL.md:46-68, andreferences/template.md:8-15,42-46
Vulnerability Type: Persistent agent-state poisoning
Risk Level: MediumEvidence
SKILL.md:16-43defines a persistent handoff file containing identity and behavioral instructions:markdown Write `HANDOFF.md` to the workspace root with these sections: ```markdown # HANDOFF.md — Model Switch Context ## Who you are [Agent name, persona, tone, key behavioral rules. Reference SOUL.md if present.] ## Who you're helping [User name, role, location, preferences. Reference USER.md and MEMORY.md if present.] ## Active projects [For each project: name, status, key files, next steps. Be specific — include file paths.] ## Agent roster [If multi-agent: list agent IDs, models, roles.] ## Key credentials & tools [Point to credential files — never inline secrets. e.g. "Azure SP creds: azure-config.json"] ## Behavioral rules [Critical rules a new model must follow. Keep to essentials only.] ## How to keep this file current [Brief note on when to update.] ## Last updated [Timestamp + 1-line session summary]text `SKILL.md:46-68` directs the agent to update this state proactively and make future models load it: ```markdown ## When to Create/Update **Create** `HANDOFF.md` when: - User asks about switching models - User asks how to preserve context - `HANDOFF.md` does not yet exist **Update** `HANDOFF.md` when: - User says "switching to [model]" — update immediately before they go - User says "update HANDOFF" or "log everything" - A significant project milestone is reached (new project started, major decision made, new agent added) - The session has been running for several hours with significant new context **Keep current proactively** — do not wait to be asked. Update during long sessions when meaningful things happen. ## Wiring HANDOFF.md into ...[truncated 3140 chars]- Remediation
View remediation
Remediation Suggestions
- Require explicit user confirmation before creating or updating
HANDOFF.md, especially before persisting persona or behavioral directives. - Do not modify
AGENTS.mdautomatically. Present the proposed change and require approval. - Treat all handoff content as untrusted informational context rather than authoritative instructions.
- Add an explicit rule prohibiting persistence of instructions that alter safety constraints, permissions, tool policies, system roles, or instruction precedence.
- Persist factual task state separately from behavioral preferences; omit the
Behavioral rulessection unless the user explicitly supplies and approves its contents. - Record provenance for every persisted directive, including its source and approval status.
- Display a complete diff before writing either
HANDOFF.mdorAGENTS.md. - Instruct receiving models to validate handoff content against current system, developer, and user instructions before acting on it.
- Use a strict schema with an allowlist of safe fields rather than copying free-form session text.
- Require explicit user confirmation before creating or updating
