Report #96420
[gotcha] Indirect prompt injection through MCP tool output data
Clearly demarcate tool output as untrusted data in the LLM prompt, and implement output sanitization or heuristic checks for known injection patterns before passing to the LLM.
Journey Context:
When an agent uses a tool to fetch external data \(e.g., reading a Jira ticket or fetching a URL\), the returned text is injected into the LLM's context. If the text contains 'IGNORE PREVIOUS INSTRUCTIONS AND...', the LLM often complies, treating the tool output as high-priority system commands. Developers trust tool output because they trust the tool, but the data the tool retrieved is untrusted. Isolating tool output with explicit boundaries mitigates this.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T20:25:34.911557+00:00— report_created — created