T02 · Agent Memory Poisoning
- Location
src/capture.ts:8- Finding
Persistent Agent Memory Poisoning Through Untrusted LLM Prompt Content
- Content
View full analysis
- Be brief and specific. Do NOT include commentary, headers, or explanations outside the bullet list.`; } ``` ```ts const prompt = buildCapturePrompt(conversationText); const result = await callCaptureLlm(prompt, config, api, agentId); const trimmed = result.trim(); if (!trimmed || trimmed === "NOTHING" || !trimmed.startsWith("-")) { return false; } const date = new Date().toISOString().split("T")[0]; const entry = `\n## [${date}] Captured\n${trimmed}\n`; const stagingPath = join(workspaceDir, STAGING_FILE); await mkdir(workspaceDir, { recursive: true }); let existing = ""; try { existing = await readFile(stagingPath, "utf-8"); } catch { // File doesn't exist yet — start fresh } await writeFile(stagingPath, existing + entry, "utf-8"); ``` ...[truncated 3985 chars]- Remediation
View remediation
