T02 · Agent Memory Poisoning
- Location
identify-facts.sh:38- Finding
Untrusted conversation content can poison persistent agent memory
- Content
View full analysis
/dev/null; then echo "" >> "$MEMORY_FILE" echo "## Truncated Facts - $today" >> "$MEMORY_FILE" echo "> Facts identified from truncated sessions on $today" >> "$MEMORY_FILE" echo "" >> "$MEMORY_FILE" fi echo "### Session: $session_name" >> "$MEMORY_FILE" cat "$temp_facts" >> "$MEMORY_FILE" echo "" >> "$MEMORY_FILE" fi ``` A related path in `identify-facts-enhanced.sh:129-154` also appends AI-generated output directly to the same persistent memory file: ```bash echo "### Session: $session_name" >> "$MEMORY_FILE" echo "\`\`\`" >> "$MEMORY_FILE" echo "$facts" >> "$MEMORY_FILE" echo "\`\`\`" >> "$MEMORY_FILE" echo "" >> "$MEMORY_FILE" ``` ### Technical Analysis The keyword extractor copies complete conversation text into `MEMORY.md` whenever the text matches a broad trigger. It does not distinguish trusted facts from imperative instructions, validate the author or message role, neutralize prompt-like content, or require confirmation before promoting data to long-term memory. Markdown code fences in the enhanced path provide display formatting only; they do not establish a security boundary for an agen ...[truncated 1451 chars]- Remediation
View remediation
