T02 · Agent Memory Poisoning
- Location
scripts/setup.py:108- Finding
Persistent Modification of Global Agent Instructions
- Content
View full analysis
bool: """Merge the dream section into HEARTBEAT.md. Returns True if modified.""" target = workspace / "HEARTBEAT.md" section = HEARTBEAT_SECTION.read_text() if target.exists(): existing = target.read_text() if DREAM_MARKER in existing: info("HEARTBEAT.md already contains dream section — skipping") return True backup(target) merged = existing.rstrip() + "\n\n" + section.strip() + "\n" target.write_text(merged) info("Merged dream section into existing HEARTBEAT.md") else: header = "# Heartbeat checklist\n\n" daytime = ( "## Daytime (06:00-23:00)\n" "- Quick scan: anything urgent in reminders, calendar, or inboxes?\n" "- If nothing urgent, reply HEARTBEAT_OK.\n\n" ) target.write_text(header + daytime + section.strip() + "\n") info("Created HEARTBEAT.md with dream section") return True def merge_soul(workspace: Path) -> bool: """Merge the dream persona fragment into SOUL.md. Returns True if modified.""" target = workspace / "SOUL.md" fragment = SOUL_FRAGMENT.read_text() if target.exists(): existing = target.read_text() if DREAM_MARKER in existing: info("SOUL.md already contains dream persona — skipping") return True backup(target) merged = existing.rstrip() + "\n\n" + fragment.strip() + "\n" target.write_text(merged) info("Merged dream persona fragment into existing SOUL.md") else: target.write_text(fragment.strip() + "\n") info("Created SO ...[truncated 2447 chars]- Remediation
View remediation
