T02 · Agent Memory Poisoning
- Location
SKILL.md:49- Finding
Automatic Poisoning of Persistent Memory and Behavioral Instructions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 49–76
Vulnerability Type: Persistent memory and behavioral instruction poisoning
Risk Level: HighVulnerable Code
markdown | Pattern Type | Action | Target File | |-------------|--------|-------------| | Repeated error | Add prevention rule | relevant skill's `## Learned` section | | Repeated correction | Update behavior guideline | `SOUL.md` or `AGENTS.md` | | Emerging thesis | Write thesis + next steps | `OUTSTANDING.md` | | Stale knowledge | Update the fact | `memory/permanent/*.md` | | Unused win | Create ticket or reminder | `NEXT_TICKET.md` or cron | ## Step 3: APPLY - **Low risk + reversible**: Apply immediately. Log the change. - **Medium risk**: Apply but notify user on next interaction. - **High risk**: Write to `OUTSTANDING.md` and wait for approval. - **Dry-run mode** (`--dry-run`): Propose all changes but apply none. Output a report. Use 3-occurrence threshold before proposing pattern-based changes. Track recurrence with `Pattern-Key` and `Recurrence-Count`. ## Error→Skill Feedback Loop After SCAN, for each error in ERRORS.md: 1. Extract the `Context` column value 2. Match against skill names (fuzzy: "SiteBlitz CSS" → `webdev-sop`) 3. If match found and skill doesn't already have the fix in `## Learned`: ```markdown ## Learned - [date] [error summary] → [fix]. Source: .learnings/ERRORS.md#L[N] ``` 4. Use `Pattern-Key: hash(error+fix)` to prevent duplicates Skills self-heal: every failure improves the relevant skill.Technical Analysis
The Skill instructs the agent to derive behavioral rules from logs and then automatically write those rules into persistent, instruction-bearing resources. Explicit write targets include
SOUL.md,AGENTS.md, other Skills, and files undermemory/permanent/.The source files being analyzed—such as learning logs, error records, batch outcomes, an ...[truncated 2608 chars]
- Remediation
View remediation
Remediation Suggestions
- Require explicit user approval before every modification to
SOUL.md,AGENTS.md, permanent memory, other Skills, routing protocols, or scheduled-task definitions. - Make dry-run behavior the mandatory default. Generate a reviewable proposal or patch instead of directly editing persistent files.
- Treat all log, memory, batch-output, and error-record content as untrusted data. Do not interpret imperative text from these sources as executable agent instructions.
- Restrict automatic writes to a dedicated, non-executable proposal file that is never loaded as an instruction source.
- Define a strict writable-path allowlist and explicitly deny autonomous writes to behavioral control files and other Skills.
- Validate provenance before proposing a rule. Repetition alone must not be considered evidence of trustworthiness.
- Add semantic validation that rejects changes attempting to alter safety constraints, permissions, tool policies, instruction precedence, approval requirements, or data-access boundaries.
- Show the user the exact source evidence and complete proposed diff before requesting approval.
- Maintain an append-only audit trail containing the source, proposer, approver, timestamp, target, and exact diff for every accepted change.
- Implement atomic rollback and version control for all persistent modifications.
- Require separate, explicit authorization before creating cron entries, reminders, tickets with executable content, or any other cross-session automation.
- Require explicit user approval before every modification to
