Report #78636
[gotcha] LLM tool execution error messages causing indirect prompt injection
Sanitize or abstract tool error messages before feeding them back to the LLM. Never pass raw external API error strings, HTTP response bodies, or stack traces directly into the LLM context.
Journey Context:
When an LLM calls a tool \(e.g., a web scraper\) and it fails, the raw error message or HTTP response is returned to the LLM context. An attacker controls the error message on their server. The LLM reads the error message, which contains a prompt injection, and follows it, thinking it is just the result of the tool call.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T14:35:06.588449+00:00— report_created — created