Code sandbox
When an agent runs code, it does not run on the backend. Execution happens in an isolated, disposable environment with controlled egress, bound to one member and one conversation.
Isolation
Each run gets a locked-down, operator-created worker. The standard Kubernetes
deployment uses the cluster's normal container runtime; a platform operator can
attach a gVisor RuntimeClass for stronger syscall isolation. Network
egress is controlled rather than open: it is on by default
(SANDBOX_EGRESS_ENABLED = true) with the public_internet scope, so an
approved run can reach public HTTP/S addresses and nothing else. The
environment is disposable and scoped to the run.
Installing gVisor is not a Kaizen or Package Creator prerequisite. It must be installed and registered on eligible nodes by a cluster administrator only when the platform chooses that stronger posture. Staff who can install a Kamiwaza extension but cannot administer the cluster continue to use the normal operator-managed sandbox pool.
Three services cooperate:
| Service | Role |
|---|---|
| sandbox-controller | Allocates instances, maintains the warm pool, issues leases |
| sandbox-worker | Executes the code, single-tenant while leased |
| sandbox-egress-proxy | Mediates any outbound network access |
The worker has two jobs rather than one. Besides executing code it can host a browser session: one Chromium process rendering a live web page for a member's pane, inside the same boundary and on the same pool. That is a different workload on an existing service, not a fourth service, and it is described below.