Agent Sandbox

Agent Sandbox Installation

This guide shows how to install Agent Sandbox resources on Kubernetes in Docker (KinD) and on GKE.

Prerequisites

  • A Kubernetes cluster running 1.25 or later with CRD CEL validation rules enabled. On Kubernetes 1.25 through 1.28, keep the CustomResourceValidationExpressions feature gate enabled. If the gate is disabled when CRDs are installed, the API server drops the CEL rules. Sandbox name validation and volume claim template immutability are then not enforced. Kubernetes 1.29 or later is recommended because CRD CEL validation is stable and cannot be disabled. Each release is built against the latest Kubernetes libraries and tested with the newest Kubernetes release. Intermediate versions are expected to work but are not regularly tested.

  • For Gateway-based client connections, meet the Kubernetes version requirements of the installed Gateway API CRDs and controller. The full Gateway API v1.5.0 CRD bundle requires Kubernetes 1.31 or later because of its TLSRoute CEL validation.

  • kubectl CLI tool.

  • For KinD cluster you need:

  • For GKE cluster you need:

  1. Run command to create a cluster using KinD:

    kind create cluster --wait 90s --name agent-sandbox-test
    

    Or run these commands to create a cluster in GKE and get credentials to your cluster:

    gcloud container clusters create-auto agent-sandbox-test --region=us-central1
    gcloud container clusters get-credentials agent-sandbox-test --location us-central1
    
  2. Install the agent-sandbox controller and its CRDs with the following command:

    # Get the latest version of the release:
    VERSION=$(curl https://api.github.com/repos/kubernetes-sigs/agent-sandbox/releases/latest | jq -r '.tag_name')
    
    # To install only the core components:
    kubectl apply -f https://github.com/kubernetes-sigs/agent-sandbox/releases/download/${VERSION}/sandbox.yaml
    
    # To install the extensions components:
    kubectl apply -f https://github.com/kubernetes-sigs/agent-sandbox/releases/download/${VERSION}/extensions.yaml
    
    # Wait until all agent-sandbox-controller pods are running:
    kubectl -n agent-sandbox-system rollout status deployment/agent-sandbox-controller --timeout=90s
    
  3. Before using the client, you must deploy the sandbox-router. Follow these steps:

    warning

    The command below disables router authentication. Use only for local testing.

    curl -sSL https://raw.githubusercontent.com/kubernetes-sigs/agent-sandbox/refs/tags/${VERSION}/clients/python/agentic-sandbox-client/sandbox-router/sandbox_router.yaml | sed 's|${ROUTER_IMAGE}|us-central1-docker.pkg.dev/k8s-staging-images/agent-sandbox/sandbox-router:latest-main|g' | sed '/ALLOW_UNAUTHENTICATED_ROUTER/{n;s/value: "false"/value: "true"/}' | kubectl -n agent-sandbox-system apply -f -
    
    # Wait until all router pods are running:
    kubectl -n agent-sandbox-system rollout status deployment/sandbox-router-deployment --timeout=90s
    
  4. Create a Sandbox Template. For example the python-runtime-sandbox. More information about this runtime can be found here.

    curl -sSL https://raw.githubusercontent.com/kubernetes-sigs/agent-sandbox/refs/tags/${VERSION}/clients/python/agentic-sandbox-client/python-sandbox-template.yaml | sed -e 's|${SANDBOX_NAMESPACE}|default|g' -e 's|${SANDBOX_TEMPLATE_NAME}|test-sandbox-template|g' | kubectl apply -f -