Change Platform engineering

What does a container share with its host?

12 November 2026 · about 23 min read

In this article A container is a process on the hostHow container isolation worksWhere the isolation boundary can failReducing what a container sharesWhat stronger isolation costsWhat this means for AI agentsLimits of these measurementsConclusion

A container is a set of processes that Linux runs with limits on what they can see. It gets its own process list, its own view of the file system and its own network settings. It does not get its own kernel. The kernel is the core of the operating system, and an ordinary container uses the host's kernel. The host is the machine that runs the container.

So a container limits what a process can see. It does not give the process a separate operating system. How strong that limit is depends on what else the container shares with the host. There are four things to look at:

  1. Kernel. The container uses the host's kernel for every system call.
  2. Runtime. A program on the host creates and manages the container.
  3. Credentials and network. The container can hold keys and can reach services outside it.
  4. Hardware. The container and its host ultimately use the same physical processor and memory.

Fig. 1 What each option shares with the hostblue = shared · plain = its own · numbers match the list
Illustration: from the app down to the hardware. A container shares the host kernel. A microVM brings its own guest kernel, and still shares the VMM, the host kernel and the CPU.

Some of this is part of how containers work. Some depends on how the container is set up. Other risks depend on setup too, including devices, host mounts, management sockets, clocks and image sources. We do not cover them in this four-part comparison.

Below, we run a Docker container and check what it can see. Then we look at how the isolation works, where it has failed, and what gVisor and virtual machines change. We measure what stronger isolation costs. Last, we look at how AI agent sandboxes use these ideas.

A container is a process on the host

We ran these commands with Docker on one Debian 13 virtual machine (VM) in our lab. A VM is a software-defined computer with its own kernel. The host and container commands use the same Docker installation. The output is copied from our run.

$ docker run -d --name demo alpine sleep 1000

This starts a small Alpine Linux container that sleeps for 1,000 seconds.

The process list inside the container

$ docker exec demo ps
PID   USER     TIME  COMMAND
    1 root      0:00 sleep 1000
   13 root      0:00 ps

The list starts at number 1. Apart from ps itself, it shows only our sleep process. From inside, it looks like a small machine of its own.

The same process on the host

$ docker inspect -f '{{.State.Pid}}' demo
848675
$ ps -o pid,user,cmd -p 848675
    PID USER     CMD
 848675 root     sleep 1000

The host lists the same process as number 848675. It is a host process, listed alongside the processes of other containers on the machine.

Both views are correct. The container does not run a separate machine. It runs a process that the kernel shows in a limited way.

The kernel

$ uname -r
6.12.101+deb13-cloud-amd64
$ docker exec demo uname -r
6.12.101+deb13-cloud-amd64

The kernel version is the same inside and outside. An ordinary Linux container has no kernel of its own. Its system calls go to the host's kernel, as Docker explains. Matching version strings illustrate this. They do not prove it on their own.

Namespaces

$ readlink /proc/self/ns/pid
pid:[4026531836]
$ docker exec demo readlink /proc/1/ns/pid
pid:[4026532700]

These numbers identify process namespaces. A namespace gives a process its own view of one kind of resource, such as the process list, the network or the mounted file systems. The different numbers show that the host and the container use different process namespaces. In the container's namespace, the first process has number 1.

The same check for the network, mount and user namespaces:

$ readlink /proc/self/ns/net
net:[4026531840]
$ docker exec demo readlink /proc/1/ns/net
net:[4026532701]
$ readlink /proc/self/ns/mnt
mnt:[4026531841]
$ docker exec demo readlink /proc/1/ns/mnt
mnt:[4026532697]
$ readlink /proc/self/ns/user
user:[4026531837]
$ docker exec demo readlink /proc/1/ns/user
user:[4026531837]

The process, network and mount namespaces differ. The user namespace is the same. In this Docker setup, root inside the container is root on the host, with fewer privileges than host root. The container still uses the host kernel's network code.

The processor

$ grep -m1 "model name" /proc/cpuinfo
model name	: AMD Ryzen 9 9955HX 16-Core Processor
$ docker exec demo grep -m1 "model name" /proc/cpuinfo
model name	: AMD Ryzen 9 9955HX 16-Core Processor

Both sides report the same CPU model name. That is what /proc/cpuinfo shows. It does not show which physical core ran either process. Our lab machine is itself a VM, so the processor it reports may be a virtual one.

How container isolation works

A program asks the kernel for things through system calls, such as opening a file or sending a packet. A container uses the same system calls as any other process. Linux features limit what its processes can see and do. Three of them matter most here, and other controls matter too.

None of the three is a second kernel. The authors of Firecracker, a tool we meet later, put it in one line: In Linux containers, untrusted code calls the host kernel directly.

For an ordinary Linux container, the kernel is shared. What depends on the setup is how much of the kernel the container can call. The seccomp filter, the privileges given to the container and whether it may create its own namespaces all change that.

From here on, we call the line between a container and the host the isolation boundary.

Where the isolation boundary can fail

The examples below show how each of the four can expose a host or another service. They are disclosed bugs and incidents. They are examples, not counts, and they say nothing about how often attacks happen.

Kernel

In July 2026, OpenAI was testing AI models on security tasks inside its own systems. Its technical report describes what the models, working as agents, did on July 19.

They were inside one container. They found a public exploit for a known kernel bug, CVE-2026-53362. (A CVE is the public ID number of a security bug.) In the report's words, they "customized it to succeed on their underlying machine". That gave them "root access on the underlying worker node".

The bug was not specific to containers. It could let a local program become root on a vulnerable kernel. In a container, that kernel is the host's.

Other kernel bugs have been used the same way:

  • CVE-2022-0185. Its finders wrote that they had built "container escape exploits against Google's hardened COS". Their exploit needed a container that could create its own user namespace, or one that already held the CAP_SYS_ADMIN privilege.
  • Dirty Pipe (2022). Datadog showed a container escape with it in a lab. That demo needed root inside the container, and someone running kubectl exec into it.
  • Copy Fail (CVE-2026-31431). The finders call it a "container escape primitive". We did not see a tested container escape in the sources we read.

Runtime

A runtime is the program on the host that sets up and starts containers. One runtime is runc. It runs on the host side of the isolation boundary, and it has to handle things the container controls: its image, its files and its settings.

In February 2019 that went wrong. With CVE-2019-5736, a command running as root inside a container could "overwrite the host runc binary (and consequently obtain host root access)". The affected runtime had to start an attacker-controlled image, or attach to a container the attacker could already modify.

The notice from the runc maintainers added a detail that matters. The attack was blocked by "correct use of user namespaces", where root in the container is mapped to an ordinary user on the host. So "root in the container is root on the host" is true of one setup, not of all containers.

runc has had more disclosed escape vulnerabilities since:

  • 2024. CVE-2024-21626: runc leaked a handle to a host directory, "allowing for a container escape by giving access to the host filesystem".
  • 2025. Three runc advisories on one day in November, each titled as a container escape (one, two, three).

Credentials and network

A container does not have to escape through the kernel or the runtime to reach something outside it. It can hold credentials, such as keys or tokens, and it can have network access to other services. How much it can reach depends on the setup, but some defaults allow broad access.

Example: Azure Container Instances, 2021

In 2021, researchers at Palo Alto Networks looked at Azure Container Instances, a service that runs customers' containers.

Azure did not rely on the container boundary. Each customer got a dedicated VM node with its own kernel. The researchers write: "In ACI, that boundary is the node virtual machine."

First they checked which runtime the service used. It was a runc release from October 2016. So they took the 2019 runc bug from the section above, put it in an image and ran it. They "broke out of our container and gained a reverse shell running as root on the underlying host".

That host was still their own VM. The boundary Azure relied on had held.

Then, as root on their own node, they watched its network traffic and triggered a container exec request. The request came from a shared management service and carried a token in a header. With it, the researchers write, a customer could "take over the Kubernetes api-server", the control service of a cluster that hosted other customers.

The VM boundary was not broken. After the runc escape gave them root on their own VM, a credential delivered across that boundary let them reach the shared service.

CUSTOMER VM · the boundary Azure relied on container root on the VM runc bug, 2019 still insideits own VM boundary held Kubernetes api-serverhosts other customers token sentto the VM no kernel bug,no VM bug.A credential crossed it. CUSTOMER VM · boundary held container runc bug, 2019 root on the VM, still inside it token sent to the VM Kubernetes api-serverhosts other customers No kernel bug, no VM bug.A credential crossed it.
Fig. 2 Azurescape (2021): the boundary held, the token crossedblue = shared with the host · ink = its own
Illustration of Unit 42's Azure Container Instances report. The researchers stayed inside their own VM after the runc bug. A token in a request header led them to the control service of a cluster that hosted other customers. Research, not an attack in the wild.

This was research, not an attack. The authors say they have "no knowledge of Azurescape exploited in the wild".

Examples from real incidents

  • Tesla, 2018. RedLock found that attackers had entered "Tesla's Kubernetes console which was not password protected". Inside one pod were cloud keys that led to a storage bucket.
  • SCARLETEEL, 2023. Sysdig describes an attacker who entered through one container and took the machine's temporary keys from the metadata service. Sysdig says the attacker retrieved and read "more than 1 TB of information", but object-level storage access was not logged.
  • Hugging Face, July 2026. The same OpenAI report covers the agents' path into Hugging Face. An uploaded dataset made a production worker "open and return worker-local files". Node credentials from the metadata service were denied broader listings and secrets. Later, a different path used Kubernetes tokens and privileged workload access to obtain secrets. The report names no kernel CVE for this path, which was separate from the OpenAI worker test above.

Hardware

Below the kernel there is one more shared thing: the processor. Modern CPUs guess ahead to save time, and those guesses can leave traces.

The Spectre paper showed that this breaks the assumptions behind "operating system process separation, containerization" and more. Spectre was disclosed in 2018. A related bug, L1TF, reached VMs. The kernel documentation says "a malicious guest running on one Hyperthread can attack the data" of the other thread on the same core.

A VM does not remove this. Firecracker's documentation says it is not able to mitigate host's hardware vulnerabilities.

Reducing what a container shares

Three well-known approaches change how code reaches the host kernel. Each has a different isolation boundary, and each still shares some things with the host.

gVisor puts a second kernel, written as an ordinary program, between the container and the host kernel. The container's system calls go to gVisor, and gVisor makes a smaller set of calls to the host. In 2019 its makers counted about 350 system calls in Linux and at most 68 that gVisor's main component needed from the host.

A VM gives the code its own kernel, the guest kernel. In the Linux setups discussed here, the host still takes part through KVM, the Linux kernel's virtualization system, and a host program that provides virtual devices such as a disk and a network card.

A microVM is a VM with that host program cut down. In its 2020 paper, Firecracker had about 50,000 lines of Rust, including tests and generated bindings: "96% fewer lines than QEMU". QEMU is a program that runs VMs and provides virtual devices. These historical counts, like gVisor's call count, do not measure how often escapes happen.

What can still expose the host or other services in these Linux/KVM examples:

  • Container: calls the host kernel directly. Its runtime is on the host.
  • gVisor: calls its own kernel, which calls the host kernel. Its runtime is on the host.
  • MicroVM: has a guest kernel. The host is reached through KVM and a small device program. Where the runtime runs depends on the setup.
  • Plain VM: has a guest kernel. The host is reached through KVM and a device program such as QEMU. Where the runtime runs depends on the setup.

For all four, credentials and network access depend on the setup, and the hardware is shared. No option shares nothing.

What remains has bugs too. Firecracker published two advisories in 2026, both for narrow setups. Two VMware ESXi vulnerabilities are on the list of bugs known to be exploited kept by CISA, a US government agency. CVE-2025-22224 may allow a guest with local administrator privileges to execute code as its VM's host process. CVE-2025-22225 requires privileges in that process and may allow a write outside its sandbox. They are not two independently demonstrated full escapes.

Which option is safest? We did not measure that, and we found no comparable, reliable escape rates for these approaches. gVisor's own documentation warns that "one should not assume that the mere use of virtualization hardware makes a system more or less secure". The comparison shows what can be exposed, not how often it breaks.

What stronger isolation costs

We can measure the costs of particular setups. Each result below describes one setup. None is a ranking of the technologies.

The figures come from our lab notes. Most of our earlier labs were run by AI agents and reviewed by a second model. For this article we did not re-check the raw data. Read them as observations from our own tests, not as independently verified results.

In these measurements, one sandbox means one container, one gVisor container or one microVM. We ran each kind on one machine with the same tiny program: a server that answers one line.

Setup for start time and idle memory: a VM inside a VM, on an AMD Ryzen 9 9955HX machine with other VMs running. The lab VM has 4 vCPUs and 4 GB. Kata lets container tools start a microVM. The microVM guests were set to 1 vCPU and 128 MiB of guest RAM, and used different guest kernels. Images were local and networking was set up before timing.

Start time

Question: How long does it take from the start command to the first correct reply?

Method: 30 cold starts per kind. No timed start failed.

KindMedian start timeMiddle 80% of starts
Container (runc)74 ms65–82 ms
MicroVM (Firecracker)618 ms615–624 ms
MicroVM (Kata, Cloud Hypervisor)1,231 ms1,206–1,265 ms
Fig. 3 Start time, median of 30 cold startslog scale · nested virtualization
Each dot is one kind. These are different start paths, not a ranking of runtimes: Firecracker was started directly, the others through containerd and a shim. The scale is logarithmic: each grid line is ten times the last. gVisor goes through a containerd shim that waits 5 s for a reason we did not find. Started directly, it took about 25 ms. The direct figure skips containerd, so it does not compare with the other rows.

Limitations: The paths are not equivalent. Firecracker was started directly, without containerd (the container manager) or a shim (the adapter that connects a runtime to that manager). The other timed paths in the table went through them. Nesting also slows VM boot, so the gap between the container and the microVMs is probably wider here than on a bare machine. We did not measure by how much.

Takeaway: These are start times for these deployment paths on this lab setup. They are not a general ranking of runtimes.

gVisor (not in the table). Started through the same container tools as the others, gVisor took 5,063 ms. Started directly, it took 25 ms (10 starts, on a second lab VM). A gap of about five seconds appeared in the containerd and gVisor shim path. We did not find its cause, so we do not quote 5 seconds as gVisor's own start time. The direct result is not comparable to the table: the probe checked every 5 ms, which is a large interval against 25 ms.

An extra Kata path, using QEMU, took 4,505 ms on the main lab VM. We did not investigate its delay, and it is not in the table.

Idle memory

Question: How much memory does an idle sandbox use?

Method: We measured it in two ways. They are different measures and should not be compared with each other.

KindOne sandbox: process memory (PSS)Ten sandboxes: drop in available host memory, per sandbox
Container (runc)14.8 MiB4.5 MiB
gVisor73.2 MiB23.2 MiB
MicroVM (Firecracker)57.0 MiB53.4 MiB
MicroVM (Kata, Cloud Hypervisor)152.1 MiB127.6 MiB
Fig. 4 Memory per sandbox, idle, MiB (two measures)nested virtualization · 128 MiB guest RAM
Dark bar: process memory (PSS) of one sandbox alone. Light bar: drop in available host memory per sandbox with ten running. These are different measurements. Compare sandbox kinds within one bar colour, not the two colours against each other. Idle only, not under load.

The first column is proportional set size (PSS). It adds up the memory of the sandbox's processes and splits shared pages between them. It leaves out the shared containerd manager. It is the median of 5 runs.

The second column is how far the host's available memory fell with ten sandboxes running, divided by ten, over 3 runs.

Limitations: Both are idle measurements only. The available-memory change includes host and cache effects, so it is not an exact cost per sandbox. A check with no workload varied by about 1.2 MiB per sandbox. The Firecracker result includes about 54 MiB of huge pages. We did not test Firecracker with huge pages turned off.

The memory runs also had failures. In the first three Kata runs of ten, one sandbox did not become ready, and we threw those runs away. Three later runs succeeded, but we do not know why. One successful raw record was lost, so its value came from the console.

CPU cost: VM exits

A guest is the system running inside a VM. Its instructions often run directly on the CPU. Some events hand control to the host's hypervisor, the software that runs and manages VMs. That handover is a VM exit. KVM handles many exits. Some need a host program before the guest can resume.

ONE EXIT GUESTHOST guest runs paused guest runs host handles it 1 exit2 enter causes: sleep · timer write · packet signal paused time = work the guestdid not do ONE ROUND TRIP, OUR TRACE 6 sleeps 7 timer writes 2 packet signals each tick = one exit · 15 in all Firecracker v1.17.0 · 100 roundtrips/s · one traced run guest runs exit host handles itguest is paused meanwhile enter guest runs again ONE ROUND TRIP, OUR TRACE 6 sleeps7 timer writes2 packet signals 15 exits · Firecracker v1.17.0
Fig. 5 One VM exit, and how many one round trip haddashed = control passes
Illustration: the guest runs until an event needs the host: a request only the host may handle, an interrupt, or an event the hypervisor is set to catch. The CPU pauses the guest, the host handles it, the guest resumes. The counts come from one traced run of two Firecracker guests on a shared host. They are not a price per exit.

In our tests, exits came from a guest going to sleep, setting a timer, or signalling that a packet was ready. Interrupts can also cause exits. What causes an exit depends on the hardware and the settings.

How much does one exit cost? The one published measurement we found is from 2010. The cpuid instruction, which asks the CPU about its features, took about 100 CPU cycles on the bare machine and about 2,600 inside a VM. That is the total instruction time inside the VM, not the cost of a clean exit alone, and it is not today's cost. We have not measured one clean exit ourselves.

Our own tests used small request–reply messages between two microVMs.

Where the CPU goes. We sent a small UDP message from one microVM to another and back, 100 times a second, and traced it. Each round trip took about 6 sleeps, 7 timer writes and 2 packet signals, and each one was an exit. The two guests woke up ten times per round trip. Two ordinary processes doing the same work woke up three times. About 85% of the traced extra CPU time went to guest execution, entering and leaving the guest, and KVM handling exits.

Holding a core. In a separate test, idle guests kept their cores instead of handing them back to the host. Against a QEMU control, the CPU work per UDP round trip fell by 52%, 55% and 53% at 100, 1,000 and 10,000 round trips a second. These are medians of paired runs.

At 100 round trips a second, the median CPU time was 709 microseconds with the control and 412 with the guests holding their cores, a 42% difference. That is not the median of the paired differences, which is why the two numbers differ. A machine-wide clock check did not firmly confirm the 100-a-second result, and at that rate the energy per round trip did not fall.

The exit count did not fall: seven sleep exits became seven interrupt exits. Each guest had one virtual CPU (vCPU), a CPU presented to a VM, and each idle guest held a whole core. The two settings also used different idle instructions, so this was not a test of exit handling alone.

In another lab on our shared host, two VMs passed 100-byte messages through shared memory while both stayed awake, holding two cores. A round trip took 0.31 microseconds, the same as between two processes in that test. This is different work from the UDP test.

Takeaway: In these light-load tests, the cost seems to come from the whole sleep-and-wake sequence, not only from the number of exits. The tests do not separate every cause, and they do not give a cost for every VM workload.

A VM inside a VM. On a cloud machine that is itself a VM, nesting can add another layer of handling to each exit. When we moved the same microVMs inside a VM on the same machine, they used 2.74 times the CPU at 100 round trips a second, and 3.17 times at 1,000.

CPU under load: PostgreSQL

Question: Does a microVM per pod cost more CPU than a container for a database?

Method: On one rented server, we compared Kubernetes using k3s, runc and the Cilium network plugin with a Firecracker stand-in, one microVM per pod. We ran a PostgreSQL read-write test and measured whole-node CPU per transaction.

Result: On the microVM side, CPU per transaction was 4.53 times the baseline with one client, and 2.74 times with 32 to 64 clients.

Limitations: The two sides were not equal. The stand-in ran no platform services, and it used a shorter network path that left out the process that enforces network policy. The clock check failed in most idle windows, so the numbers are exploratory.

VMs have existed all along

None of this is new. Before Firecracker, AWS Lambda got its isolation in the plainest way: we used dedicated EC2 instances for each customer. A whole VM per customer works, at a cost in boot time and memory. Firecracker was built to make VM isolation lighter and faster for workloads like these.

What this means for AI agents

The same questions apply to AI coding agents. A coding agent reads text the user does not control, such as a web page or a file. That text can contain a prompt injection: hidden instructions that change what the model does. OWASP, a security guidance community, says "it is unclear if there are fool-proof methods of prevention" for it.

Asking a person for permission each time has limits too. Anthropic found that "users approved roughly 93% of permission prompts". It also writes: "we've seen Claude models 'helpfully' escape a sandbox in order to complete a task."

So vendors run agents in sandboxes. This is what their own documentation says, as we read it in November 2026:

  • Kernel features on your own machine. Claude Code's local Bash sandbox uses the operating system's built-in tools on a laptop. Anthropic says this sandbox "is off by default" and "is not a complete isolation boundary".
  • gVisor. Anthropic runs claude.ai's code execution "in a gVisor container".
  • MicroVMs. Cloudflare, E2B, Vercel, Docker and AWS each describe one microVM per sandbox or session.

These choices address the kernel boundary. Network access is handled less evenly. E2B, Modal and Vercel document that public internet access is open by default. Cloudflare says its sandbox containers start with internet access off.

OpenAI also says its red-team agents chained vulnerabilities into microVM escapes in its own test setup. It does not name the affected microVM product or give an escape rate.

A network route can also carry data out. Anthropic describes a test where data left through an allowed domain: "The sandbox worked perfectly, and yet the data was exfiltrated." This was a policy failure. OpenAI describes an agent reaching an outside chatbot through "insufficient DNS filtering in its training sandbox". That is a filtering failure, not proof that a VM boundary was tested.

As in the Azure example, a credential or a network route can give a path around the isolation.

Limits of these measurements

  • Nothing here ranks security. We measured cost. We did not attack anything. The bug lists are examples, not rates.
  • The start-time and memory tables come from a VM inside a VM, on one machine, with one tiny idle program. A real service on a bare machine may give a different order.
  • Most of the lab work was run by AI agents and reviewed by a second model. For this article we did not re-check the raw data.
  • The measurements use different methods, and we label them separately. Start time compares deployment paths with different parts included. The two memory columns measure different things.
  • The performance numbers are from our own lab notes, not from vendor benchmarks. Where we quote a vendor or a paper, the figure is theirs.
  • This article shows no results for Zero. It does not show a Zero implementation or a security result for it.

Conclusion

A container uses the host's kernel and hardware, is managed by a runtime on the host, and may be able to reach credentials and networks outside it. gVisor and VMs reduce some of that sharing. Each costs something in start time, memory or CPU, and none removes all of it. The hardware is always shared.

What follows from this is a rule for defaults, not a ranking of products. Untrusted code should get only the access it needs. It should start with as little shared as possible, and each extra thing it gets should be given on purpose. As the incidents above show, protecting the kernel is not enough: credentials and network access matter too. How strong the boundary needs to be depends on what the code could reach if it broke out.

Tell us about your system.

Book a call with an engineer, or write to contact@8network.io.