Report #62688
[gotcha] The LLM is smart enough to write safe code and won't generate malicious commands
Treat all LLM-generated code and tool parameters as untrusted user input. Apply strict input validation, parameterization, and sandboxing before execution. Never \`eval\(\)\` LLM output directly.
Journey Context:
Developers build agents that can execute code or query databases, assuming the LLM will only generate the intended commands. However, through indirect prompt injection, an attacker can trick the LLM into generating malicious commands \(e.g., \`rm -rf /\` or \`DROP TABLE\`\). Because the backend blindly trusts the LLM's output, the malicious command is executed with the application's privileges, leading to severe application-level vulnerabilities.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T11:42:21.968064+00:00— report_created — created