T02 · Agent Memory Poisoning
- Location
hooks/openclaw/handler.js:8- Finding
Persistent poisoning of agent behavior and long-term state through promoted learnings
- Content
View full analysis
{ // Safety checks for event structure if (!event || typeof event !== 'object') { return; } // Only handle agent:bootstrap events if (event.type !== 'agent' || event.action !== 'bootstrap') { return; } // Safety check for context if (!event.context || typeof event.context !== 'object') { return; } // Inject the reminder as a virtual bootstrap file // Check that bootstrapFiles is an array before pushing if (Array.isArray(event.context.bootstrapFiles)) { event.context.bootstrapFiles.push({ path: 'SELF_IMPROVEMENT_REMINDER.md', content: REMINDER_CONTENT, virtual: true, }); } }; ``` ### Technical Analysis The bootstrap hook injects standing instructions that encourage the agent to capture information originating from user corrections, failures, and observed workflows, and then promote that information into `SOUL.md`, `AGENTS.md`, and `TOOLS.md`. The main skill also identifies `MEMORY.md` and newly generated skil ...[truncated 1654 chars]- Remediation
View remediation
