skillfed

k8s-agent-sandbox

A client library to interact with the Agentic Sandbox on Kubernetes.

k8s-agent-sandbox v0.5.5 648.8K downloads/30d#5,582 on PyPI3,520
Permissive license Active released

What it is and what it does

k8s-agent-sandbox is a Python client for the Kubernetes Agent Sandbox Controller, enabling you to programmatically create, configure, and tear down isolated sandbox environments running inside a Kubernetes cluster. It abstracts away the complexity of pod lifecycle management and networking by providing a high-level interface that works as a context manager, ensuring proper resource cleanup.

The client supports four connection modes: Gateway Mode for production cloud deployments with load balancing, Tunnel Mode for local development via kubectl port-forward, In-Cluster Mode for workloads running inside the cluster that connect directly to sandbox pods, and Advanced Mode for custom networking scenarios. It depends on kubernetes, requests, pydantic, and prometheus-client, and includes optional async support for integration with async frameworks like FastAPI.

Use it for:

  • Local development and testing of agent code against isolated sandbox environments without needing a public cloud deployment.
  • Production agent orchestration on GKE or other managed Kubernetes services using the Gateway Mode for high-scale, load-balanced sandbox provisioning.
  • CI/CD pipelines that need to spin up ephemeral, isolated execution environments for testing untrusted or experimental code.
  • In-cluster agent workloads that spawn child sandboxes for subtasks, communicating directly via cluster DNS.
  • Custom networking scenarios where sandboxes are accessed through a specific domain or manually configured router URL.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A Python client library for creating and managing isolated sandbox environments on Kubernetes clusters, supporting multiple connection modes from local development to production cloud deployments.

Yes. The package is actively maintained with no known vulnerabilities, has low install friction, and fills a clear need for Kubernetes-native sandbox management. Install it if you are building agents or orchestration tools on Kubernetes and need reliable, scalable sandbox lifecycle management. The permissive Apache license and recent release cadence make it a safe production dependency.

Install

k8s-agent-sandbox on PyPI

pip

pip install k8s-agent-sandbox

uv

uv add k8s-agent-sandbox

poetry

poetry add k8s-agent-sandbox

Installing k8s-agent-sandbox

Before you install

Low install friction with a pure-Python wheel distribution. The package is actively maintained with a recent release and no known vulnerabilities. Runtime dependencies are standard and widely available (kubernetes, requests, pydantic, prometheus-client).

License in practice

Licensed under Apache Software License (permissive), allowing commercial and private use with minimal restrictions.

Quickstart

pip install k8s-agent-sandbox

from k8s_agent_sandbox import SandboxClient
from k8s_agent_sandbox.models import SandboxLocalTunnelConnectionConfig

client = SandboxClient(connection_config=SandboxLocalTunnelConnectionConfig())
sandbox = client.create_sandbox(warmpool="python-sandbox-warmpool", namespace="default")
try:
    result = sandbox.commands.run("echo 'Hello'")
finally:
    sandbox.terminate()

Requires a running Kubernetes cluster with the Agent Sandbox Controller installed and a deployed sandbox-router service; kubectl must be configured locally.

Verify before relying

  • Whether optional tracing dependencies (GCP OpenTelemetry integration) are production-ready or experimental.
  • Performance characteristics and latency overhead of the four connection modes under load.
  • Whether the async client API is feature-complete relative to the synchronous client.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.11)
Install friction low — pure-Python wheel
Runtime dependencies 4 — kubernetes, requests, pydantic, prometheus-client
Maintenance actively maintained — 1 days since the last release
Last repo commit
First released
Downloads 648,849/month — #5,582 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: k8s_agent_sandbox-0.5.5-py3-none-any.whl

License :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

kubernetes sandbox clientagent sandbox pythonk8s isolated execution environmentcontainerized sandbox managementkubernetes pod sandbox apiagent runtime sandboxk8s workload isolation
kubernetesagent-orchestrationsandbox-isolation

More Distributed Computing packages