T02 · Agent Memory Poisoning
- Location
SKILL.md:50- Finding
Persistent Agent-State Poisoning and Unreviewed Skill Self-Modification
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 50-72
Vulnerability Type: Persistent memory poisoning through caller-influenced observations and preferences
Risk Level: HighComplete Relevant Instruction Snippet
The following is an English rendering of the complete relevant instruction block:
markdown This skill includes the general learning module `scripts/learner.py`. After each evaluation, it automatically performs a retrospective and accumulates experience. ### Memory file `learned_patterns.json` records: total operations, frequency of principle matches, boundary-violation types, user preferences, and improvement suggestions. ### Invoke after use python scripts/learner.py record <skill-directory> --capability harmless python scripts/learner.py record <skill-directory> --capability harmless \ --fail --error boundary-block --note "bomb-making tutorial" python scripts/learner.py prefer <skill-directory> --key publication-threshold --val 0.6 python scripts/learner.py insight <skill-directory> python scripts/learner.py reflect <skill-directory> ### Iteration rules - When boundary blocks reach at least three, extend `HARM_PATTERNS` and write the change back to this `SKILL.md`. - When operations reach at least ten, analyze and refine frequently failing rules. - Write important user preferences to `learned_patterns.json` and apply them directly on the next invocation.Technical Analysis
The skill directs the Agent to convert task-derived failures, notes, and user preferences into persistent state. It further directs later executions to apply stored preferences automatically and instructs the Agent to rewrite its own governing
SKILL.mdafter a threshold is reached.This creates a trust-boundary violation between untrusted task input and durable Agent policy. The design provides no schema restricting what may be stored as a prefe ...[truncated 1800 chars]
- Remediation
View remediation
Remediation Suggestions
- Prohibit automatic modification of
SKILL.mdand other governing instruction files. - Require explicit, informed user or administrator approval before persisting any preference or promoting an observation into policy.
- Store observations separately from trusted configuration and never interpret free-form notes as instructions.
- Define a strict preference schema with allowlisted keys, typed values, length limits, and validation rules.
- Record provenance, creator identity, creation time, scope, and expiration for every durable entry.
- Scope state per user or tenant to prevent one caller from affecting unrelated sessions.
- Add integrity protection and restrictive filesystem permissions to persistent state.
- Require human review and signed updates for any change to safety patterns or skill instructions.
- Treat all task-derived text as untrusted data and prevent it from being interpolated into prompts as authoritative instructions.
- Provide a mechanism to inspect, revoke, and reset learned state safely.
- Prohibit automatic modification of
