Why Docker isn't an AI-safe sandbox anymore, and how I fixed it in MindRoom 🔒 Security researchers and AI developers are questioning Docker containers as a security boundary after the security company DepthFirst used its own AI model to find a container escape, publishing the findings under the title "Containers Are No Longer a Security Boundary." The concern centers on the shrinking gap between closed security models such as Anthropic's Claude Mythos and OpenAI's Daybreak Blue, which are gated behind identity checks and vetting, and open-weight models that trail them by only six to seven months, per Epoch AI data cited in the post. The author, who runs untrusted AI agent code in Docker workers for the open-source MindRoom system on Matrix, responded by rethinking the setup, noting that "the code inside the container is now written by an AI, and the bugs that let it out are now found by an AI. For years, a Docker container was my default answer to “where do I run this?” I never thought it was a perfect sandbox. It was good enough, because getting out of one usually meant finding a specific kind of bug in the Linux kernel itself, and those were hard to find. 1 fn:1 AI models have become very good at finding security bugs, including in Linux. Anthropic and OpenAI now keep their strongest security models, Claude Mythos https://www.anthropic.com/claude/mythos and Daybreak Blue https://openai.com/the-defense-factory/ , behind identity checks and vetting. Open-weight models, which anyone can download and run, come with no such rules, and they trail the closed ones by only six to seven months https://epoch.ai/data-insights/open-closed-cyber-eci-gap . Once there is an open model as good as Mythos, anyone can strip out its refusals with a tool like Heretic https://github.com/p-e-w/heretic people call this abliteration and point it at the Linux kernel. The security company DepthFirst used its own model to find a way out of a container and titled the write-up Containers Are No Longer a Security Boundary https://depthfirst.com/research/containers-are-no-longer-safe . I care about this because running untrusted code in containers is exactly what MindRoom https://www.nijho.lt/post/mindroom/ , my open-source system for AI agents that live in Matrix chat rooms, does. Every agent can get its own Docker worker, and its shell, file, Python, and browser tools run there. It can install anything, start background processes, and drive a real browser. And as I wrote in my ZFS post https://www.nijho.lt/post/btrfs-to-zfs/ , I run coding agents in YOLO mode, exclusively. I do not review the commands they run, I look at the results. So both sides changed at once. The code inside the container is now written by an AI, and the bugs that let it out are now found by an AI. A video from the Low Level channel https://youtu.be/9-2CSJC114k asking whether containers are still safe made me sit down and rethink my setup. I am not an expert in any of this. I have used containers, KVM, and hypervisors for years, including Proxmox before I moved to NixOS https://www.nijho.lt/post/proxmox-to-nixos/ , but I never deeply understood what happens underneath. Building this forced me to learn it, and writing this post is my exercise in understanding it all. All of this is very complicated as is everything new , and I am still learning. I am sure I skip over a lot and simplify the rest; what is here are the parts that helped me understand it. I thought it would be nice to share. When people talk about Linux, they usually mean an operating system like Ubuntu, Fedora, or NixOS. Those differ in almost everything you see: package managers, desktops, config files. What they all have in common is the kernel, the part Linus Torvalds started in 1991 and still leads today. Strictly speaking, that kernel is the only part called Linux. The kernel is the one program on a Linux machine that talks to the hardware directly. Everything else, your shell, Python, Chrome, Docker, runs on top of it and has to ask it for things. Open this file. Give me some memory. Send this packet. Start a new process. Those requests are called system calls, or syscalls for short. There is one kernel per machine, and it decides who is allowed to do what. That makes it the most trusted code on the system. Most kernel bugs only crash the machine or cause glitches. But some let a normal program become root, the admin account, or even run its own code inside the kernel. At that point it can do anything on the machine, including leaving any container it was in. When you docker run -it ubuntu , you get a root shell in what feels like a fresh computer. Under the hood it is one ordinary process. The kernel dresses it up using three features: There is no second kernel. Every syscall from inside a container lands in the same kernel as every other container and the host itself. The kernel enforces the isolation, and it is also what gets attacked. For most uses that is fine. Usually you put fixed software in a container: a database, a web app, some self-hosted service. You know where that code comes from, you keep your kernel patched, and that is good enough. An AI agent is different. It writes new code on the spot and runs it, and nobody knows in advance what that code will do. Since root in a container is root on the host, anyone who can use Docker can start a container as root and mount any folder from the host into it. They can then read and change every file in that folder, including files their own account may not open. Docker’s own documentation says the docker group grants root-level privileges https://docs.docker.com/engine/install/linux-postinstall/ . I knew that in theory, but it only clicked when I watched an AI agent do it on a machine where I had no root, only Docker access. It needed to change files it was not allowed to touch, so it started a small container, mounted their folder, and edited them from inside. No kernel bug needed. Kernel bugs that let a normal program take over the whole machine used to take skilled people weeks or months to find and exploit. The famous ones, like Dirty COW https://dirtycow.ninja in 2016, made the news every year or two, you patched, and that was it. AI is speeding this up, and the DepthFirst write-up I mentioned is a good example. Their model found a bug in the kernel code for Unix sockets, which programs on the same machine use to talk to each other. The kernel freed a piece of memory and then kept using it, a so-called use-after-free, and from inside a container that was enough to get out. Their conclusion is that you should assume attackers can escape containers at will. Blocking more syscalls, or taking more powers away from root, helps a little. But it only narrows which parts of the shared kernel a container can reach. This bug sat in Unix sockets, which almost every program uses, including the browser the agent drives, so blocking them would break the agent. Now put an AI agent in that container. It reads web pages and repositories written by strangers, and one of those could talk it into running an exploit. On a MindRoom server, getting out of a worker means getting onto the machine that runs MindRoom itself. That is where the API keys, Matrix logins, and stored credentials live, which the workers are built to never see. Before changing anything, I wanted to know how real this was for my own setup. I gave a MindRoom agent Daybreak Blue https://openai.com/the-defense-factory/ and asked it to escape its worker container using known kernel vulnerabilities. Daybreak Blue is OpenAI’s security model for verified users, so it does the offensive security work that other models refuse. It did not get out, which was reassuring. But it only tried known bugs. A kernel a few weeks behind on patches, or a bug nobody has published yet, would be a different story. So the attempt tells me the easy path was closed that day, and not much more. The classic answer is a virtual machine. A container shares the host’s kernel, but a VM brings its own, and this is where the hardware comes in. Modern CPUs have a virtualization mode built in, called VT-x on Intel and AMD-V on AMD. In that mode, a second kernel, the guest kernel, runs directly on the real CPU and believes it is in charge, while the CPU quietly limits it. When the guest tries something it may not do on its own, like talking to a disk or a network card, the CPU pauses the guest and hands control to the host. This is called a VM exit. Despite the name, nothing escapes and nothing crashes. The host handles the request, for example by pretending to be that disk, and then resumes the guest where it stopped. From the guest’s point of view, the instruction simply finished. Memory is fenced off too. The host gives the CPU a separate map of which real memory each guest may use, and the CPU checks every memory access against it. So even a guest kernel with full privileges cannot touch the host’s memory. The CPU only provides the mechanism. The software that sets the rules and handles the VM exits is called the hypervisor. “Hypervisor” is a role, not one program, and on Linux it is two pieces: /dev/kvm . Proxmox, which I mentioned above, is KVM plus QEMU. AWS Lambda is KVM plus Firecracker. Code in a VM talks to its own guest kernel. To reach the host, it usually has to break that kernel first and then the hypervisor.