Skip to content

Interview question · Cloud, Container & AI Infrastructure Security

Containers, gVisor, microVMs and VMs: where is each isolation boundary?

The question is really 'what does hostile code have to break to reach the host?' Answer that for each option and the choice follows.

mediumEssentialNewPreparation tags: Google, Amazon, AnthropicUpdated Nov 2026

TL;DR: A container is a process isolated by namespaces, cgroups, capabilities, seccomp and an LSM, on the shared host kernel: escaping needs a kernel bug or a misconfiguration. gVisor puts a user-space kernel between the workload and the host, so the host kernel exposure shrinks to a small set of system calls. A microVM (Firecracker, Kata) gives the workload its own guest kernel behind hardware virtualisation: escaping needs a hypervisor or virtual-device bug. A full VM is the same boundary with more devices and overhead. Choose by trust: containers for your own code, gVisor or microVMs for untrusted or model-generated code.

How to approach it

For each option, state what sits between the workload and the host kernel, what an attacker must break, and the cost. Then pick by trust level and mention the misconfigurations that defeat any of them.

A strong answer

FIG · ISOLATION BOUNDARIES · WHAT THE WORKLOAD CAN TOUCH
Each step down puts more between the workload and the host kernel
  1. 1

    1 · Container

    Shared host kernel

    • Namespaces, cgroups, capabilities, seccomp, LSM

    Escape: kernel bug or misconfiguration

  2. 2

    2 · gVisor

    User-space kernel in between

    • Host kernel exposure shrinks to a small syscall set

    Escape: gVisor bug plus host bug

  3. 3

    3 · MicroVM

    Minimal VMM, own guest kernel

    • Firecracker-style, fast start

    Escape: hypervisor or VMM bug

  4. 4

    4 · Virtual machine

    Full hardware virtualisation

    • Separate kernel per tenant

    Escape: hypervisor bug

OptionBoundaryAttacker must breakCost
ContainerKernel features on a shared kernelA host kernel bug, or a misconfigurationLowest overhead
gVisorUser-space kernel (Sentry) intercepting syscalls, small host syscall surfacegVisor's implementation, then a much smaller host surfaceSyscall-heavy workloads slower; some compatibility gaps
MicroVM (Firecracker, Kata)Separate guest kernel, hardware virtualisation, minimal virtual devicesThe hypervisor or a virtual deviceExtra memory and startup time (Firecracker is designed for fast starts)
Full VMSeparate kernel, more emulated devicesHypervisor or device emulationHighest overhead

Misconfigurations that defeat containers regardless. Privileged mode; mounting the container runtime socket; host path mounts of sensitive directories; adding capabilities such as CAP_SYS_ADMIN; disabling seccomp or AppArmor; sharing host network or PID namespaces; running as root without user namespaces.

Choosing.

  • Your own reviewed services: hardened containers (non-root, read-only root, default seccomp, no extra capabilities).
  • Third-party but vetted software: hardened containers on segregated nodes.
  • Untrusted, customer or model-generated code: gVisor or microVMs, per session, with no credentials and restricted egress.
  • Strong multi-tenant isolation for customers: microVMs, and separate hosts for high-risk tenants.

Isolation is half the design. A perfect boundary around code that holds cloud credentials and open internet access still lets that code exfiltrate data. Pair the boundary with an empty environment.

GPUs. Passing GPUs into sandboxes weakens guarantees: drivers are large kernel components, and GPU memory isolation between processes has had flaws (LeftoverLocals, CVE-2023-4969). Prefer dedicated GPUs per tenant for untrusted workloads.

What interviewers probe next

  • "Why is Kubernetes namespace isolation not a security boundary?" It is an API and naming scope; pods in different namespaces share nodes and kernels unless you separate them with node pools, sandboxed runtimes and network policy.
  • "How does Firecracker keep its attack surface small?" A minimal virtual machine monitor with very few emulated devices, running in a restricted process.
  • "When is a container enough for untrusted code?" Rarely; perhaps for low-risk, short-lived code with no network and no secrets, accepting kernel-exploit risk.

What if?

What if · interview follow-ups

Hold your answer as the constraints change

You must run customer-supplied Python code on shared infrastructure, and a teammate proposes plain Docker containers because they are fast to start.

  1. Start here

    What isolates a container?

How it's scored

Weak: "Containers are isolated, VMs are more isolated."

Hire: Explains the shared kernel, gVisor's user-space kernel and microVM guest kernels, and maps choices to trust.

Strong Hire: Adds misconfigurations, costs, Kubernetes namespace caveats, GPU limitations, and pairs isolation with environment controls.

Common mistakes

  • Treating Kubernetes namespaces as isolation.
  • Running untrusted code in privileged containers for convenience.
  • Focusing on escape while leaving credentials inside the sandbox.
You just read a free answer. Every topic opens its first 5 answers to anyone. Sign in and the count per topic goes to 10, and we keep track of how far you get in every topic.Google sign-in · free · no payment details
HOW DID IT GO?
0
READING SIGNED OUT

Signing in doubles your free answers, from 5 to 10 per topic, and the site starts remembering you: mastery per topic, bookmarks, and a next-focus recommendation. Free, no card.

Sign in free
UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

No comments yet. Share a correction or a different way to answer it.