kubernetes-sigs/agent-sandbox

▲ 114 stars today★ 3,903⑂ 514

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

About kubernetes-sigs/agent-sandbox

kubernetes-sigs/agent-sandbox is an open-source project on GitHub, mainly written in Go. agent-sandbox enables easy management of isolated, stateful, singleton workloads, ideal for use cases like AI agent runtimes and reinforcement learning (RL). It currently holds 3,903 stars and 514 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).

Project Overview

AI Homed tracks it on the Today's Trending board.

GitHub Repository Details

Repository kubernetes-sigs/agent-sandbox · default branch - · size 0 KB · watchers 0 · source: GitHub REST API and repository README

README

https://github.com/kubernetes-sigs/agent-sandbox/blob/HEAD/Agent Sandbox logo

Agent Sandbox

https://github.com/kubernetes-sigs/agent-sandbox/blob/HEAD/GitHub release https://github.com/kubernetes-sigs/agent-sandbox/blob/HEAD/Apache-2.0 license

Website · Docs · DeepWiki · Getting Started · Examples · Roadmap

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

This project is developing a Sandbox Custom Resource Definition (CRD) and controller for Kubernetes, under the umbrella of SIG Apps. The goal is to provide a declarative, standardized API for managing workloads that require the characteristics of a long-running, stateful, singleton container with a stable identity, much like a lightweight, single-container VM experience built on Kubernetes primitives.

[!NOTE]
Scope: Agent Sandbox is a sandbox orchestrator. It delegates low-level container isolation to secure "Sandbox Runtimes" (like gVisor or Kata Containers) by managing Pods configured to use these runtimes (via RuntimeClass).

Overview

Core: Sandbox

The Sandbox CRD is the core of agent-sandbox. It provides a declarative API for managing a single, stateful pod with a stable identity and persistent storage. This is useful for workloads that don't fit well into the stateless, replicated model of Deployments or the numbered, stable model of StatefulSets.

Key features of the Sandbox CRD include:

Extensions

The extensions module provides additional CRDs and controllers that build on the core Sandbox API to provide more advanced features.

Architecture

agent-sandbox follows the Kubernetes controller pattern. Users create a Sandbox custom resource, and the controller manages the underlying runtime resources.

Architecture Diagram

flowchart LR

User[User]

Claim[SandboxClaim] Template[SandboxTemplate] Sandbox[Sandbox]

Pod[Pod] Runtime[Sandbox Runtime]

WarmPool[SandboxWarmPool]

subgraph Extensions[Extensions] Claim Template WarmPool end

%% User paths User -->|creates| Sandbox User -->|creates| Claim

%% Claim workflow WarmPool -->|references| Template Claim -->|adopts| Sandbox

%% Pod handling Claim -->|adopts sandboxes from| WarmPool Sandbox -->|creates Pod| Pod

%% Runtime Pod --> Runtime

%% Warm pool WarmPool -->|pre-warms sandboxes| Sandbox

Installation

Standard Install (Core + Extensions)

Recommended for most users:

# Quick install (latest release):
kubectl apply -f https://github.com/kubernetes-sigs/agent-sandbox/releases/latest/download/sandbox-with-extensions.yaml

Or pin to a specific version (recommended for production and GitOps):

export VERSION="v1.0.2" kubectl apply -f https://github.com/kubernetes-sigs/agent-sandbox/releases/download/${VERSION}/sandbox-with-extensions.yaml

You can also render it directly from source with kubectl kustomize k8s/.

Selective Install

If you prefer to install components separately:

# Core only:
kubectl apply -f https://github.com/kubernetes-sigs/agent-sandbox/releases/latest/download/sandbox.yaml

Extensions (opt-in):

kubectl apply -f https://github.com/kubernetes-sigs/agent-sandbox/releases/latest/download/extensions.yaml

To pin to a specific version, replace "latest/download" with "download/".

Go SDK

To interact with the agent-sandbox programmatically from Go, use the Go SDK:

go get sigs.k8s.io/agent-sandbox/clients/go/sandbox@latest

The Go SDK currently ships from the repository's root Go module, so repository release tags such as v0.1.0 are also the Go SDK versions. For detailed installation and usage instructions, please refer to the Go SDK README.

Python SDK

To interact with the agent-sandbox programmatically from Python, use the Python SDK:

pip install k8s-agent-sandbox

For detailed installation and usage instructions, please refer to the Python SDK README.

Sandbox Router (Optional)

The Sandbox Router is an HTTP reverse proxy that routes traffic from SDKs and external clients to sandbox pods. It is useful for workloads using the Go or Python SDKs, or runtime environments (like Kata Containers and gVisor) where direct pod port-forwarding is unavailable.

For deployment manifests and setup options, see sandbox-router/deploy/.

Verify Installation

To check whether agent-sandbox is already installed on your cluster:

# Check for agent-sandbox CRDs
kubectl get crd sandboxes.agents.x-k8s.io

Check for the controller deployment

kubectl get deploy agent-sandbox-controller -n agent-sandbox-system

If the CRDs and controller deployment are present, agent-sandbox is installed.

Uninstallation

Before uninstalling, check for any in-use resources to avoid unexpected data loss:

# Check for existing Sandbox resources across all namespaces
kubectl get sandboxes -A

Extensions (only if installed):

kubectl get crd sandboxclaims.extensions.agents.x-k8s.io >/dev/null 2>&1 && kubectl get sandboxclaims -A kubectl get crd sandboxwarmpools.extensions.agents.x-k8s.io >/dev/null 2>&1 && kubectl get sandboxwarmpools -A kubectl get crd sandboxtemplates.extensions.agents.x-k8s.io >/dev/null 2>&1 && kubectl get sandboxtemplates -A
Warning: Deleting the CRDs will cascade-delete all custom resources of those types across all namespaces.

Once you have confirmed no resources are in use (or you are prepared to lose them), uninstall by deleting the manifest for the version installed on your cluster:

# Set the version installed on your cluster (e.g., "v1.0.2"):
export VERSION="v1.0.2"

Standard Install:

kubectl delete -f https://github.com/kubernetes-sigs/agent-sandbox/releases/download/${VERSION}/sandbox-with-extensions.yaml

Or, if you used the Selective Install:

kubectl delete -f https://github.com/kubernetes-sigs/agent-sandbox/releases/download/${VERSION}/extensions.yaml kubectl delete -f https://github.com/kubernetes-sigs/agent-sandbox/releases/download/${VERSION}/sandbox.yaml

For Helm-based installations, see the Helm chart README.

Configuration

For advanced scale and concurrency tuning (e.g., API QPS and worker counts), please see the Configuration Guide.

Getting Started

Once you have installed the controller, you can create a simple Sandbox by applying the following YAML to your cluster:

apiVersion: agents.x-k8s.io/v1beta1
kind: Sandbox
metadata:
  name: my-sandbox
spec:
  podTemplate:
    spec:
      containers:
  • name: my-container
image:

This will create a new Sandbox named my-sandbox running the image you specify. You can then access the Sandbox using its stable hostname, my-sandbox.

For more complex examples, including how to use the extensions, please see the examples/ directory.

Motivation

Kubernetes excels at managing stateless, replicated applications (Deployments) and stable, numbered sets of stateful pods (StatefulSets). However, there's a growing need for an abstraction to handle use cases such as:

While these can be approximated by combining StatefulSets (size 1), Services, and PersistentVolumeClaims, this approach is cumbersome and lacks specialized lifecycle management like hibernation.

Desired Sandbox Characteristics

We aim for the Sandbox to be vendor-neutral, supporting various runtimes. Key characteristics include:

Roadmap

The current Roadmap can be found at roadmap.md.

Security

For information on the security model, trust boundaries, and mitigations of Agent Sandbox, please refer to the Threat Model.

Community, Discussion, Contribution, and Support

This is a community-driven effort, and we welcome collaboration!

Note on PR Velocity: To maintain high velocity and keep our queues clean, this project uses stale PR management (30-day auto-stale and 15-day auto-close for inactive PRs) and allows maintainers to fast-track or take over approved community PRs. Please read our Contributing Guidelines for our full code review and PR policies.

AI-Assisted Code Reviews (Experimental)

To help improve our review velocity, we are currently experimenting with AI-assisted code reviews using CodeRabbit as our automated first-pass reviewer. Here is the workflow:

1. CodeRabbit will automatically review open PRs (skipping draft PRs and PRs without a signed CLA).

1. Interacting with CodeRabbit: CodeRabbit provides high-level summaries and walkthroughs, and acts as an automated gatekeeper that approves the PR once all issues are resolved. You can interact with it by commenting @coderabbitai on your PR (e.g., @coderabbitai review to request an incremental re-review, or @coderabbitai full review to re-evaluate the entire PR from scratch). 1. After automated review comments are addressed or marked resolved, maintainers will review the PR and provide final approval.

We actively welcome your feedback on the quality, relevance, and helpfulness of these automated reviews! As we iterate on this process, we also plan to evaluate and test different AI review tools to find the best fit for our project's workflow.

Contact Us

Learn how to engage with the Kubernetes community on the community page.

You can reach the maintainers of this project at:

Please feel free to open issues, suggest features, and contribute code!

Code of conduct

Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.

[owners]: https://git.k8s.io/community/contributors/guide/owners.md [Creative Commons 4.0]: https://git.k8s.io/website/LICENSE

GitHub Stars & Activity

3,903Stars
514Forks
0Open issues
GoLanguage

GitHub Popularity

GitHub stars3,903
Forks514
Open issues0
Primary languageGo
License-
Stars gained today114
Created-
Last pushed-

Trending History

Weekly boardrank #77 · ▲ 114 stars

Related AI Projects

1

ollama / ollama

Go★ 181,102⑂ 17,896▲ 140 stars
2

alibaba / open-code-review

Go★ 29,434⑂ 2,095▲ 2,756 stars
3

Tencent / WeKnora

Go★ 24,589⑂ 3,414▲ 696 stars
4

vxcontrol / pentagi

Go★ 24,524⑂ 3,140▲ 98 stars
5

googleapis / mcp-toolbox

Go★ 16,430⑂ 1,721▲ 8 stars
6

TencentCloud / CubeSandbox

Go★ 12,533⑂ 1,123▲ 259 stars
7

kserve / kserve

Go★ 5,938⑂ 1,676▲ 21 stars
8

aldinokemal / go-whatsapp-web-multidevice

Go★ 4,819⑂ 1,141▲ 26 stars

More AI Rankings