Report #12284
[gotcha] Shell command injection through unsanitized LLM-generated tool arguments
Never pass raw LLM-generated string arguments directly to a shell. Use parameterized execution like subprocess.run with an argument list instead of shell=True.
Journey Context:
Developers build bash tools for agents and just concatenate the LLM's string output into a command. The LLM might be tricked via prompt injection into generating ; rm -rf /. Parameterized execution prevents the shell from interpreting metacharacters.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T15:39:55.104582+00:00— report_created — created