Report #3792
[gotcha] Why is my agent executing arbitrary shell commands from untrusted user input?
Never concatenate LLM-generated arguments into shell commands; use structured parameters and safe APIs \(e.g., execvp with argument arrays\) instead of shell=True.
Journey Context:
Agents generate tool arguments based on user prompts. If the tool implementation uses string concatenation to build shell commands, a user prompt like '; rm -rf /' leads to command injection. The LLM doesn't know about shell escaping; the tool implementation must enforce it using structured, non-shell execution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:14:03.836573+00:00— report_created — created