T02 · Agent Memory Poisoning
- Location
SKILL.md:228- Finding
Automatic Propagation of Task-Derived Lessons into Persistent Agent State
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 228–243
Vulnerability Type: Persistent memory and configuration poisoning
Risk Level: HighVulnerable Code
markdown **Category Tags:** | Category | Meaning | Action | |----------|---------|--------| | `coding-pattern` | Code pattern improvement | Auto-apply on next coding task | | `info-source` | Information source improvement | Update monitor source priority | | `workflow` | Workflow optimization | Update engineering lifecycle gates | | `tool-usage` | Tool usage skill | Efficiency sequence | | `domain-knowledge` | Domain knowledge accumulation | Long-term memory | **Auto-Propagation:** - If `coding-pattern` → write to `~/.agent-templates/` - If `info-source` → update monitor config - If `workflow` → check if engineering lifecycle needs update - If lesson verified ≥3 times → promote to `verified-best-practice`Related propagation behavior also appears at
SKILL.md, lines 296–301:markdown ### Engineering Lifecycle - Phase 2 hypothesis = engineering **improvement proposal** - Phase 3 experiment = **verification phase** - Successful experiments auto-update lifecycle best practicesTechnical Analysis
The skill instructs the agent to transform task-derived observations into persistent templates, monitoring configuration, long-term memory, and lifecycle best practices. These changes are explicitly intended to be applied automatically to future tasks.
Task outputs and logs may contain untrusted user content, incorrect conclusions, prompt-injection material, or adversarial examples. The documented workflow does not establish a trust boundary between this input and persistent agent policy. It also does not require human approval, semantic sanitization, per-project isolation, provenance-based access controls, or rollback before propagation.
Repeating or manipulating an experiment may cause an attacker-influence ...[truncated 1648 chars]
- Remediation
View remediation
Remediation Suggestions
- Place all generated lessons in a non-executable, isolated review queue rather than directly modifying templates or configuration.
- Require explicit, informed user or administrator approval for every cross-session state change.
- Never treat task-derived free-form text as agent policy, executable instructions, or trusted configuration.
- Enforce a strict schema with field length limits, allowed-value lists, canonicalization, and rejection of embedded instructions.
- Attach immutable provenance to each lesson, including the originating task, input trust level, experiment data, reviewer, and approval time.
- Scope approved lessons to the originating project by default; prohibit writes to global home-directory templates unless separately authorized.
- Replace automatic promotion with independent review and reproducible validation against trusted test data.
- Add expiration, versioning, audit logs, conflict detection, and one-step rollback for every persisted lesson.
- Separate descriptive learning records from configuration capable of changing agent behavior.
- Apply least-privilege controls so the skill cannot directly write monitor or lifecycle configuration.
