kubernetes-sigs/agent-sandbox

agent-sandbox enables easy management of isolated, stateful, singleton workloads, ideal for use cases like AI agent runtimes and reinforcement learning (RL).

What it solves

Kubernetes has strong patterns for stateless replicated apps (Deployments) and numbered stateful pods (StatefulSets), but many workloads need a long-running, single container that keeps a stable identity and persistent storage across restarts — for example AI agent runtimes executing untrusted code, reinforcement learning and evaluation loops, development environments, notebooks, or small single-instance services. Approximating these with StatefulSets, Services, and PersistentVolumeClaims is cumbersome and lacks specialized lifecycle features like pausing or hibernation. Agent Sandbox fills that gap with a declarative, standardized API.

How it works

Agent Sandbox adds a Sandbox Custom Resource Definition (CRD) and a controller that follows the standard Kubernetes controller pattern. You create a Sandbox object describing your pod and storage, and the controller manages the underlying Pod lifecycle — including creation, scheduled deletion, pausing, and resuming. Each Sandbox gets a stable hostname and network identity, and can be configured with persistent storage that survives restarts.

Isolation is delegated to secure "Sandbox Runtimes" such as gVisor or Kata Containers: the controller creates Pods configured via RuntimeClass to use those runtimes. The project also provides extensions: SandboxTemplate for reusable definitions, SandboxWarmPool for pre-warming sandboxes so new ones are ready quickly, and SandboxClaim to allocate a sandbox from a warm pool without needing to know the underlying configuration. There are Go and Python SDKs for programmatic access, plus an optional HTTP reverse proxy called Sandbox Router to route traffic to sandbox pods when direct port-forwarding is not available.

Who it's for

This is for teams running Kubernetes who need isolated, stateful single-pod workloads that don't fit Deployment or StatefulSet models — particularly AI agents running untrusted code, reinforcement learning and evaluation pipelines, cloud development environments, Jupyter-style notebooks, and stateful single-instance services that need a stable identity without the overhead of a full StatefulSet.

Highlights

  • Declarative Sandbox CRD with stable identity and persistent storage
  • Lifecycle management including creation, deletion, pause, and resume
  • Extensions: SandboxTemplate, SandboxWarmPool, and SandboxClaim
  • Delegates isolation to secure runtimes like gVisor and Kata Containers via RuntimeClass
  • Go and Python SDKs for programmatic use
  • Optional Sandbox Router HTTP proxy for client traffic
  • Requires Kubernetes 1.25+ with CRD CEL validation; 1.29+ recommended

Related

  • Dispatch
  • Project
  • Project
  • Dispatch
  • Project