Agent Sandbox
OpenClaw Sandbox Example
This example demonstrates how to run OpenClaw (formerly Moltbot) inside the Agent Sandbox.
This example demonstrates how to run OpenClaw (formerly Moltbot) inside the Agent Sandbox.
Prerequisites
- A Kubernetes cluster (e.g., Kind).
- (Optional) Ensure your cluster has a RuntimeClass (e.g.,
gvisor) configured and nodes support it. This example is verified using gVisor. Theopenclaw-sandbox.yamlmanifest includes a commented-outruntimeClassName: gvisorline. Uncomment it or update it if you are using a non-default runtime class (e.g., Kata Containers). See the gVisor documentation. agent-sandboxcontroller installed.
Usage
-
(If using Kind) Load the image into Kind:
kind load docker-image ghcr.io/openclaw/openclaw:2026.3.23 -
Generate a secure token:
export OPENCLAW_GATEWAY_TOKEN="$(openssl rand -hex 32)" -
Apply the Sandbox resource (replacing the token placeholder):
kubectl apply -f openclaw-config.yaml sed "s/dummy-token-for-sandbox/$OPENCLAW_GATEWAY_TOKEN/g" openclaw-sandbox.yaml | kubectl apply -f - -
Access the Web UI:
Option 1: Direct Port-Forward (Only if NOT using gVisor) Verify the pod is running and port-forward to access it directly:
kubectl port-forward pod/openclaw-sandbox 18789:18789Then open http://localhost:18789 in your browser.
Option 2: Access with gVisor Enabled If you enable gVisor by uncommenting
runtimeClassName: gvisorinopenclaw-sandbox.yaml, directkubectl port-forwardto the pod will fail (see Issue #158).To access the Web UI with gVisor, you must use an alternative method:
- Kubernetes Service: Expose the sandbox pod via a
NodePortorLoadBalancerservice and access it via the service’s endpoint. - Router Architecture: Use the
sandbox-routerto proxy traffic. See agentic-sandbox-client and sandbox-router for instructions.
- Kubernetes Service: Expose the sandbox pod via a
CLI Operations
You can run OpenClaw CLI commands directly inside the sandbox container.
kubectl exec -it openclaw-sandbox -- openclaw --help