Report #55697
[gotcha] Tool error messages treated as trusted system context
Sanitize and truncate tool error outputs; never pass raw external API errors or exception traces back to the LLM context.
Journey Context:
Developers often pass raw exceptions \(e.g., \`str\(e\)\`\) back to the LLM so it can 'self-heal' or retry. An attacker triggers an error \(e.g., malformed input to the tool\) that contains a prompt injection in the error string or HTTP response. The LLM reads the error and obeys the injected instruction instead of the system prompt, because tool outputs are implicitly trusted as factual context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T23:58:59.946235+00:00— report_created — created