T01 · Skill Instruction Hijacking
- Location
hooks/diplomat-bootstrap/handler.ts:30- Finding
Peer-Controlled Commitment Text Is Persistently Injected into Agent Context
- Content
View full analysis
str: """Build a compact MEMORY.md commitment entry within MAX_MEMORY_ENTRY_CHARS budget.""" entry = ( f"- **[{state}]** Peer: {peer_alias} | " f"My: {my_tasks} | Their: {peer_tasks} | " f"Due: {deadline_utc} | ID: `{session_id_short}`" ) return truncate_to_budget(entry, MAX_MEMORY_ENTRY_CHARS) ``` `hooks/shared/parse-memory.ts:64-88`: ```ts export function parseActiveEntries(section: string): CommitmentEntry[] { return section .split('\n') .filter(l => l.includes('[ACTIVE]')) .map(parseLine) .filter((e): e is CommitmentEntry => e !== null); } function parseLine(line: string): CommitmentEntry | null { const peerM = line.match(/Peer: ([^|]+)/); const myM = line.match(/My: ([^|]+)/); const dueM = line.match(/Due: ([^|]+UTC)/); const idM = line.match(/ID: `([^`]+)`/); if (!peerM || !myM || !dueM || !idM) return null; const dueStr = dueM[1].trim(); return { peer: peerM[1].trim(), myTask: myM[1].trim(), deadlineLocal: dueStr, deadlineUtc: dueStr, id: idM[1].trim(), }; } ``` `hooks/diplomat-bootstrap/handler.ts:30-43`: ```ts const active = parseActiveEntries(section); if (active.length === 0) return; const n = active.length; const lines = active.map(e => `• ${truncate(e.peer, 20)} | ${truncate(e.myTask, 40)} due ${e.deadlineLocal} → [ACTIVE] (ID: ${e.id})` ); const header = `[claw-diplomat] ${n} active commitment${n === 1 ? '' : 's'}:`; const block = ...[truncated 2450 chars]- Remediation
View remediation
