Report #17421
[gotcha] Passing LLM-generated arguments directly to shell execution in tools
Use parameterized execution \(e.g., execFile instead of exec in Node.js\) and strict input validation schemas. Never concatenate LLM output into shell strings.
Journey Context:
It is tempting to just let the LLM build the command string for flexibility. However, the LLM is just translating user requests, so malicious user input easily leaks into the shell command, leading to classic command injection. Parameterized execution separates the command from the arguments, neutralizing shell metacharacters.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T05:19:52.112215+00:00— report_created — created