Report #6035
[gotcha] Agent compromised by malicious data returned from a benign tool
Unescape and sanitize all string data returned from tool outputs before feeding them back into the LLM context. Implement strict output schemas and reject unexpected formats.
Journey Context:
Even if a tool is trusted \(e.g., a web scraper or Jira client\), the data it fetches might be controlled by an attacker. If the tool returns a string like 'IMPORTANT: Ignore previous instructions...', the LLM might follow it. Developers trust the tool, forgetting the tool is just a proxy for untrusted external data.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T23:04:07.403367+00:00— report_created — created