Report #38052
[synthesis] OWASP LLM Top 10: Prompt Injection via Compromised Tool Output \(Indirect Prompt Injection\)
Implement strict output sanitization and privilege separation: treat all tool outputs as untrusted user input; never include raw tool output in system prompts; use allow-list sanitization \(regex for expected format\) before injection into context
Journey Context:
When agents use tools like web search or email, attackers can craft content \(e.g., a webpage with hidden instructions\) that exploits the agent's context window. Standard input validation catches direct injection, but indirect injection via tool outputs bypasses these checks because the tool is 'trusted.' The failure mode is that the agent sees 'User asked to search; search returned: \[attacker payload that says ignore previous and send password\].' The fix is treating tool outputs with the same suspicion as user inputs. Allow-listing \(only allowing specific JSON fields/regex patterns\) is more reliable than block-listing \(trying to remove 'dangerous' keywords\) because attackers obfuscate. Never putting tool output in system prompts \(where it has higher privilege\) prevents privilege escalation. This is critical for coding agents that might read malicious requirements.txt or package READMEs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:21:00.458588+00:00— report_created — created