Skip to content

Sandbox options: the runtime under the sandbox, and the sandbox manager

Status: comparison, and decided. The owner said on 2026-11-27 that Kata Containers is not mandatory, and after reading this comparison decided the same day (design.md, section 10):

  1. gVisor is the default sandbox runtime, in Local and in Cloud. Kata stays as an opt-in (SANDBOX_RUNTIME=kata).
  2. OpenSandbox stays the sandbox manager. kubernetes-sigs/agent-sandbox is the named first fallback if OpenSandbox fails on Kubernetes 1.37.
  3. cp-0 stays bare metal until experiment 2 has run, and is revisited afterwards.

The comparison below is kept as the basis of those decisions. Nothing in it was measured on the cloud target.

Bracketed IDs such as [M5] point to rows in compatibility.md. "Local probe" rows were executed once on 2026-11-27 on the owner's Mac Mini, in a throwaway OrbStack machine that was deleted afterwards. One run on one arm64 machine is feasibility evidence, not validation, and its timings are not benchmarks.

There are two separate questions, on two different layers:

Question Layer Today
(a) What isolates a sandbox pod from the node? Container runtime under the sandbox gVisor by default; Kata as an opt-in (was: Kata only)
(b) What creates, runs commands in and deletes sandboxes? Sandbox management OpenSandbox

They are independent: either manager can use any of the runtimes, because the runtime is selected through a Kubernetes RuntimeClass on the pod.

Since the three-act demo (2026-11-27) there is a third thing in front of both, which changes neither: the agent reaches the manager's MCP server through Agentgateway, which decides which of its tools the agent may call (demo.md, section 3). Since the owner's decision of 2026-11-27 for observability variant V1, sandbox HTTP egress goes through a listener of the same gateway, which refuses it, and the NetworkPolicy below has one opening, to that listener; everything else stays closed by the policy (demo.md, section 10) [P10 to P15]. Where this document says below that egress is closed by a NetworkPolicy, read it with that opening.

1. (a) The runtime under the sandbox

What runs in a sandbox: image-processing code written by the agent, on a photo uploaded by a member of the audience. Both the code and the file come from outside.

runc gVisor (runsc) Kata Containers (QEMU)
What isolates Namespaces and cgroups; the node's kernel is shared A user-space kernel per sandbox answers the workload's system calls; the node's kernel is not called directly by the workload A virtual machine per sandbox with its own Linux kernel, under KVM
OpenSandbox 1.2.1 The default: no [secure_runtime] Supported and documented: type = "gvisor" [M1] Supported and documented: type = "kata" [M1] (also firecracker, not looked at)
Limits OpenSandbox documents None The per-sandbox egress sidecar does not work; a request with a network policy is refused [M6]. Not every system call is implemented Needs hardware virtualization
Install on K3s Nothing No chart. Three things on the node: the release's binaries (runsc, the containerd shim, and the gvisor-bin directory beside them), a containerd drop-in, and a RuntimeClass. K3s does not register runsc by itself [M3, M9] Helm chart kata-deploy 4.4.0; needs KVM on the node
Local VM on Apple Silicon Works anywhere Works in OrbStack, with no nested virtualization [M3] Needs nested virtualization: Lima only, with two overrides [K4, K7, K8]
Cloud node Any Any Linux node; no KVM, so a bare-metal server is not required for it [M11] Bare metal, for KVM [E1, E2]
Cold start, pod creation to Ready 1.1 s (OrbStack), 0.6 s (Lima) [M4, K9] about 1 s: 0.9, 0.9, 1.1 s [M4] about 20 s under nested virtualization on the Mac [K9]; unmeasured on bare metal, where upstream's own figure is about 0.5 s of overhead [M2]
OpenSandbox create call until running not measured 2.0 to 2.2 s with images on the node [M5] not measured separately
Memory per sandbox on top of the workload none about 60 MiB observed [M4] 0.36 GiB QEMU process observed; 320 Mi declared RuntimeClass overhead [K21]
Strength against code derived from audience input Weak. A kernel bug reachable from a container is a node compromise Strong, but not a VM. The workload reaches the node's kernel only through gVisor's own, much smaller set of host system calls [M21] Strongest of the three. A hardware virtualization boundary; in Local that boundary is nested on a desktop OS and not claimed as a security boundary (deployment-options.md, section 4)
Maintenance Part of K3s A Google open-source project with weekly releases; binaries must be placed and updated on each node by us, like the NVIDIA toolkit A CNCF-hosted project with a chart; a guest kernel and image to keep current; more moving parts when it fails (see [K7])
Evidence in this repository Baseline in the probes Probe: K3s v1.37.2, OpenSandbox create, command, delete; egress blocked by a NetworkPolicy [M3 to M8] Probe: the same sequence under Lima [K6 to K10]

Not compared: Firecracker through Kata (also needs KVM), and anything OpenSandbox does not document.

Things the gVisor probe found

  • The release tarball's gvisor-bin directory is required next to runsc. With only runsc and the shim installed, pods fail with sidecar "gvisor_sentry" not usable [M3]. OpenSandbox's guide names only the two binaries.
  • Egress has to be closed another way. OpenSandbox refuses a network policy under gVisor [M6]. A plain Kubernetes NetworkPolicy in the sandbox namespace, enforced by the controller built into K3s, did the job in the probe: with it, a request from inside the sandbox to the internet failed; without it, the same request succeeded; commands through the OpenSandbox server kept working [M7]. This policy is now part of every profile and does not depend on the runtime (sandbox-network-policy.yaml).
  • A command sent immediately after "running" can fail with BACKEND_CONNECTION_FAILED; a few seconds later it works [M8]. The demo application must retry. Not specific to gVisor as far as is known.

What is not known about gVisor here

  • Whether the image-processing code of the demo (image libraries, their native code) runs under gVisor's system-call coverage [M12]. Only uname and curl were run.
  • Anything on the cloud target: x86_64, Ubuntu 24.04, bare metal or a VM [M11].
  • Behaviour under load or over time.

Outcome for (a)

Decided as recommended: gVisor as the default runtime in both options; Kata as an opt-in; runc only as the baseline of experiment 2. Reasons, in the owner's terms ("lighter, easier to deploy locally and in the cloud"):

  • It is the only choice that is both isolating and installable everywhere: in OrbStack on the Mac, which is already installed, and on any cloud node.
  • It removes the largest latency item of the Local demo: about 20 s of sandbox start becomes about 2 s, so the warm pool is no longer needed.
  • It is one of the runtimes OpenSandbox supports and documents.
  • Local and Cloud would then run the same runtime, which Kata could not offer honestly.

What it costs: a manual install on the node instead of a chart; the egress sidecar is replaced by a NetworkPolicy; isolation is a user-space kernel, not a VM; compatibility of the demo's code is unverified.

runc was not recommended as the default: it is the easiest, and it gives code derived from audience input the node's kernel.

2. (b) The sandbox manager

"Kubernetes-native sandbox" is taken to mean kubernetes-sigs/agent-sandbox: a Kubernetes SIG project (Apache-2.0) that adds a Sandbox custom resource and a controller [M13]. OpenSandbox is Alibaba's open-source project and is what the lab uses now.

OpenSandbox 1.2.1 (current) agent-sandbox v1.0.12
Release state Released; server, SDKs, MCP server, charts and images versioned together [F1] Released: v1.0.12 on 2026-11-20, a release roughly every week. The API group is agents.x-k8s.io/v1beta1: still a beta API in an experimental (x-k8s.io) group [M13]
Kubernetes 1.37 Outside its declared range (maximum v1.34): the accepted gap G1 [A11]. In two local probes it worked on 1.37.2 [K10, M5] No declared maximum. Requires 1.25 or later; built against client-go v0.37.1, the 1.37 API [M14]. Ran on K3s v1.37.2 in the probe [M15]. It avoids G1
How a sandbox is created An HTTP API on a lifecycle server (POST /v1/sandboxes), with an API key A Kubernetes object: Sandbox, or with the extensions SandboxTemplate, SandboxClaim, SandboxWarmPool. No server of its own; access control is Kubernetes RBAC [M17]
Running commands, moving files Built in: the server injects execd into every sandbox and proxies to it; any image works Not built in: the SDK talks to a runtime server that the sandbox image must contain, directly or through a separate sandbox-router Deployment [M17]
SDK Python and others, opensandbox==1.2.1 [F1] Python (k8s-agent-sandbox 1.0.12 on PyPI), Go, TypeScript [M17]
MCP server opensandbox-mcp==1.2.1, the one the design uses [F4] One in the repository (clients/integrations/mcp-server): create from a warm pool, run a command, upload, download, list, delete [M17]
Runtime selection One runtime per server, in its config file [M1] Per sandbox: runtimeClassName in the pod template. A gVisor sandbox was Ready in 1.6 s in the probe [M15]
Warm pool Not in the pieces the lab enables SandboxWarmPool in the extensions [M17]
arm64 images Yes [K18] Yes: controller and router v1.0.12 are published for arm64 and amd64. The router's own deploy manifest references a latest tag that does not exist [M16]
Works with the DeepSeek Harness Inferred for the CLI [F5]; untried through the SDK Unknown [M18]
What the lab has already written and probed Values, namespaces, create/command/delete, both runtimes One Sandbox object in a probe

Outcome for (b)

Decided as recommended: keep OpenSandbox. It does more of what the demo needs out of the box: a lifecycle API, command execution in any image, a matching MCP server. The lab's design, values and two probes are built on it, and in both probes it ran on Kubernetes 1.37.

agent-sandbox is the stronger candidate on two of the criteria: it has no Kubernetes version gap, and it is the Kubernetes SIG's own API. It would cost the lab a sandbox image with a runtime server in it, the router, and a rewrite of the execution path of the design. If the real check of OpenSandbox on 1.37 fails on the cloud cluster (risk R2), agent-sandbox is the first fallback, by the owner's decision, ahead of lowering the Kubernetes version.

3. How the repository is arranged now

The runtime is a pluggable choice with a default, not a fixed layer. Nothing was removed: Kata's values, its Local overrides and its monitors are all still there.

  • Each profile lists sandbox_runtimes: [gvisor, kata, runc]. The first is the default: gVisor. make <target> SANDBOX_RUNTIME=kata selects the opt-in.
  • Steps that belong to one runtime carry runtime: [...]: the kata step (the kata-deploy chart) and the gvisor step (its RuntimeClass). runc needs none.
  • OpenSandbox gets its runtime from one of three small files layered on the shared values: runtime-kata.yaml, runtime-gvisor.yaml, runtime-runc.yaml.
  • gVisor's node side is in components/gvisor/: what to put on the node, the containerd drop-in, the RuntimeClass.
  • In Local the default route is an OrbStack machine; the Kata opt-in needs a Lima VM (deployment-options.md, section 3).
  • make virtual-test renders every profile once per runtime (12 variants) and checks that the OpenSandbox config names the selected runtime, that the RuntimeClass it names is created by an earlier step, and that the three runtime files differ in nothing else [M20]. It cannot check that runsc is on a node.

4. What was decided, and what stays open

# Question Decided (owner, 2026-11-27) What it changes
1 Default sandbox runtime gVisor, for both options Local runs in OrbStack, with no Lima and no Kata overrides; sandbox start is about 2 s instead of about 20 s and the warm pool goes; the Local memory budget loses about 0.9 GiB of requests. In Cloud the default path does not need KVM, and node preparation gains a gVisor install. The demo says "isolated by a user-space kernel", not "VM-isolated"
2 Kata Kept as an opt-in, not removed Experiment 2 still has its VM arm; anyone can select it where KVM exists
3 cp-0 Stays bare metal until experiment 2 has run; revisited afterwards The Kata arm keeps a node it can run on. A regular instance would be enough for gVisor and cheaper; that is the question to come back to
4 Sandbox manager OpenSandbox; agent-sandbox is the named first fallback No change now. G1 stays an accepted gap until tested on the cloud cluster; if that fails, the execution path is redone on agent-sandbox

No decision in this document is open any more. What stays unknown, and is carried as risks in design.md:

Unknown Rows Risk Settled by
Whether the demo's image-processing code runs under gVisor M12 R22 Running the demo's two sandbox scripts in a gVisor sandbox; possible in Local
gVisor on the x86_64 cloud nodes: inferred from the arm64 probe only M11, M19 R24 The early OpenSandbox check on cp-0 (roadmap.md)
A command sent right after a sandbox is created can fail, so the client must retry M8 R23 The demo application; then a run under load
Sandbox egress rests on a NetworkPolicy, since OpenSandbox's egress sidecar does not work under gVisor M6, M7 R25 The egress test in make verify, on every deployment
Agentgateway to the model on the Mac through OrbStack, and OrbStack at its memory ceiling M23 - Bringing the local profile up in OrbStack