T02 · Agent Memory Poisoning
- Location
SKILL.md:130- Finding
Conversation-Derived Rules Can Poison Persistent Agent Instructions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is openly a self-improvement tool, but it can persistently change agent instructions and create skills from conversation-derived content, so users should review it carefully before installing.
Install only if you specifically want a skill that can turn session feedback into persistent agent behavior. Before approving any proposed change, inspect the exact source quote, target path, and diff; avoid approving global ~/.claude changes or new skill creation unless you deliberately want that behavior across future sessions.
SKILL.md:130Conversation-Derived Rules Can Poison Persistent Agent Instructions
SKILL.md:13Unrestricted Shell and Broad Filesystem Permissions Exceed the Skill’s Core Requirements
The trigger phrase includes very generic natural-language commands like "reflect" and "review session," which can be invoked accidentally during ordinary conversation rather than as an intentional administrative action. In this skill's context, unintended invocation is more concerning because the feature analyzes prior conversations and proposes persistent agent-definition changes, so a mistaken trigger could initiate sensitive self-modification workflows or surface session content unexpectedly.
The trigger phrase 'review session' overlaps semantically with built-in 'review' workflows and may be invoked unintentionally when a user asks for a session review. Because this skill can write persistent state and potentially modify instructions, command shadowing raises the risk of activating a more privileged, stateful behavior than the user intended.
The trigger list includes broad natural-language phrases such as 'what did I learn' and 'analyze corrections' that can plausibly appear in ordinary conversation. Because this skill has write/edit capabilities and is designed to persist changes, accidental activation could cause unsolicited analysis or preparation of persistent modifications.
The skill is granted Write, Edit, and Bash, and its metadata configures a persistent state directory under '~/.reflect'. This combination gives the skill both the means and the stated intent to store state and alter files across sessions, creating durable behavioral changes and increasing the blast radius of accidental or unsafe invocation.
- analyze corrections
allowed-tools:
- Read
- Write
- Edit
- Grep
- Glob
The usage guidance says to use the skill 'after completing complex tasks' and 'at session boundaries,' which broadens activation beyond clear user commands. In a self-modifying skill with persistent storage and edit permissions, ambiguous activation conditions increase the chance of unintended reflection runs and collection of conversation content for persistence.
The documented output locations include versioned project reflections, new skills under '.claude/skills/{name}/SKILL.md', and global learning logs in the user's home directory. Even with stated guardrails, this is an explicit persistence mechanism that can propagate learned instructions into future sessions and projects, making mistakes or poisoned learnings durable.
### Incremental Updates
- ONLY add to existing sections
- NEVER delete or rewrite existing rules
- Preserve original structure
### Conflict Detection
The troubleshooting guidance explicitly allows creating missing agent files, which expands the skill from updating known targets to generating new persistent instruction files. In context, this is a self-improvement skill intended to encode learnings permanently, so the ability to create agent files materially increases persistence and the risk of unauthorized long-term behavior changes.
**Agent file not found:**
- Check agent name spelling
- May need to create agent file first
The file explicitly instructs the system to permanently encode new learnings into agent definitions and even create new sections when none match. In a reflection skill, this creates durable prompt/state persistence: adversarial or low-quality session content could be transformed into long-lived agent instructions, causing prompt injection persistence and policy drift across future sessions.
1. Most specific matching section (e.g., "Security" for security rules)
2. Generic "Heuristics" section
3. "Guidelines" or "Rules" section
4. Create new section if none match
### Addition Format
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
**Category**: New Skill
**Mapping**:
- Create: `.claude/skills/react-hydration-mismatch-fix/SKILL.md`
- Include: Error message, symptoms, step-by-step fix, verification
The documented detection rules rely on very broad lexical triggers such as "always," "must," "good," and "nice" with limited scoping or disambiguation requirements. In a self-improvement skill that permanently encodes learnings into agent definitions, this can cause ordinary conversational language to be misclassified as durable rules or approvals, leading to prompt/data poisoning of the agent's long-term behavior.
The manifest explicitly advertises 'Encodes learnings permanently into agent definitions for continuous improvement across all future sessions' without a strong warning or explicit consent boundary. Persistent modification of agent definitions is high risk because a mistaken reflection, prompt injection captured as a 'learning', or accidental invocation can silently alter future behavior beyond the current session.
The trigger phrases are generic conversational language such as 'reflect' and 'review session', which can be invoked unintentionally during normal interaction. In a meta-skill that can analyze sessions and drive persistent agent changes, accidental activation expands the chance of unauthorized or surprising behavior.
No suspicious patterns detected.