Skip to main content

k8s-agent-sandbox-awx

A broker-backed, kubeconfig-free overlay for the Agentic Sandbox client. It adds a BrokerSandboxClient that drives the sandbox control plane (create → wait ready → terminate, commands, and files) through one identity broker service over HTTPS instead of the Kubernetes API or a public router. The broker proxies authorized data operations to its internal router, so client applications need no kubeconfig and no direct Kubernetes or router access.

# Available after the 0.5.0 wheel is published.
pip install k8s-agent-sandbox-awx==0.5.0
from k8s_agent_sandbox_awx import Sandbox

sandbox = Sandbox.create()
result = sandbox.commands.run('echo "Hello from Agent Sandbox!"')
print(result.stdout)
sandbox.kill()

How it works

The client presents an audience-bound Kubernetes or GitLab OIDC token to the broker. The broker cryptographically verifies the caller from that token, creates the SandboxClaim under its own identity, and stamps the verified caller identity onto the claim — attribution the client cannot forge.

Set both broker_url and api_url to the broker URL. The model rejects a different api_url to prevent accidental direct-router bypass.

This package is a purely additive overlay: it builds on k8s-agent-sandbox-base (a seamed re-publish of the upstream client) and edits zero upstream files. The import package is k8s_agent_sandbox_awx.

Configuration

The zero-argument API reads:

Variable Purpose
AGENT_SANDBOX_BROKER_URL Public HTTPS broker endpoint
AGENT_SANDBOX_TOKEN_PATH Rotating Kubernetes projected-token file
AGENT_SANDBOX_TOKEN GitLab or other OIDC ID token
AGENT_SANDBOX_WARMPOOL Approved warm pool; defaults to python-sandbox-warmpool
AGENT_SANDBOX_NAMESPACE Broker-owned claim namespace; defaults to agent-sandbox
AGENT_SANDBOX_TTL_SECONDS Optional sandbox shutdown deadline

Kubernetes normally needs no Python authentication code:

from k8s_agent_sandbox_awx import Sandbox

with Sandbox.create() as sandbox:
    print(sandbox.commands.run("python3 -c 'print(6 * 7)'").stdout)

Mount a projected ServiceAccount token at the configured path with its audience set to the broker URL. The file is re-read on every request so token rotation is honored.

GitLab supplies the same zero-argument API using a native ID token:

job:
  id_tokens:
    AGENT_SANDBOX_TOKEN:
      aud: https://sandbox-broker.example
  variables:
    AGENT_SANDBOX_BROKER_URL: https://sandbox-broker.example
  script:
    - python app.py

Explicit authentication objects are available when environment discovery is not appropriate:

from k8s_agent_sandbox_awx import KubernetesAuth, OIDCTokenAuth, Sandbox

k8s = Sandbox.create(auth=KubernetesAuth("/var/run/secrets/tokens/broker"))
ci = Sandbox.create(auth=OIDCTokenAuth.from_env("MY_ID_TOKEN"))

The SDK deliberately has no provider="gitlab" or provider="kubernetes" switch. It transports the token; the broker derives the provider from the verified issuer and applies the matching policy.

Requirements

  • A deployed identity broker service reachable over HTTPS.
  • An OIDC token whose audience matches the broker's. Kubernetes projected tokens and GitLab id_tokens: are supported by the broker policy.
  • k8s-agent-sandbox-base (installed automatically as a dependency).

License

Apache-2.0 — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

k8s_agent_sandbox_awx-0.5.0.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

k8s_agent_sandbox_awx-0.5.0-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

Details for the file k8s_agent_sandbox_awx-0.5.0.tar.gz.

File metadata

  • Download URL: k8s_agent_sandbox_awx-0.5.0.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.11

File hashes

Hashes for k8s_agent_sandbox_awx-0.5.0.tar.gz
Algorithm Hash digest
SHA256 b2b5632e6a05f9176a820a73b6a1615de01eeec2a4dc72ba9c9bfe1f1da59703
MD5 c5e48f941793855cae905a4ad61dfd37
BLAKE2b-256 75ea6c22807edb8e6969a44e6087ab67bc488f1376d4e2226ebb172ac606b231

See more details on using hashes here.

File details

Details for the file k8s_agent_sandbox_awx-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for k8s_agent_sandbox_awx-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 803f4b711806cb4426f30550a372a3fbae44a439670ca11b8436f8ece8a7d92a
MD5 7ec077d565cb35721802b59d41ff1346
BLAKE2b-256 72a901f1f15b696cb353f7698f6723a70aec0c65f82de1aaa10c35a35feee207

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page