You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Proposal: pluggable sandbox backends for isolated threads — Docker sbx, BoxLite and CubeSandbox
#18557
T3 should let users create an isolated thread from the web UI while the server manages its sandbox automatically. Users should not need to create a VM manually, expose another T3 server, or pair a separate environment for each thread.
This proposal builds on PR #15350's sandbox workflow and complements discussion #7841's Docker Sandboxes integration. It is also related to the process-lifecycle boundary discussed in #13081.
The proposed addition is a replaceable execution backend, with Docker sbx, BoxLite and CubeSandbox as initial microVM backend targets. This is a request to agree on direction and scope before implementation, not a competing implementation of #15350.
Our concrete use case is a self-hosted Linux T3 server accessed through the web UI, running parallel coding tasks that require microVM isolation. We have exercised a Docker sbx microVM with a private repository clone, T3, Rust and Python, and verified SSH access. That demonstrates basic runtime feasibility, not an integrated T3 backend. The manual environment and connectivity setup is the friction we want to remove. BoxLite and CubeSandbox adapters have not been validated against T3.
User experience
An administrator configures available backends on the machine running T3. A project can select a default backend and require microVM isolation.
When a user selects New sandbox:
T3 creates the workspace and sandbox, showing provisioning progress.
The agent, terminals and setup commands execute inside that sandbox.
Files, Git changes and previews remain accessible through the existing T3 UI.
Subsequent turns reuse the sandbox.
Stopping preserves its state; deletion explicitly handles any unexported work.
The browser continues using its existing T3 connection. No desktop application, client-side SSH configuration or per-sandbox pairing is required.
Backend boundary
Introduce a server-side SandboxBackend interface that expresses execution requirements without assuming Docker containers, SSH, shared host paths or a particular SDK.
Area
Responsibilities
Discovery
Availability, version, prerequisites and supported capabilities
Lifecycle
Create, start, inspect, stop, delete and recover existing sandboxes
Execution
Working directory, environment, streamed stdin/stdout/stderr, exit status and cancellation
Terminals
PTY creation, input, resize and close
Workspace
File access, change observation, Git operations and import/export
Connectivity
Authenticated previews and access to required T3 tools
Resources
CPU, memory and storage configuration
Backend-specific identifiers remain opaque to shared orchestration code. Persist the backend ID, sandbox ID, workspace association and configuration needed for recovery.
Optional features—snapshots, fast cloning and credential injection—should use explicit capability negotiation. Network enforcement capabilities must also be declared, but a deployment requiring outbound isolation must reject a backend that cannot enforce its requested policy. Unsupported requirements produce an actionable error. The exact interface is open for discussion; this is a behavioral contract rather than a proposed finalized API.
Isolation requirements
MicroVM isolation must be an enforceable policy, not merely a backend label.
Projects requiring microVMs cannot select ordinary-container or host execution.
Provisioning and recovery failures must never fall back to host execution.
Agents, terminals and setup scripts must share the same execution boundary.
Workspace files must not be executed on the host as a workaround.
Host credentials, Docker sockets and unrelated directories must not be mounted implicitly.
Backend replacement must be explicit; an existing thread cannot silently migrate to a different runtime.
Credentials should use backend-supported scoped injection where possible. Unsupported authentication methods should be surfaced rather than handled by copying entire host credential directories. Capability checks must cover the configured deployment and supported runtime version; a backend name alone does not establish its isolation guarantees.
Outbound network isolation
MicroVM isolation alone does not restrict outbound traffic. For our deployment, enforceable outbound isolation is mandatory alongside microVM isolation. The shared contract should describe the required policy and guarantees; each backend can implement them with its own host-side proxy, firewall or network layer.
Policy and authority
Default-deny outbound traffic for isolated sandboxes. Permit only explicitly approved services needed by the project, such as package registries and model APIs.
Compute the effective policy as the intersection of administrator limits, the project allowlist and any tighter thread policy. Project and thread settings may narrow administrator permissions, never expand them.
Treat repository-supplied policy files and agent requests as untrusted proposals. They cannot grant access or change administrative limits. An authenticated, authorized user must approve exceptions through the control plane.
Make rules explicit about destinations, protocols and ports. Backend-specific broad rules must not silently replace a narrower requested rule.
Define the restricted profile independently of vendor defaults; an adapter must not inherit a broader runtime default without surfacing it and satisfying the selected policy.
Enforcement boundary
Enforce policy outside the guest so an agent with root inside the microVM cannot disable it. Merely setting HTTP proxy environment variables or installing an in-guest firewall is insufficient.
Block access to host management interfaces, other sandboxes, private and special-use networks, and cloud metadata endpoints by default. Necessary access to T3 tools must use an authenticated, narrowly scoped channel rather than granting general access to the host network. Infrastructure exceptions require explicit administrator authorization.
Enforcement must cover IPv4 and IPv6, direct IP connections, TCP, UDP and DNS. A backend may block unsupported protocols rather than attempt incomplete filtering. Domain allowlists must validate the destination actually reached and account for DNS rebinding and DNS-to-connection races. An allowed domain must not become a route into a protected address range. Direct-IP, alternate-DNS, encrypted-DNS and proxy bypass attempts must not escape the effective policy. Explicitly approved general-purpose relays can undermine destination restrictions and must not be represented as narrow service access.
Adapters must report the enforcement capabilities of the configured runtime and deployment. If a required guarantee cannot be enforced, sandbox creation or policy application fails. There is no fallback to unrestricted networking, host execution or weaker isolation.
Policy lifecycle and visibility
Persist the effective policy and its revision with the sandbox. Revalidate enforcement when starting or recovering a sandbox; do not resume execution before the required policy is active. Policy tightening must either revoke affected existing connections or stop and recreate/reconfigure the sandbox before execution resumes. An adapter that cannot perform this safely must report that limitation rather than claim the update took effect.
Show blocked destinations and the relevant rule in the web UI, with an option for an authorized user to approve a narrowly scoped exception. Record policy changes and enforcement failures without logging credentials or request bodies. Agent-originated access requests must never be automatically approved merely because a task is blocked.
Where supported, inject scoped credentials outside the guest only for approved services. Secret injection is a separate capability and does not substitute for outbound filtering.
Backend mapping
The Docker sbx, BoxLite and CubeSandbox adapters translate the shared policy into their supported enforcement mechanisms. A capability declaration alone is not proof: qualify each supported backend version and deployment with conformance tests, including guest-root bypass attempts. Do not claim equivalent isolation until the relevant guarantees have been demonstrated.
Workspace design
Private workspaces should be supported without assuming identical host and guest paths.
T3's file browser, diff and Git operations need a workspace access interface that can operate inside the sandbox. Providers should receive sandbox-local paths. Exporting commits or files to the host should be an explicit operation.
This is an architectural question to settle with maintainers: which existing host-side filesystem operations must move behind that interface, and which can safely consume exported data?
Proposed backend targets
Docker sbx: local microVMs managed through its supported CLI.
BoxLite: embedded microVM execution through its SDK.
CubeSandbox: a self-hosted sandbox service accessed through its API/SDK. The adapter would manage sandbox lifecycle, execution, workspace access and connectivity.
CubeSandbox adds an important design constraint: the sandbox may run on another machine. The shared interface must avoid assuming local processes, host-mounted directories, directly reachable guest addresses or identical filesystem paths. MicroVM isolation must be verified for the configured deployment.
These are proposed targets, not a requirement to implement all three simultaneously. Validate the interface against a local backend and a remote CubeSandbox deployment early. Avoid designing a general plugin marketplace or promising every backend feature in the first release.
Verification
A shared conformance suite should verify:
Two concurrent threads have independent files, processes and services.
Agent and terminal execution occur inside the intended microVM.
Cancellation cleans up the appropriate process tree.
File editing, Git diffs and result export remain correct.
Previews and T3 tools work through the existing browser connection.
Server restarts reconnect to the correct sandbox.
Backend failure never causes host execution.
Stop preserves data, and deletion follows an explicit retention policy.
Backend-specific tests should verify declared capabilities and rejection of unsupported policies. Remote-backend tests should include connection loss and recovery without creating duplicate sandboxes or losing ownership of existing work.
Network conformance tests must demonstrate approved destinations work and unapproved destinations fail, including IPv4/IPv6 direct-IP access, alternate DNS, UDP/QUIC, DNS rebinding into protected networks, host management and metadata access, cross-sandbox traffic, and attempts to bypass the proxy from a guest-root process. Verify that project or agent input cannot widen administrator limits, backend/enforcer failure never permits unrestricted traffic, policy tightening handles existing connections, and restart/recovery preserves the effective policy. Test approved T3 tool access separately from prohibited general host access.
Proposed delivery
First agree on the backend and workspace boundaries alongside #15350. Then implement the shared contract with one microVM backend, validate it against a second backend with a different execution location, and add project-level isolation requirements and lifecycle controls in focused follow-up PRs. BoxLite and CubeSandbox support can land separately as their adapters meet the same contract.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Problem and intended workflow
T3 should let users create an isolated thread from the web UI while the server manages its sandbox automatically. Users should not need to create a VM manually, expose another T3 server, or pair a separate environment for each thread.
This proposal builds on PR #15350's sandbox workflow and complements discussion #7841's Docker Sandboxes integration. It is also related to the process-lifecycle boundary discussed in #13081.
The proposed addition is a replaceable execution backend, with Docker
sbx, BoxLite and CubeSandbox as initial microVM backend targets. This is a request to agree on direction and scope before implementation, not a competing implementation of #15350.Our concrete use case is a self-hosted Linux T3 server accessed through the web UI, running parallel coding tasks that require microVM isolation. We have exercised a Docker sbx microVM with a private repository clone, T3, Rust and Python, and verified SSH access. That demonstrates basic runtime feasibility, not an integrated T3 backend. The manual environment and connectivity setup is the friction we want to remove. BoxLite and CubeSandbox adapters have not been validated against T3.
User experience
An administrator configures available backends on the machine running T3. A project can select a default backend and require microVM isolation.
When a user selects New sandbox:
The browser continues using its existing T3 connection. No desktop application, client-side SSH configuration or per-sandbox pairing is required.
Backend boundary
Introduce a server-side
SandboxBackendinterface that expresses execution requirements without assuming Docker containers, SSH, shared host paths or a particular SDK.Backend-specific identifiers remain opaque to shared orchestration code. Persist the backend ID, sandbox ID, workspace association and configuration needed for recovery.
Optional features—snapshots, fast cloning and credential injection—should use explicit capability negotiation. Network enforcement capabilities must also be declared, but a deployment requiring outbound isolation must reject a backend that cannot enforce its requested policy. Unsupported requirements produce an actionable error. The exact interface is open for discussion; this is a behavioral contract rather than a proposed finalized API.
Isolation requirements
MicroVM isolation must be an enforceable policy, not merely a backend label.
Credentials should use backend-supported scoped injection where possible. Unsupported authentication methods should be surfaced rather than handled by copying entire host credential directories. Capability checks must cover the configured deployment and supported runtime version; a backend name alone does not establish its isolation guarantees.
Outbound network isolation
MicroVM isolation alone does not restrict outbound traffic. For our deployment, enforceable outbound isolation is mandatory alongside microVM isolation. The shared contract should describe the required policy and guarantees; each backend can implement them with its own host-side proxy, firewall or network layer.
Policy and authority
Enforcement boundary
Enforce policy outside the guest so an agent with root inside the microVM cannot disable it. Merely setting HTTP proxy environment variables or installing an in-guest firewall is insufficient.
Block access to host management interfaces, other sandboxes, private and special-use networks, and cloud metadata endpoints by default. Necessary access to T3 tools must use an authenticated, narrowly scoped channel rather than granting general access to the host network. Infrastructure exceptions require explicit administrator authorization.
Enforcement must cover IPv4 and IPv6, direct IP connections, TCP, UDP and DNS. A backend may block unsupported protocols rather than attempt incomplete filtering. Domain allowlists must validate the destination actually reached and account for DNS rebinding and DNS-to-connection races. An allowed domain must not become a route into a protected address range. Direct-IP, alternate-DNS, encrypted-DNS and proxy bypass attempts must not escape the effective policy. Explicitly approved general-purpose relays can undermine destination restrictions and must not be represented as narrow service access.
Adapters must report the enforcement capabilities of the configured runtime and deployment. If a required guarantee cannot be enforced, sandbox creation or policy application fails. There is no fallback to unrestricted networking, host execution or weaker isolation.
Policy lifecycle and visibility
Persist the effective policy and its revision with the sandbox. Revalidate enforcement when starting or recovering a sandbox; do not resume execution before the required policy is active. Policy tightening must either revoke affected existing connections or stop and recreate/reconfigure the sandbox before execution resumes. An adapter that cannot perform this safely must report that limitation rather than claim the update took effect.
Show blocked destinations and the relevant rule in the web UI, with an option for an authorized user to approve a narrowly scoped exception. Record policy changes and enforcement failures without logging credentials or request bodies. Agent-originated access requests must never be automatically approved merely because a task is blocked.
Where supported, inject scoped credentials outside the guest only for approved services. Secret injection is a separate capability and does not substitute for outbound filtering.
Backend mapping
The Docker sbx, BoxLite and CubeSandbox adapters translate the shared policy into their supported enforcement mechanisms. A capability declaration alone is not proof: qualify each supported backend version and deployment with conformance tests, including guest-root bypass attempts. Do not claim equivalent isolation until the relevant guarantees have been demonstrated.
Workspace design
Private workspaces should be supported without assuming identical host and guest paths.
T3's file browser, diff and Git operations need a workspace access interface that can operate inside the sandbox. Providers should receive sandbox-local paths. Exporting commits or files to the host should be an explicit operation.
This is an architectural question to settle with maintainers: which existing host-side filesystem operations must move behind that interface, and which can safely consume exported data?
Proposed backend targets
CubeSandbox adds an important design constraint: the sandbox may run on another machine. The shared interface must avoid assuming local processes, host-mounted directories, directly reachable guest addresses or identical filesystem paths. MicroVM isolation must be verified for the configured deployment.
These are proposed targets, not a requirement to implement all three simultaneously. Validate the interface against a local backend and a remote CubeSandbox deployment early. Avoid designing a general plugin marketplace or promising every backend feature in the first release.
Verification
A shared conformance suite should verify:
Backend-specific tests should verify declared capabilities and rejection of unsupported policies. Remote-backend tests should include connection loss and recovery without creating duplicate sandboxes or losing ownership of existing work.
Network conformance tests must demonstrate approved destinations work and unapproved destinations fail, including IPv4/IPv6 direct-IP access, alternate DNS, UDP/QUIC, DNS rebinding into protected networks, host management and metadata access, cross-sandbox traffic, and attempts to bypass the proxy from a guest-root process. Verify that project or agent input cannot widen administrator limits, backend/enforcer failure never permits unrestricted traffic, policy tightening handles existing connections, and restart/recovery preserves the effective policy. Test approved T3 tool access separately from prohibited general host access.
Proposed delivery
First agree on the backend and workspace boundaries alongside #15350. Then implement the shared contract with one microVM backend, validate it against a second backend with a different execution location, and add project-level isolation requirements and lifecycle controls in focused follow-up PRs. BoxLite and CubeSandbox support can land separately as their adapters meet the same contract.
Questions for maintainers
All reactions