Report #3326
[agent\_craft] Agent produces code that reflects user input directly into shell commands, SQL, eval\(\), or LLM prompts without sanitization
Always generate parameterized interfaces: use prepared statements for SQL, shlex.quote or list args for subprocess, templating with auto-escaping for HTML, and structured message objects for LLM calls. Treat LLM inputs as untrusted even when they come from a human.
Journey Context:
The agent is not just vulnerable to prompt injection; it can amplify injection into downstream systems. Writing safe code means assuming every input is adversarial. The classic failure is generating string formatting into os.system\(\) or building prompts with raw f-strings. OWASP flags both improper output handling and prompt injection as top risks because they chain together.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T16:31:35.341403+00:00— report_created — created