T02 · Agent Memory Poisoning
- Location
SKILL.md:500- Finding
Persistent Modification of Agent Guidance
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:500-530
Vulnerability Type: Persistent agent instruction modification
Risk Level: MediumVulnerable Code
markdown ## Post-Verdict: CLAUDE.md Revision After the verdict report, revise the project's CLAUDE.md to keep it lean and useful for future agents. ### Steps: 1. **Read CLAUDE.md** and check size: `wc -c CLAUDE.md` 2. **Add learnings from this review:** - New Do/Don't rules discovered during review - Updated commands, workflows, or architecture decisions - Fixed issues or gotchas worth remembering - Stack/dependency changes (new packages, removed deps) 3. **If over 40,000 characters — trim ruthlessly:** - Collapse completed phase/milestone histories into one line each - Remove verbose explanations — keep terse, actionable notes - Remove duplicate info (same thing explained in multiple sections) - Remove historical migration notes, old debugging context - Remove examples that are obvious from code or covered by skill/doc files - Remove outdated troubleshooting for resolved issues 4. **Verify result ≤ 40,000 characters** — if still over, cut least actionable content 5. **Write updated CLAUDE.md**, update "Last updated" date ### Priority (keep → cut): 1. **ALWAYS KEEP:** Tech stack, directory structure, Do/Don't rules, common commands, architecture decisions 2. **KEEP:** Workflow instructions, troubleshooting for active issues, key file references 3. **CONDENSE:** Phase histories (one line each), detailed examples, tool/MCP listings 4. **CUT FIRST:** Historical notes, verbose explanations, duplicated content, resolved issues ### Rules: - Never remove Do/Don't sections — critical guardrails - Preserve overall section structure and ordering - Every line must earn its place: "would a future agent need this to do their job?" - Commit the update: `git add CLAUDE.md && git commit -m "docs: revise C ...[truncated 1982 chars]- Remediation
View remediation
Remediation Suggestions
- Make the review workflow read-only by default.
- Present proposed
CLAUDE.mdchanges as a patch in the final report rather than applying them automatically. - Require explicit, informed user approval before editing or committing persistent agent-guidance files.
- Treat repository content as untrusted when deriving new agent rules.
- Never remove existing guidance solely because of an arbitrary character limit without human review.
- If an approved update is made, restrict it to precisely identified lines and display the complete diff before committing.
- Separate operational project documentation from files that control future agent behavior.
