T02 · Agent Memory Poisoning
- Location
scripts/heartbeat-check.sh:47- Finding
Unauthenticated Cross-Session Content Can Poison Persistent Agent Memory
- Content
View full analysis
> "$TODAY_FILE" echo "## $(date '+%H:%M') -- Cron Inbox Processing" >> "$TODAY_FILE" # Copy FULL entries (header + body), not just headers # Extract everything from each ## [ line to the next ## [ or EOF awk ' /^## \[/ { if (buffer != "") { print buffer print "" } buffer = $0 next } buffer != "" { buffer = buffer "\n" $0 } END { if (buffer != "") print buffer } ' "$INBOX_FILE" >> "$TODAY_FILE" log "Appended inbox entries to daily notes" # Clear inbox (keep header) HEADER="# Cron Inbox\n\nCross-session message bus.\n\n---\n\n*Last processed: $(date '+%Y-%m-%d %H:%M')*\n" printf "%b" "$HEADER" > "$INBOX_FILE" log "Cleared cron inbox" else log "Inbox is empty" fi ``` The subsequent promotion into long-term memory occurs in `scripts/memory-extract.sh:50-92`: ```bash SIGNIFICANCE_KEYWORDS="decided|decision|lesson learned|important|breakthrough|milestone|completed|shipped|launched|fixed|solved|agreed|confirmed|approved|rejected|failed|error|new project|started|created|deployed|published" # Find entries (lines starting with ## HH:MM) ENTRIES=$(grep -n "^## [0-9]\{2\}:[0-9]\{2\} --" "$TODAY_FILE" || true) ...[truncated 3445 chars]- Remediation
View remediation
