Sandbox providers: E2B, Modal, Daytona and Cloudflare

Upstream research checked on 2026-10-24. These packages extend the existing ComputeProvider contract. They do not create a second session manager or replace devctrl's Docker runtime, PTY broker or account isolation.

Current validation status: implemented; 41 focused fixture cases and a scoped TypeScript noEmit check pass under official Node 24.22.1. Five actual Linux behavior cases also pass after the preserved guard failure described below. No cloud account, secret, paid API, sandbox, Worker or image build was used. The adapters are not yet wired into the controller or installer. A package existing in this repository does not establish that its sandbox can run an entire devctrl execution host.

Provider Implemented lifecycle Execution Persistence exposed Creation recovery Current status
E2B Create, read-only inspect, kill Official SDK buffered commands plus shared durable shell receipts Explicit opt-in filesystem-only pause/connect; default disabled Uncertain create is not replayed Implemented; SDK contract and cloud behavior unverified
Modal Create in an existing App, inspect/poll, terminate and poll termination Official JS SDK command streams/wait plus shared shell receipts None; snapshots and memory restore intentionally not exposed Uncertain create is not replayed Implemented; SDK contract and cloud behavior unverified
Daytona Create, inspect, wait for delete Official SDK executeCommand plus shared shell receipts Explicit opt-in native stop/start; default disabled Uncertain create is not replayed Implemented; SDK contract and cloud behavior unverified
Cloudflare Sandboxes Authenticated operator Worker, Durable Object identity, native start/inspect/destroy, lifetime alarm Current Durable Object container exec plus shared shell receipts Explicit opt-in filesystem snapshot before stop and restore from that exact handle Stored identity and immutable creation parameters; tombstone survives replay Implemented companion bridge; Wrangler deployment and cloud behavior unverified

All manifests currently disable Docker, browser, public-port, arbitrary snapshot and fork claims. Native upstream features alone do not prove support through this adapter. Usage and pricing methods are absent: none of these integrations converts model tokens, subscription usage or list prices into actual charges. The existing execution-host admission path must continue refusing a sandbox that cannot satisfy its Docker, networking or security requirements.

Official interfaces and installation

The SDK packages are optional dependencies of their individual provider package, with versions checked against the official package registry. Loading another provider never imports these SDKs. Missing SDKs produce a bounded operation failure. SDK contracts are represented by small injectable public interfaces; fixture checks do not substitute for installing and checking the real SDK.

Cloudflare: current API, not a fabricated public REST service

Cloudflare currently exposes Linux sandbox containers through a Worker and its own Durable Objects. The old @cloudflare/sandbox 0.x getSandbox integration is not the current API. See the current overview, package reference and Durable Object container API. The current @cloudflare/sandbox 1.0.3 package provides file/storage helpers; lifecycle and execution use ctx.container directly, so the bridge does not need an unused SDK dependency.

provider-cloudflare-sandbox includes an operator-deployed worker.mjs, native controller implementation, Dockerfile and wrangler.example.jsonc. Its /v1/sandboxes/:id/:action routes are devctrl's own authenticated bridge protocol, not Cloudflare API endpoints. The URL must be an HTTPS origin and the bridge requires an independent >=32-character secret. Keep the Cloudflare account API token outside the sandbox and bridge request payloads.

The example uses the documented durable_object scheduling policy and named container image configuration. Build the provider and shared kit before Wrangler bundles the Worker. A sufficiently recent installed Wrangler is required; do not run an implicit package download during normal provisioning. Configure DEVCTRL_BRIDGE_TOKEN using Wrangler's secret mechanism, then deploy explicitly. No deployment command has been run here. The image pins Node 24.22.1 and installs Linux process tools; it does not expose a Docker daemon.

Creation identity is persisted before booting and the native container must execute true before returning ready. Commands are serialized with explicit stop/snapshot operations. Stop saves the actual native snapshot ID before stopping, and resume never silently substitutes an empty image if restoration fails. Native snapshots contain the writable filesystem, not memory, processes or mounts; see save/restore. They can contain account data written later, so filesystem persistence is explicitly disabled unless authorized. Deleting a container or its saved reference does not prove remote snapshot erasure; provider retention still applies. Platform inactivity/restarts may discard changes after the last explicit snapshot. This is not a guarantee of uninterrupted native processes.

Shared buffered-exec job receipts

@devctl/cloud-provider-kit/managed-command exports:

type ManagedShellExec = (
  resourceId: string, script: string, timeoutSeconds: number,
) => Promise<{
  exitCode: number | null; stdout: string; stderr: string; running: boolean;
}>;
executeManagedCommand(execSync, resourceId, command);
inspectManagedProcess(execSync, resourceId, processId);

The default command limit is 30 seconds; the maximum is 600 seconds and 64 KiB of script. The detached implementation requires Linux/procfs, POSIX sh, GNU coreutils, setsid, awk and nohup. It creates a private 0700 resource-bound receipt directory, starts a supervisor in its own session, enforces a command timeout and records actual exit status atomically. A process is live only while its PID and Linux birth identity match. A missing receipt, changed identity, unsafe link or invalid frame is an explicit failure, never invented success.

User code is passed as encoded file content, not interpolated shell syntax. Scripts are removed after completion. Output files have process file-size limits, polling returns at most 64 KiB per stream, and a resource admits at most 128 detached receipt directories. Receipts live only inside their resource and are removed with it; provider TTL and explicit destruction are the cleanup strategy. This is execution bookkeeping within a sandbox, not a security boundary against malicious code running as the same user or a hard guarantee for daemons that escape their original process group.

A raw executor must preserve at least 180,000 stdout bytes for the framed base64 polling result. Adapter-level 64 KiB truncation would corrupt the receipt. Providers must also preserve detached children after a one-shot exec returns. Local shell validation alone cannot establish that upstream property; it remains explicitly unverified for these cloud providers. Lost launches or creation responses are never automatically replayed. No prompts, credentials, provider error bodies or command text enter adapter telemetry.

Wiring still owned by the shared integration layer

  1. Add the four optional provider dependencies to the controller/host or provisioner package that actually loads ComputeProvider modules, then update the root lockfile deliberately. This change does not edit either.
  2. Register the provider IDs in the existing compute registry and use the existing encrypted credential store. E2B/Daytona use their own API key; Modal uses its explicit JSON pair; Cloudflare uses a scoped bridge secret.
  3. Persist non-secret per-provider configuration in the existing integration settings: E2B template, Modal App/image/environment, Daytona snapshot/target, Cloudflare Worker origin. An explicit Internet checkbox does not replace devctrl's project egress enforcement; gate full host enrollment until the effective project policy is enforced.
  4. Keep filesystem persistence opt-in and disclose native retention. Do not copy existing account homes or secrets into provider snapshots without an authorized export policy. No snapshots/forks/public ports should be enabled merely because upstream documents them.
  5. Execute the focused SDK fixtures and typechecks in the single allocated local job window. The shared helper has additional real Linux cases that skip on non-Linux hosts; run them in an owned disposable Linux environment to validate actual detached survival, timeout, exit, missing receipts, links and PID reuse. The cloud end-to-end checks remain separately gated and must never run in ordinary CI or spend a paid account automatically.

The focused ordinary selection ran once under official Darwin Node 24.22.1: 46 total, 41 passed, 5 explicitly skipped Linux cases, no failures, 4.586 seconds. Scoped TypeScript noEmit passed in 3.285 seconds without installing an SDK. Owned inputs, existing dependencies and links matched before/after. These are SDK contract fixtures against the documented public interface; the real optional SDK dependency tree has not yet been installed/type-verified.

A separate actual-Linux supplement first rejected an outdated cached Node 24.21.0 image before executing any behavior. The authorized follow-up used the repository's official pinned Node 24.22.1 bookworm-slim image. It reproduced two real shell-guard failures: POSIX set -e does not enforce intermediate && checks. Linked output and a mismatched process birth identity were incorrectly accepted. The original 3/5 RED remains preserved. Required guard chains now exit explicitly on failure; no assertion was changed.

The exact same five Linux cases then passed 5/5, no skips, in 2.044 seconds: real detached output/nonzero exit and executor reconstruction; timeout exit 124; missing final receipt; linked output sentinel; and PID birth mismatch. The container had no network, a read-only root, one CPU and 512 MiB memory. Its only writable filesystem was bounded temporary storage. Both test containers were removed and all preexisting container identities were unchanged. This proves local Linux behavior, not upstream provider child survival or full host bootstrap. The 41 fixture passes and TypeScript check predate this guard-only fix; further integrated SDK validation remains required.