Skip to content

Sandbox strategy: OpenSandbox

Status: Accepted

Adopt the OpenSandbox spec as the sandbox standard. Run a rolling fork (sharpi/opensandbox) with the strategy: contribute upstream, ship before approval.

OpenSandbox defines agent sandboxing through 3 OpenAPI specs:

SpecPurpose
LifecycleCreate, start, stop, destroy sandbox instances. Image management.
ExecdExecute commands inside running sandboxes. Stdin/stdout/stderr streaming.
EgressNetwork policy: allowlists, denylists, domain-level filtering.

Any runtime that implements these 3 specs is a valid sandbox backend. The specs are backend-agnostic — gVisor, Kata, Firecracker, and Apple Container all implement the same API.

The rolling fork adds four features that don’t exist upstream:

ContributionPurpose
Apple Container backendNative macOS sandbox using Apple’s Virtualization.framework. Enables sandbox mode on developer Macs without Docker.
Credential proxySecrets never enter the sandbox directly. The proxy sits between the IAM provider and the sandbox, injecting secrets into an isolated namespace with per-access audit logging.
Policy engineTemplate-driven egress rules. Egress inferred from capabilities + [overrides].egress compiled into sandbox network policy.
Go SDKClient library for the 3 OpenAPI specs. Used by cli/internal/sandbox/ to drive sandbox lifecycle from arpi spawn.
  1. Develop features in sharpi/opensandbox fork.
  2. Ship internally immediately — do not wait for upstream approval.
  3. Submit upstream PRs for each contribution.
  4. Rebase on upstream releases. If a contribution is accepted upstream, drop our fork’s version.
  5. If upstream diverges incompatibly, maintain the fork.

Docker Sandboxes — Docker’s proprietary sandbox API. No open spec, no backend pluggability, vendor lock to Docker runtime. OpenSandbox achieves the same isolation with an open spec and multiple backends.

OpenSandbox is consumed by the Compute domain (see template-schema.md). The control plane calls the OpenSandbox API through the SandboxProvider interface when a template’s [compute] section requests a sandbox.

Agent sandboxing needs a spec, not a product. Without a spec:

  • You’re locked to one vendor’s runtime.
  • You can’t swap backends (gVisor locally, Firecracker in prod).
  • You can’t contribute isolation improvements to an ecosystem.

OpenSandbox is Apache 2.0, spec-first, and already has multiple backend implementations. Our Apple Container backend contribution makes it usable on macOS — the primary developer platform.

Updated 2026-03-27

The sandbox strategy is accepted but partially implemented. Docker Go SDK is the v1 sandbox backend and is production-ready for container lifecycle management. The OpenSandbox spec remains the target architecture, but the Go SDK is not yet available (expected Q1 2026 on the OpenSandbox roadmap — still pending).

ContributionStatus
Apple Container backendDEFERRED — requires macOS 26+ (Apple Containerization framework is pre-1.0, Swift-native, no Go SDK). Revisit when macOS 26 ships.
Credential proxyDEFERRED — blocked on OpenSandbox fork. Currently secrets are injected via infisical run environment variables in sandbox mode.
Policy engineDEFERRED — depends on OpenSandbox egress spec.
Go SDKDEFERRED — OpenSandbox upstream has not shipped a Go SDK yet. CLI shells out to Docker SDK for container lifecycle.

The opensandbox/ git submodule does not yet exist. The environments/ domain described in this ADR has not been built — execution environment config currently lives in infra/.

CriterionStatus
arpi spawn in sandbox mode calls OpenSandbox lifecycle APIDEFERRED — uses Docker Go SDK
Apple Container backend works on macOS without DockerDEFERRED — macOS 26+
Credential proxy injects secrets without container env dumpDEFERRED — uses env var injection
Egress policy compiled from definitionDEFERRED — no policy engine yet
Go SDK covers all 3 OpenAPI specsDEFERRED — no upstream Go SDK
Fork rebases cleanly on upstream releasesDEFERRED — no fork created yet
  • arpi spawn in sandbox mode calls OpenSandbox lifecycle API, not Docker CLI
  • Apple Container backend works on macOS without Docker installed
  • Credential proxy injects secrets without them appearing in container env dump
  • Egress policy compiled from definition blocks all non-gateway traffic
  • Go SDK covers all 3 OpenAPI specs with typed client
  • Fork rebases cleanly on upstream releases