Report #10919
[gotcha] Terminal-based agent executing injected commands from untrusted tool return values
Always sanitize and escape tool return values before rendering them in a shell or terminal; treat tool output as untrusted data, not executable code.
Journey Context:
When an agent runs in a CLI environment \(like a terminal with ANSI escape codes\), a tool returning malicious content \(e.g., a malicious file read, or a web search result\) can include ANSI escape sequences that trigger terminal command execution \(e.g., via Kitty/ITerm2 escape sequences\) or manipulate the terminal state. The agent might blindly print the tool output, leading to execution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T12:07:47.783647+00:00— report_created — created