T02 · Agent Memory Poisoning
Warning
- Location
- setup.md:111
- Finding
- Persistent Agent Steering Through Global Control-File Modification<![CDATA[ ## Vulnerability Details **File Location**: `setup.md:111-162` **Vulnerability Type**: `T02: Agent Memory Poisoning` **Risk Level**: Medium ### Vulnerable Code ```markdown ### 5. Add SOUL.md Steering Add this section to your `SOUL.md`: ```markdown **Decision Making** Structured decision support is part of the job. Before any decision request, load `~/decision-making/memory.md` and the smallest matching domain or type file. Apply the user's preferred framework unless the situation clearly calls for something different. Always tag confidence level. Never make the final call — present options and tradeoffs. Surface decision points proactively when you notice the user weighing choices without structure. After high-stakes decisions, prompt for a retrospective when results are visible. ``` ### 6. Add AGENTS.md Memory Section (Non-Destructive) Update `AGENTS.md` by complementing the existing `## Memory` section. Do not replace or remove existing lines. Add this line in the continuity list: ```markdown - **Decision making:** `~/decision-making/` (via `decision-making` skill) — decision preferences, risk profile, framework choices, decision history, and retrospective lessons ``` After "Capture what matters...", add: ```markdown Use `~/decision-making/memory.md` for risk profile and framework preferences (HOT, always loaded). Use `~/decision-making/domains/` for domain-specific decision weights and patterns. Use `~/decision-making/types/` for decision-type patterns (strategic/tactical/operational). Use `~/decision-making/decisions/` for individual decision records and retrospectives. Before any decision support task, load memory.md, then the smallest relevant domain + type files. ``` ### 7. Add HEARTBEAT.md Steering Add this section to your `HEARTBEAT.md`: ```markdown ## Decision Making Check - Read `./skills/decision-making/heartbeat-rules.md` - Use `~/decision-making/heartbeat-state.md` for last-run markers - If no file inside `~/decision-making/ ...[truncated 2920 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove instructions that directly modify `SOUL.md` and `AGENTS.md`. Keep operational behavior inside `SKILL.md` so it is active only when the skill is deliberately loaded. 2. Make heartbeat integration disabled by default and expose it as a separate, explicit opt-in feature. 3. Before changing any global control file: - Display the exact target path and proposed patch. - Explain the resulting cross-session behavior. - Obtain explicit user confirmation for each file. - Create a backup or reversible patch record. 4. Scope all mutable state to `~/decision-making/`; do not place skill-owned behavioral rules in general agent memory. 5. Add an uninstall procedure that removes every inserted block from `SOUL.md`, `AGENTS.md`, and `HEARTBEAT.md` without affecting unrelated content. 6. Mark inserted sections with stable start and end delimiters so they can be audited and removed safely. 7. Require explicit confirmation before proactive prompts, recurring maintenance, compaction, or archival operations are enabled. 8. Validate that loaded memory is treated as user data rather than higher-priority instructions, preventing stored content from overriding system or safety constraints. ]]>
