T02 · Agent Memory Poisoning
- Location
SKILL.md:165- Finding
Untrusted Conversation Content Can Be Promoted into Persistent Agent Instructions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 165–190, 306–312, and 488–543
Vulnerability Type: Persistent agent memory poisoning through instruction-file promotion
Risk Level: HighVulnerable Code Snippets
SKILL.md, lines 165–190:markdown ### Promotion Targets | Target | What Belongs There | |--------|-------------------| | `CLAUDE.md` | Project facts, conventions, gotchas for all Claude interactions | | `AGENTS.md` | Agent-specific workflows, tool usage patterns, automation rules | | `.github/copilot-instructions.md` | Project context and conventions for GitHub Copilot | | `SOUL.md` | Behavioral guidelines, communication style, principles (bot) | | `TOOLS.md` | Tool capabilities, usage patterns, integration gotchas (bot) | ### How to Promote 1. **Distill** the learning into a concise rule or fact 2. **Add** to appropriate section in target file (create file if needed) 3. **Update** original entry: - Change `**Status**: pending` → `**Status**: promoted` - Add `**Promoted**: CLAUDE.md`, `AGENTS.md`, or `.github/copilot-instructions.md`SKILL.md, lines 306–312:markdown ## Best Practices 1. **Log immediately** - context is freshest right after the issue 2. **Be specific** - future agents need to understand quickly 3. **Include reproduction steps** - especially for errors 4. **Link related files** - makes fixes easier 5. **Suggest concrete fixes** - not just "investigate" 6. **Use consistent categories** - enables filtering 7. **Promote aggressively** - if in doubt, add to CLAUDE.md or .github/copilot-instructions.md 8. **Review regularly** - stale learnings lose valueSKILL.md, lines 488–492:markdown **Activation**: Workspace injection + inter-agent messaging **Setup**: Configure workspace path in `~/.bot/bot.json` **Detection**: Via session tools and workspace files (`AGENTS.md`, `SOUL.md`, `TOOLS.md`) Bot uses a wo ...[truncated 3524 chars]- Remediation
View remediation
Remediation Suggestions
- Remove the “promote aggressively” directive and make persistent promotion deny-by-default.
- Require explicit, informed user approval for every modification to an instruction-bearing file.
- Present the exact destination path and proposed diff before writing, and require separate confirmation after review.
- Restrict promotion to verified project facts and conventions. Prohibit promotion of content that changes safety policy, authorization boundaries, tool permissions, command-execution rules, identity, or behavioral constraints.
- Track provenance for every learning, including the originating user, conversation, trust level, and verification evidence.
- Treat conversation text, error output, external documentation, and session transcripts as untrusted data. Do not preserve embedded imperative instructions as executable agent policy.
- Add a review state between
pendingandpromoted; only a trusted human maintainer should be able to approve promotion. - Limit writes to project-local learning records by default. Disallow automatic writes to global workspace files, home-directory configuration, and cross-project agent memory.
- Disable cross-session transcript access and inter-agent forwarding unless specifically required and separately authorized for the current task.
- Add automated checks that reject instruction-file changes containing permission escalation, safety bypasses, secret-disclosure directives, unreviewed commands, or external payload references.
