Docker Sandboxes: How to Test That AI Agent Guardrails Hold
A coding agent with overly broad permissions can turn a trivial task into a data leak or lost work. You ask an agent to clean up one repository, but if its access is loose, it may also reach your home directory, use your development credentials, and send requests to services you never approved. In its latest post, Docker looks at how to prove your AI agent guardrails actually work, rather than just existing on paper in a policy document.
The post builds on an earlier walkthrough of running Claude Code and an MCP server inside Docker Sandboxes using a command-line interface called sbx. That guide blocked outbound access first, allowed the endpoints the task needed, and then inspected requests to other destinations, including telemetry. The most useful part was watching a real request fail at the network boundary.
Now the workflow is extended to a whole team. A sandbox limits what an agent can reach on one machine, while organization governance adds shared rules, a managed way to run agents, and records of policy decisions. Docker highlights four controls:
- Network policy
- Filesystem policy
- Managed credentials
- MCP access
The network and filesystem controls are then tested in a simple demo built around a bank administrator scenario.
How one laptop can affect the whole organization
If an agent exposes a developer's SSH key or cloud token, every system that accepts that credential may need investigation. The security team has to work out what left the machine, replace or revoke exposed credentials, and check whether anyone used them. Deleted work can also halt development, so keep backups of anything that hasn't reached the repository yet.
The compliance fallout depends on the data and the organization. A personal data breach can trigger GDPR notification duties, subject to the applicable risk thresholds. HIPAA has separate requirements for covered entities and business associates after breaches of unsecured protected health information. India's DPDP framework also includes breach duties, but those provisions are scheduled to take effect in May 2027. For a SOC 2 examination, the question is whether the relevant controls operate as described. SOC 2 is not a breach-notification law.
Data sovereignty adds another question: where does the data go, and who controls it? Before approving a model API endpoint, establish where prompts and outputs are processed and stored, who can access them, and which contracts and laws apply. A provider's nationality alone doesn't answer those questions. Network policy can restrict the destination, but it can't prove how the provider handles data once it has received it.
It gets harder when developers choose and configure agents on their own. A rule on one laptop may be missing on the next. An ignore file may stop one component from reading a file while another component includes it in an upload. Written policy needs matching controls in the software that runs the agent.
Two real incidents of agents with too much access
In July 2026, developers reported two incidents in which a coding agent went far beyond its task. In one, data left the machine. In the other, files were deleted from it.
In the first case, a user said in an X post (since deleted) that Grok had uploaded their entire user directory, including SSH keys, a password manager database, and personal files. A Hacker News discussion drew wider attention to the claim. The home-directory claim remains the user's own account. The separate investigation covered here tested repository uploads. Researcher Cereblab intercepted Grok Build CLI traffic and found a background upload running alongside the coding task. In a test with a 12 GB repository, about 5.1 GiB had left the machine before the capture stopped, and the upload was still running. The data went to Google Cloud Storage, and fake secrets planted in the repository showed up in the traffic unhidden. At the time, turning off "Improve the model" did not stop the repository uploads.
In a reproducible follow-up, the researcher rebuilt the repository from a captured Git bundle, an archive of tracked files and Git history. The bundle included files the agent had been told not to read. In other words, telling the model not to read a file didn't stop the CLI from packaging and uploading it in the background. According to the researcher's updated timeline, whole-repository uploading was disabled server-side on July 13 and was still off when retested on July 22. The fix doesn't change the lesson: a coding agent is more than the model. It includes the CLI and any background processes, which can act without the model asking. Give the whole application only the access its task needs. That's the principle of least privilege.
The second case happened on July 10, when Matt Shumer wrote: "GPT-5.6-Sol just accidentally deleted almost ALL of my Mac's files." He shared the agent's acknowledgment and confirmed that Full Access was enabled. His follow-up described the loss of his home directory. A separate experiment shows why blocking a single command is fragile. Developer LinearUncle reported that after a plugin blocked rm, the agent tried unlink, find -delete, and apply_patch. A later attempt to move files to Trash through the GUI failed on permissions, but a call to Node's fs.unlink succeeded. The plugin's own documentation calls it an additional guardrail and recommends sandboxing and backups.
The common thread is excessive access. A model can pick a different tool, and a background process can run outside the model's visible workflow, so filesystem and network boundaries need to constrain both. Docker Sandboxes does this by running each agent in a microVM, a lightweight virtual machine with its own Linux kernel and Docker Engine, and a workspace mount shares only one host directory with the sandbox. For any team starting to use coding agents, the takeaway is clear: restrict access at the application and system level instead of relying only on instructions to the model.
Source: docker.com