T02 · Agent Memory Poisoning
- Location
SKILL.md:249- Finding
Persistent Instruction Poisoning Through Shared Agent-Controlled State
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 249–279 and 320–329
Vulnerability Type: Persistent memory poisoning and unsafe trust of shared agent state
Risk Level: MediumVulnerable Instructions
markdown ## Orchestrator: Handoff Protocol When Agent A's output feeds into Agent B's input: 1. Agent A completes its task and writes output to a shared handoff file: `workspace/handoffs/[AGENT_A]-to-[AGENT_B]-YYYY-MM-DD.md` 2. Agent A updates its L0.md line 3: "Handed off [deliverable] to [AGENT_B]." 3. Orchestrator reads Agent A's L0, confirms handoff file exists. 4. Orchestrator triggers Agent B with: - Pointer to the handoff file - Context: what Agent A produced and why - Expected output format 5. Agent B reads the handoff file, executes its task, writes output. 6. Agent B updates its L0.md and L1.md as normal. Rules: - Handoff files are write-once. Agent B never modifies Agent A's output. - Handoff files older than 7 days can be archived to handoffs/archive/. - If the handoff file is missing or malformed, Agent B stops and flags the orchestrator.markdown Create `workspace/lessons.md` in your main workspace. Any agent (or human) can append to it.markdown ## Monthly Audit Checklist Run this on the 1st of every month: 1. Score every agent using the 8-point rubric. Record in scorecards/. 2. Review lessons.md — are the same mistakes repeating? If yes, the fix was insufficient. 3. Review patterns.md — are proven patterns actually being used? If not, add them to SOUL.md workflows. 4. Check L0/L1 freshness — any agent with "Last run" older than 14 days is either unused or broken. 5. Check SOUL.md sizes — any over 400 lines needs externalization. 6. Archive old handoff files (> 7 days) and resolved blockers. 7. Update the orchestrator's agent roster with any new or retired agents. Output: One-page swarm health report for the human ...[truncated 2630 chars]- Remediation
View remediation
Remediation Suggestions
- Treat all agent-generated handoffs, lessons, patterns, and memory files as untrusted data rather than authoritative instructions.
- Enforce per-agent access controls so each agent can write only to explicitly assigned files and cannot modify another agent's memory or instruction files.
- Add authenticated provenance to shared entries, including the originating agent, creation time, task identifier, and an integrity signature or trusted audit record.
- Validate handoffs against strict schemas containing only expected data fields. Reject content containing role changes, tool directives, permission requests, or instructions unrelated to the declared deliverable.
- Explicitly instruct consuming agents not to follow instructions found inside handoff payloads. Handoff contents should be processed solely as task data.
- Require human review for every modification to
SOUL.md. Present a complete diff, source attribution, security review result, and rollback point before applying a change. - Prohibit direct automated promotion from
lessons.md,patterns.md, handoffs, or other agent-writable files into persistent instruction files. - Keep versioned, append-only audit logs and backups for shared state and
SOUL.mdso poisoned changes can be identified and rolled back. - Add size, format, and content limits to shared files, and quarantine malformed or instruction-like entries instead of passing them to downstream agents.
- Test the workflow with prompt-injection payloads to verify that orchestrators and downstream agents maintain instruction hierarchy and do not execute directives embedded in shared data.
