PLATINUM DOCS

E2B alternatives for persistent agent sandboxes

Compare E2B alternatives for AI agent code execution: Platinum for persistent microVMs and shared volumes, or Modal for sandboxes alongside Modal workloads.

Last updated

Platinum and Modal are E2B alternatives for running AI agent code: choose Platinum for persistent microVM workspaces with versioned volumes, or Modal when your application already uses Modal Images and Volumes.

Stay on E2B for a stateful code interpreter or forks that preserve loaded variables. Choose by the state your agent needs between turns, not by the word “persistent” alone.

Compare the execution and state model

RequirementPlatinumE2BModal Sandboxes
Isolate agent codeAn isolated microVM per sandboxA Linux VM per sandbox (docs, checked November 2026)Choose a gVisor or VM runtime (docs, checked November 2026)
Keep a workspace between turnsPersistent by default; stop/start returns to the same sandbox, subject to retention timersPause preserves filesystem and memory; paused sandboxes remain until killed (docs, checked November 2026)Default lifetime is 5 minutes; configurable up to 24 hours per sandbox (docs, checked November 2026)
Share durable filesVersioned volumes mount into many sandboxes; each ordinary mount commits changes and pulls others' commitsVolumes outlive sandboxes; currently private beta (docs, checked November 2026)Sandboxes accept the named Images and Volumes used by Modal Functions (docs, checked November 2026)
Keep interpreter variablesCode execution is stateless; save results to filesCode Interpreter keeps variables between calls and returns rich results such as charts (docs, checked November 2026)Interpreter-variable persistence is not established by the cited Sandboxes guide (checked November 2026)

Pick Platinum for persistent workspaces

Platinum is an E2B alternative when an agent needs its own persistent microVM and files shared across several sandboxes. A volume outlives the sandbox that used it. Ordinary mounts are private working copies, not a live shared POSIX filesystem: commit changes to publish them, and pull to receive other sandboxes' commits.

Separate returning to the same agent from branching its workspace:

OperationPlatinum behavior
Stop, then startKeeps memory where supported. Inspect memory_saved and restore to distinguish memory restoration from a disk-only start.
CloneCreates a new sandbox from an existing disk snapshot.
ForkTakes a disk snapshot and clones it in one call. The parent keeps running.
Clone or fork with volumes mountedFails with volume_busy; detach volumes first, then attach them to the child.

A Platinum fork cold-boots from disk. It does not copy running processes or memory. See snapshots and what a stop saved. Do not treat a disk fork as a copy of an in-memory interpreter session.

Plan the E2B migration

Platinum is not a drop-in replacement for the E2B SDK. Use the E2B migration guide to map calls and behavior before changing a production agent. Test reconnects, process output, and file handoffs with a representative agent session before switching providers.

Existing assumptionChange for Platinum
Connecting resumes the workspaceconnect() returns a handle. Call start() or resume() explicitly.
Code calls share Python variablesStore state in files or manage a long-running process; runCode() is stateless and returns text output.
Command callbacks stream outputUse managed processes for streaming instead of buffered exec.
Fork includes attached dataTreat sandbox disk snapshots and volume history separately.

When to pick E2B

Keep E2B when preserving your existing Code Interpreter behavior matters more than changing the workspace model. Its Code Interpreter SDK keeps variables between calls and returns rich results such as charts (checked November 2026). That avoids rebuilding those behaviors around Platinum's stateless text-only code execution.

Keep E2B when you need to branch loaded variables and running processes. Its fork operation captures filesystem and memory, unlike Platinum’s disk-only fork (checked November 2026). The original pauses during capture and active connections drop, so reconnect clients afterward. This distinction matters for an agent comparing several continuations of an already-loaded interpreter session.

E2B also documents pause with both memory and filesystem preserved (checked November 2026). Do not switch solely to obtain persistence: compare the particular pause, fork, and shared-file semantics your agent needs.

When to pick Modal

Pick Modal as an E2B alternative when reusing Modal Images and Volumes is the deciding requirement. Its Sandboxes guide shows those resources shared with Modal Functions and offers both gVisor and VM runtimes (checked November 2026).

Plan around Modal's 24-hour maximum sandbox lifetime (checked November 2026). Modal recommends filesystem snapshots and a subsequent sandbox for work that must continue beyond that limit. A bounded execution job and a persistent agent identity need different lifecycle handling.