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

Agent Sandbox provides a standardized way to manage isolated, stateful, single-container workloads on Kubernetes. It addresses the gap where standard Kubernetes objects like Deployments (stateless) or StatefulSets (numbered sets) are too cumbersome for use cases requiring a long-running container with a stable identity and persistent storage, such as AI agent runtimes that need to execute untrusted code securely.

How it works

The project introduces a Sandbox Custom Resource Definition (CRD) and a controller that manages the lifecycle of a single pod with a stable hostname and network identity. It delegates low-level container isolation to secure "Sandbox Runtimes" (such as gVisor or Kata Containers) via Kubernetes RuntimeClass to ensure strong kernel and network isolation.

To scale management, it includes extensions:

  • SandboxTemplate: Defines reusable configurations for creating multiple similar sandboxes.
  • SandboxWarmPool: Maintains a pool of pre-warmed sandboxes to reduce startup latency.
  • SandboxClaim: Allows users to request and adopt sandboxes from a warm pool.

Who it’s for

  • AI Developers: Those building AI agents that need to execute LLM-generated code in secure, isolated environments.
  • Platform Engineers: Those providing cloud development environments or persistent notebook sessions (e.g., Jupyter).
  • DevOps Engineers: Those needing to host single-instance stateful services (like build agents) without the overhead of StatefulSets.

Highlights

  • Strong Isolation: Integrates with gVisor and Kata Containers for enhanced security when running untrusted code.
  • Stable Identity: Ensures each sandbox has a consistent hostname and network identity.
  • Lifecycle Management: Supports creation, scheduled deletion, pausing, and resuming of workloads.
  • Developer Friendly: Provides Go and Python SDKs for programmatic interaction with the Sandbox API.

Related

  • Project
  • Project
  • Dispatch
  • Project
  • Project