Skip to main content

How They Work

Container sandboxes (e2b, Daytona, Modal, Cloudflare Containers) run each execution in an isolated VM or container with its own OS, filesystem, and network stack. You connect over a network API. Secure Exec runs each execution in a V8 isolate inside your Node.js process. There is no separate container, no network hop, and no vendor dependency. Isolation is enforced at the V8 engine level — the same technology that powers Cloudflare Workers.

Comparison

DimensionSecure ExecContainer Sandbox
IsolationV8 isolateVM / container
PerformanceNative V8Native container
Cold start~16 ms (p95)~950 ms (best provider)
Memory baseline~3.4 MB~256 MB minimum
PermissionsGranular, deny-by-defaultCoarse-grained
Infrastructurenpm installVendor account + API keys
HardwareYour choiceVendor-locked
EgressNone (in-process)Per-GB fees
Language supportNode.js, PythonAny (full OS)
FilesystemVirtual, scopedFull OS filesystem
Network accessConfigurable per-executionFull (or firewall rules)

When to Use Each

Use Secure Exec when:

  • You need fast, lightweight code execution (AI tool calls, user scripts, plugins)
  • You want no vendor dependency and full control over infrastructure
  • You need granular permissions (file, network, module-level)
  • Cost matters at scale — especially for high-concurrency lightweight workloads

Use a container sandbox when:

  • You need a full OS environment (install system packages, run arbitrary binaries)
  • You need languages beyond Node.js/Python with full OS-level access
  • You need persistent, long-lived environments (multi-hour dev sessions)
  • Workloads are heavyweight enough that the 256 MB minimum doesn’t matter

Cost

See Cost Evaluation for detailed per-second cost comparison across providers.