sandbox run [OPTIONS]
--agent <claude|codex|opencode|copilot|grok> default: claude
--tier <1|2|3> default: 1
--profile <NAME> numeric (1|2|3) aliases --tier; named
resolves ~/.sandbox/profiles/<name>.yaml
or <overlay>/profiles/<name>.yaml
--repo <PATH> required for tier 2/3; repeatable —
with one repo the workspace is
/workspace, with two or more each
mounts at /workspace/<basename>
--allow-domain <DOMAIN> repeatable; blocked list applies
--base-url <URL> opencode: OpenAI-compatible endpoint;
overrides OPENCODE_BASE_URL env var
--infra-token <PATH> tier 3; injected as $INFRA_TOKEN
--infra-kubeconfig <PATH> tier 3; mounted at /home/agent/.kube/config
(auto-minified to a single context,
API server host/port auto-allowlisted)
--infra-kube-context <NAME> context inside --infra-kubeconfig
(default: kubeconfig's current-context)
--allow-exec-plugin skip the exec-plugin confirmation prompt
(only useful for scripted runs; plugin
will still fail at auth time)
--infra-endpoint <URL> tier 3, repeatable
--dry-run
--name <name> human-readable label (auto-set if omitted)
--keep-alive leave pod running after disconnect
(default: tear down to free cluster resources)
--i-accept-unmasked-secrets launch despite secrets the mask won't
hide (printed; the agent will see them)
sandbox resume <SESSION_ID> [--keep-alive]
sandbox list
sandbox logs <SESSION_ID>
sandbox flows <SESSION_ID>
sandbox stop <SESSION_ID>
sandbox profile save [--tier N] [--agent NAME] [--repo PATH]
[--allow-domain DOMAIN]... [--name NAME]
[--force] [--dry-run]
# --tier required; --agent and --repo optional.
# name auto-derived from repo + agent if omitted.
sandbox profile list
sandbox profile show <NAME>
sandbox profile delete <NAME> [--yes]
sandbox secret set <NAME> [--from-file PATH | --from-env[=VAR]] # else reads stdin
# NAME must match [A-Z_][A-Z0-9_]* — it's the env var
# the agent sees inside the pod. --from-env defaults
# the source var to NAME; use =VAR to override.
sandbox secret list # names + sizes + mtimes; values never printed
sandbox secret delete <NAME>
sandbox mask add --repo <PATH> <RELPATH>... # hide file(s) from the agent (per-repo)
sandbox mask list --repo <PATH> # built-in + configured masked paths
sandbox exceptions add --repo <PATH> <RELPATH:RULE:LINE>... [--reason TEXT]
# record reviewed secret-gate false positive(s) into the
# repo-root .betterleaksignore (native betterleaks format,
# shared with CI/pre-commit). Sandbox honors them only on a
# vetted repo. RELPATH:RULE:LINE is what the gate prints.
sandbox exceptions list --repo <PATH> # recorded .betterleaksignore fingerprints
sandbox exceptions migrate --repo <PATH> # convert a legacy accepted_secrets: list
sandbox vet --repo <PATH> [--message MSG] [--yes] # sign an agent-vetted/<sha> tag
# --yes: acknowledge recorded secret exceptions non-interactively
sandbox vet --status --repo <PATH> # print vetting state, sign nothing
sandbox cleanup [--older-than DAYS] default: 90
sandbox check <WORKSPACE_PATH>
sandbox status
sandbox install [--pod-cidr CIDR] [--service-cidr CIDR] [--apiserver-port PORT] [--dns IPS]
[--vm-cpus N] [--vm-memory GIB] [--vm-disk GIB] # macOS/Lima only
sandbox setup [...] # alias of `install` (compat)
sandbox uninstall [--yes] [--keep-logs] [--keep-images]
[--keep-lima] [--keep-kubetools]
sandbox upgrade [--app] # default: update the CLI itself
[--to vX.Y.Z] [--remote NAME] [--rebuild]
sandbox upgrade --infra | --k3s | --cilium | --gvisor | --betterleaks | --all
[--to-k3s VER] [--to-cilium VER] [--to-gvisor REL] [--to-betterleaks VER]
[--force]
[--dry-run] [--yes] # shared by both phases
sandbox configure-network # Linux only; re-detect host
# interfaces, re-apply to Cilium
# (also auto-run by `sandbox run`)
sandbox rebuild [--agent NAME] [--tier3] [--no-cache]
[--codex-version VER] [--opencode-version VER]
[--copilot-version VER] [--grok-version VER]
sandbox version [--short | --json] # reads the identity embedded at
# release/install time; a fresh,
# never-installed checkout: "dev"
sandbox version reports an identity that is resolved once and embedded, never
recomputed from git at runtime (so two clones of the same commit can't disagree
because one hasn't fetched tags):
- Released tarball —
task releasestamps the exact release version into a.versionfile in the artifact. - Source checkout —
sandbox installrunsscripts/stamp-version.sh, which derives the version from git (describe --tags --always --dirty) and writes.version(gitignored). Re-run it any time withtask stamp— e.g. after committing or switching branches. - Fresh checkout, never installed — no
.version, so it honestly reportsdev.
Because the stamp is frozen at install time, sandbox version won't reflect
edits made afterward until you re-stamp (task stamp); use git status for the
live working-tree state.
sandbox status— single-screen health check: cluster reachable, Cilium policy mode, gVisor RuntimeClass present, sandbox namespace exists, running session count. Also shows an Infra versions section — the k3s / Cilium / gVisor versions pinned insetup/versions.shnext to what is actually running, flagging drift. Run this first when anything looks wrong, or right aftersandbox installto confirm install succeeded.sandbox check <PATH>— dry-run of the pre-session workspace scan. Reports which files in the directory would be masked (.env,.npmrc,kubeconfig,*.pem, …) and previews the betterleaks secret gate (which unmasked secrets would block a realsandbox run) before you actually launch a Tier 2/3 session against it. Useful for catching credentials in a repo you've never sandboxed before.sandbox flows <SESSION_ID>— dumps the Hubble network flow records captured for that session (~/.sandbox/logs/<id>/flows.json, or live from Hubble if the pod is still running). Use this when a network request from inside the pod is silently failing — flow records show whether the packet was allowed, dropped by policy, or never sent.
-
sandbox install— installs and configures everything a host needs to run sessions: the k3s cluster, Cilium (CNI + network policy), the gVisor runtime, and the container images. Idempotent — safe to re-run to reconcile. Thin wrapper oversetup.sh;sandbox setupis a retained alias, and running./setup.shdirectly still works. Component versions come fromsetup/versions.sh(see Upgrading infrastructure). On macOS the cluster runs inside a Lima VM, and how many sandboxes run at once is bounded by that VM's resources. By default the VM is sized from the Mac's own hardware (host cores/RAM minus a reserve for macOS), so a larger Mac gets more concurrent sandboxes automatically. Override with--vm-cpus N,--vm-memory GIB,--vm-disk GIB(or theSANDBOX_VM_CPUS/SANDBOX_VM_MEMORY_GI/SANDBOX_VM_DISK_GIenvironment). Lima sizes the VM only at creation, so changing these on an existing VM needs a recreate (limactl delete sandbox-vm && sandbox install). These flags are inert on Linux, where the cluster runs directly on the host.On Windows the cluster runs inside a WSL2 distro, and concurrency is bounded the same way — by the WSL2 VM's RAM. WSL2 sizes that VM from the global
%UserProfile%\.wslconfig(default:min(50% of host RAM, 8 GB)), not from our tooling, so by default even a large machine may only fit one sandbox.setup.ps1prints a sizing advisory, and accepts opt-in-VmMemory <GB>/-VmCpus <N>that write[wsl2] memory=/processors=into.wslconfigand runwsl --shutdownfor you. Note this file is global to every WSL2 distro, not just the sandbox distro;setup.ps1never edits it unless you pass one of those flags (and backs it up first). -
sandbox uninstall— tears the cluster and host artifacts back down (mirror of install).--yesskips the prompt;--keep-logs/--keep-images/--keep-lima/--keep-kubetoolspreserve individual pieces. Wrapper overuninstall.sh. -
sandbox upgrade— moves your install forward. Two phases, one verb:- App (default,
--app) — fast-forwards this CLI checkout to the latest release tag (or--to vX.Y.Z), only when it's a clean fast-forward, so local edits and commits are never discarded.--remotepicks the git remote (defaultorigin);--rebuildrebuilds agent images afterward. A released tarball (no.git) can't self-update — the command prints the download link. See Updating the CLI. - Infra (
--infra, or--k3s/--cilium/--gvisor/--betterleaks) — moves the pinned host components to the versions insetup/versions.sh(which Renovate keeps current), or to an explicit--to-*target. The isolation stack (k3s/Cilium/gVisor) restarts k3s and can briefly disrupt the Cilium datapath, so it refuses to run while sessions are active unless--force; on macOS that stack runs inside the Lima VM and is not upgraded in place yet — the command prints the re-provisioning steps instead.--betterleaksis the exception: the secret scanner is a host binary, so it upgrades on any platform without the session guard. See Upgrading infrastructure. --all— does the app first, then re-executes the updated CLI so the infra phase applies the newly pulled pins.
--dry-run(show the plan, change nothing) and-y/--yesare shared. - App (default,
Sessions are automatically named for easy identification:
- Tier 1:
<agent>— e.g.claude - Tier 2/3, single repo:
<repo-basename>/<agent>— e.g.my-project/claude - Tier 2/3, multiple repos:
multi/<agent>— e.g.multi/claude
The name is used as the pod name prefix, making kubectl get pods output
readable. Override with --name <label> to set a custom name. The name
appears in the session banner at launch and in sandbox list.
ses-<YYYYMMDD>-<HHMMSS>-<4hex> — e.g. ses-20260401-143022-a7b3