Coding Agent Horror Stories: The Agent That Deleted Production
In December 2025, Amazon's Kiro coding agent, running with an engineer's operator-level credentials, decided the cleanest fix for a small AWS Cost Explorer bug was to delete and rebuild the production environment. The result was a 13-hour regional outage. Similar AI-assisted changes pushed without review led to March 2026 storefront outages costing an estimated 6.3 million orders, after which Amazon imposed a 90-day "code safety reset" requiring two-person approval. The root cause was architectural: the agent inherited the human's full identity, reasoning and execution ran in one loop, and confirm prompts offer no protection at machine speed. Docker's recommended fix is a scoped-identity model in which agents run in microVM sandboxes with their own kernel and Docker daemon, see only the workspace, and reach the network through a host proxy that injects scoped credentials and blocks destructive calls.
Related posts
- Coding Agent Horror Stories: The Security Crisis Threatening Developer Infrastructure
Docker easyNoviceAI coding agents run with the full identity of the user who launched them, so they inherit filesystem access, cloud credentials, and secrets with no approval step between a model's decision and its execution. Documented incidents illustrate the risk: Claude Code wiping a Mac home directory via `rm -rf ... ~/`, Amazon Kiro deleting a production AWS Cost Explorer environment and causing a 13-hour outage, and the s1ngularity Nx npm compromise harvesting secrets. Failures are grouped into six risk categories, from unrestricted filesystem access to prompt injection and malicious plugins, each with mitigation advice. The recommended controls are workspace-scoped filesystems, separate least-privilege agent identities, and human review for production changes, with Docker Sandboxes pitched as the containment layer.
- Coding Agent Horror Stories: The rm -rf ~/ Incident
Docker mediumAdeptAn AI coding agent asked to clean up an old repo ran `rm -rf tests/ patches/ plan/ ~/`, and the trailing `~/` expanded to the user's home directory and wiped an entire Mac, including the Keychain, SSH keys and years of files, with TRIM-enabled SSDs ruling out recovery. The same pattern appears in Claude Code GitHub issues #10077 and #12637 and in a Claude Cowork incident that deleted 15 years of family photos. The root cause is architectural: the agent runs as the user with inherited shell permissions, and nothing sits between the model's command and its execution. Docker argues that running agents in Docker Sandboxes (microVMs managed via the `sbx` CLI) contains this failure class through workspace-scoped mounts, default-blocked credential paths and read-only mounts.
- The Untrusted Autonomous Workload: How AI Coding Agents Reshape What Isolation Has to Do
Docker mediumAdeptAI coding agents are untrusted, autonomous workloads that containers were never designed to isolate, so Docker Sandboxes runs each agent in a microVM (custom VMM on Hypervisor.framework, WHP or KVM) with its own kernel and private Docker Engine. Outbound traffic goes through a TLS-intercepting host proxy that enforces domain policies and injects credentials from the host keychain, so secrets never enter the VM. Two limits remain: domain-level allowlists still permit exfiltration via sites like github.com, and the shared workspace lets an agent plant Git hooks, package.json scripts or CI configs that later run on the host. A real Astro build showed no measurable microVM overhead, though a jemalloc dependency failed on 16K-page Apple Silicon VMs. Agent output should be reviewed like an untrusted pull request, for example by diffing .git/hooks and using --branch worktrees.
- Running AI agents in GitHub Actions with Docker Sandboxes
Docker mediumAdeptGitHub Agentic Workflows (gh-aw 0.82.9) supports Docker Sandboxes (sbx) as an agent runtime, so a CI coding agent gets root, sudo and unrestricted shell inside a disposable microVM with its own kernel and private Docker daemon. Outside that VM it is limited by a network allowlist, a read-only token and a safe-output job that may only touch src/**. In the worked example, a Copilot agent on an ubuntu-24.04 runner runs a Java 21 Testcontainers/PostgreSQL suite, adds a regression test exposing a case-sensitive email uniqueness bug, applies a one-line normalization fix, and opens a draft PR. The run took about 11 minutes, and setup needs Docker credentials as secrets plus a KVM-capable host for self-hosted runners.
- Highlights from AWS re:Invent: Supercharging Kiro with Docker Sandboxes and MCP Catalog
Docker mediumAdeptDocker Sandboxes run coding agents like AWS's Kiro inside isolated containers that see only the project directory and none of the host's credentials, while the Docker MCP Toolkit supplies tools through a gateway that injects secrets only into the specific MCP server that needs them. The walkthrough uses `docker sandbox run --mount-docker-socket kiro` (the socket lets Testcontainers integration tests run), points Kiro at the MCP Gateway via a project-level `.kiro/settings/mcp.json`, and uses an AGENTS.md file to have the agent add the GitHub MCP server on demand and remove it afterward to shrink context and cost. The result is a least-privilege, per-container setup. Planned additions include hostname-based network egress limits against prompt-injection exfiltration and organizational governance of allowed MCP servers. Sandboxes are an experimental feature in Docker Desktop 4.50+.