Building an AI coding agent by naively piping model outputs into bash creates a security disaster. OpenCode, an open-source coding agent with over 160k GitHub stars, demonstrates the critical failure modes that emerge when web-first designs handle local systems execution.
The core vulnerability lies in treating the command line as an unvalidated string pipeline. Early implementations enabled automatic tool call pruning, which obscured executed malicious commands from the conversation history, and cached command permissions across sessions without boundary validation. When an agent can run commands with persistent broad access, a single prompt injection or hallucinated string can trigger catastrophic host wipeouts or remote code execution.
If you are designing agentic execution harnesses, you cannot rely on prompt instructions to enforce safety. Safe coding agents require strict kernel-level sandboxing, deterministic path validation, and isolated ephemeral containers for any generated shell command.







