Report #37810
[gotcha] LLM output is executed by a secondary system or LLM without sanitization
Treat LLM outputs as untrusted data. Never directly execute LLM-generated code, SQL, or shell commands without human-in-the-loop approval or strict sandboxing.
Journey Context:
A common pattern is using an LLM to generate structured data \(like JSON or SQL\) which is then executed. If the LLM is prompt-injected, it can generate malicious SQL or code. Because the primary LLM's output is trusted by the developer, the secondary execution environment \(database, shell\) runs the malicious payload with high privileges. The fix is to treat the LLM as an untrusted user.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T17:56:45.420339+00:00— report_created — created