Steps
Verify cluster version and evaluation context
Run this check on your local workstation before installing any CRDs. Confirm that
kubectltargets a disposable Kubernetes 1.29+ cluster (or 1.25 through 1.28 withCustomResourceValidationExpressionsenabled) so you do not modify a production control plane during evaluation.kubectl version && kubectl config current-contextInstall the controller and create the evaluation Sandbox
Save the
eval-agent-sandbox.shscript below on your workstation and execute it. The script installs the pinnedv1.0.2coreagent-sandboxmanifest, waits foragent-sandbox-controllerinagent-sandbox-system, creates a disposable trustedSandboxnamedtest-eval-box, and waits for theReadycondition.Save as eval-agent-sandbox.sh on your workstation. The script applies the pinned v1.0.2 core agent-sandbox manifest, waits for agent-sandbox-controller in agent-sandbox-system, creates the disposable trusted test-eval-box Sandbox custom resource, and waits until kubectl reports Ready=True.
#!/usr/bin/env bash set -euo pipefail VERSION="v1.0.2" # 1. Install the core agent-sandbox CRD and controller kubectl apply -f "https://github.com/kubernetes-sigs/agent-sandbox/releases/download/${VERSION}/sandbox.yaml" # 2. Wait for the controller deployment to become available kubectl rollout status deployment/agent-sandbox-controller -n agent-sandbox-system --timeout=120s # 3. Apply a disposable trusted Sandbox custom resource kubectl apply -f - <<'EOF' apiVersion: agents.x-k8s.io/v1beta1 kind: Sandbox metadata: name: test-eval-box spec: podTemplate: spec: containers: - name: eval-container image: busybox:1.36 command: ["sh", "-c", "sleep 3600"] EOF # 4. Wait for the Sandbox controller to report Ready=True kubectl wait --for=condition=Ready sandbox/test-eval-box --timeout=120s kubectl get sandbox test-eval-box -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' echochmod +x eval-agent-sandbox.sh && ./eval-agent-sandbox.shInspect the installed CRD and managed singleton pod
Confirm from your workstation that the
sandboxes.agents.x-k8s.ioCRD is registered, the controller deployment is available, and thetest-eval-boxcustom resource is tracked by the API server.kubectl get crd sandboxes.agents.x-k8s.io && kubectl get deploy agent-sandbox-controller -n agent-sandbox-system && kubectl get sandbox test-eval-boxDisconnect and verify Sandbox readiness from a fresh shell
Close your current terminal session on your workstation and open a new shell to confirm the cluster control plane keeps the singleton pod running independently of your local session. Then query the
Readycondition ontest-eval-box.kubectl get sandbox test-eval-box -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}'This smoke test proves that CRD CEL validation accepted the
Sandboxmanifest,agent-sandbox-controllerreconciled it into a running singleton pod, and the pod remained ready after you closed your local terminal. It does not prove kernel isolation against untrusted code unless a gVisor or Kata ContainersRuntimeClassis explicitly configured and tested.The response contains True, verifying the Sandbox custom resource controller successfully scheduled the underlying singleton pod and achieved readiness. Before running real untrusted agent code, add a verified
runtimeClassName(gVisor or Kata Containers) tospec.podTemplate.spec, deploy the extensions manifest if you needSandboxWarmPoolallocation, and delete the evaluation resource withkubectl delete sandbox test-eval-boxwhen finished.
How the SIG Apps agent-sandbox controller works
Kubernetes Agent Sandbox is an open-source project under Kubernetes SIG Apps documented in the Kubernetes Agent Sandbox documentation and maintained in the kubernetes-sigs/agent-sandbox repository. It introduces a declarative Sandbox Custom Resource Definition (agents.x-k8s.io/v1beta1) and controller for long-running, stateful, singleton workloads that do not fit stateless Deployments or numbered StatefulSets.
Each Sandbox resource gives a single pod a stable hostname, optional persistent storage that survives restarts, and lifecycle controls including creation, pause, resume, and scheduled deletion. Optional extension CRDs (SandboxTemplate, SandboxClaim, and SandboxWarmPool) let platform teams pre-warm pools of ready pods for low-latency allocation, while Go and Python SDKs can connect through the optional Sandbox Router reverse proxy.
Critically, agent-sandbox is a sandbox orchestrator rather than a kernel isolation mechanism. It delegates low-level container isolation to a configured Kubernetes RuntimeClass such as gVisor or Kata Containers. Before deploying untrusted LLM-generated code, confirm that your cluster nodes actually provide and enforce that sandbox runtime.
When Kubernetes operational overhead is justified
Running agent-sandbox requires maintaining a Kubernetes 1.29+ control plane (or 1.25 through 1.28 with CustomResourceValidationExpressions enabled so CRD CEL validation rules are preserved), upgrading CRDs, managing node pools with gVisor or Kata Containers, and optionally deploying Gateway API CRDs or the Sandbox Router for SDK traffic. That operational burden pays off when your team already runs Kubernetes at scale, needs vendor-neutral on-cluster isolation for untrusted code, or runs high-throughput evaluation and reinforcement learning loops with warm pools.
If you do not operate a Kubernetes cluster, hosted sandbox APIs such as E2B or Modal offload runtime isolation and API orchestration to a managed service, while a bare VPS such as Hetzner or a dedicated Uno computer fits trusted workloads that only need a persistent Linux host. Do not use Uno as an isolation boundary for untrusted multi-tenant code execution; reserve Uno for trusted agent sessions where you want a persistent Linux environment with shared vCPU and NVMe storage.
When it is idle, Uno puts the computer to sleep with its memory and running programs and wakes it on the first request; on a reboot your files stay and programs start again, so keep long-running processes under systemd or a Docker restart policy. Long polling cannot wake a sleeping computer. An incoming request such as a webhook wakes it.
| Approach | Isolation boundary | Operational ownership | Best fit |
|---|---|---|---|
| Kubernetes Agent Sandbox | Cluster-configured RuntimeClass (gVisor or Kata Containers) | You manage Kubernetes 1.29+, CRDs, node runtimes, and routing | Teams already running Kubernetes who need on-cluster untrusted code isolation or warm pools |
| Hosted sandbox API (E2B, Modal) | Provider-managed sandbox isolation | Provider manages runtime and orchestration API | Ephemeral untrusted code execution without cluster administration |
| Uno computer or Linux VPS (Hetzner) | Dedicated Linux environment for trusted workloads | Standard Linux process management (systemd or Docker) | Trusted, long-running agent tools that need persistent files without Kubernetes |
Skip Kubernetes for trusted agent workloads
If your agent runs trusted code and does not require multi-tenant kernel isolation or cluster orchestration, an Uno computer gives you a persistent Linux environment with shared vCPU and NVMe storage without maintaining CRDs or RuntimeClass nodes.
Common problems
kubectl apply rejects the Sandbox CRD or drops CEL validation rules
Run kubectl version && kubectl get crd sandboxes.agents.x-k8s.io -o jsonpath='{.spec.versions[0].schema.openAPIV3Schema.x-kubernetes-validations}'.
Agent Sandbox requires Kubernetes 1.25 or later with CRD CEL validation enabled. On Kubernetes 1.25 through 1.28, if the CustomResourceValidationExpressions feature gate is disabled when CRDs are applied, the API server drops CEL rules and skips Sandbox name and volume claim immutability validation. Upgrade to Kubernetes 1.29 or later, where CRD CEL validation is stable and always enabled, then reapply the manifest.
The test-eval-box Sandbox stays Ready=False or never schedules a pod
Run kubectl describe sandbox test-eval-box && kubectl get events --sort-by='.lastTimestamp' | tail -n 15.
Inspect the events output for image pull failures, unschedulable node taints, or a missing RuntimeClass if you added one to podTemplate. Verify the cluster can pull busybox:1.36 or replace the image with a trusted image from your internal registry, then reapply test-eval-box.
The agent-sandbox-controller deployment fails to become ready
Run kubectl logs -n agent-sandbox-system deploy/agent-sandbox-controller --tail=50.
Check the controller logs in agent-sandbox-system for RBAC permission errors, API server connectivity timeouts, or pod scheduling failures. Ensure the kubectl context used during installation has cluster-admin privileges to create CRDs and ClusterRoles, and confirm your cluster has available node capacity.
The Sandbox pod runs, but untrusted code is not isolated from the node kernel
Run kubectl get runtimeclass && kubectl get pod -l agents.x-k8s.io/sandbox-name=test-eval-box -o jsonpath='{.items[0].spec.runtimeClassName}'.
An empty runtimeClassName means the pod uses the cluster's default container runtime. Because agent-sandbox is an orchestrator, it does not add kernel isolation by itself. Install and register a gVisor or Kata Containers RuntimeClass on your nodes and set runtimeClassName inside spec.podTemplate.spec before running untrusted code.
Go or Python SDK clients cannot connect to sandbox pods via direct port-forwarding
Run kubectl get deploy -n agent-sandbox-system.
Isolated runtimes such as gVisor and Kata Containers often do not support direct pod port-forwarding. Deploy the optional Sandbox Router HTTP reverse proxy from sandbox-router/deploy/ in the upstream repository and route SDK requests through it instead of direct pod forwarding.