Loading…
Topic
Sandbox
10 posts about Sandbox. Every summary links to the original.
- 10 posts
- 4 companies
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
Newest first
Posts
Sandbox resourcing: burst, don't reserve
Modal Sandboxes are bursty workloads that spend most of their time using far less than peak CPU, making reservation-based pricing wasteful. The post argues that reserving capacity for each Sandbox’s peak would require machine capacity equal to the sum of all peaks, while bursting allows multiple Sandboxes to share capacity efficiently. Modal uses active-resource pricing where Sandboxes are billed for a default request when idle and pay for additional resources only when they burst. CPU can burst up to 16 cores above the request, and memory has no limit by default, though limits can be set for consistency or cost capping. Evictions are rare, with an SLO of under 0.0001% OOM rate per minute for Sandboxes under 8 GiB, and tools like exit snapshots and volumes help mitigate their impact.
How to Run Untrusted Code Safely
Running untrusted code requires stronger isolation than containers offer because containers share the host kernel and remain vulnerable to escapes, a threat classified by NIST SP 800-190 as critical and by MITRE ATT&CK as T1611. Network egress control must be allowlist-based rather than denylist-based, as code without filesystem access can still exfiltrate data or download payloads to attacker servers. Sprites provide hardware-isolated sandboxes with network policies enforced through an external API that code cannot modify, even with root access. They support checkpoint-based rollback, pre-installed runtimes for Python, Node, Ruby, Rust, Go, Java, Elixir, Bun, and Deno, and automatically sleep when idle. The post demonstrates creating a code-runner Sprite, applying a deny-all network policy, executing code via subprocess, and optionally permitting specific domains like api.openai.com while blocking all others.
What is an AI agent sandbox? A plain guide for 2026
An AI agent sandbox is an isolated environment where an agent runs code, installs software, edits files, and uses a browser without affecting the host machine or production systems, protecting against mistakes, prompt injection, secret exposure, and resource conflicts. Most sandboxes offer a shell, filesystem, network access, ports with preview links, and sometimes a desktop, all accessible through an SDK, API, CLI, or MCP server. Isolation includes OS-level rules, containers, user-space kernels like gVisor, microVMs like Firecracker, and full VMs, with stronger boundaries trading off slower start times. Sandboxes may be disposable, starting in milliseconds and vanishing after a task, or persistent, retaining disk and state across sessions for long-running agent work. BoxCompute offers persistent full Linux VMs with desktop access and per-second billing, suiting long-running agents, while microVM services fit high-volume short-lived sandboxes.
E2B alternatives in 2026: seven options compared
This 2026 comparison examines seven E2B alternatives for AI agent sandboxes, including Daytona, Modal, Vercel Sandbox, Cloudflare Sandbox, Northflank, Runloop, and BoxCompute. Daytona mirrors E2B’s pricing and adds no session cap but closed its core source in June 2026. Modal targets GPU-intensive Python jobs with gVisor-based sandboxes and filesystem snapshots kept for 30 days. Vercel and Cloudflare bill only for active CPU, reducing costs for agents that wait on model responses, with session limits of 45 minutes to 24 hours. Northflank offers the cheapest compute at about $0.033 per hour for a one-vCPU microVM and can deploy into the user’s own cloud account. BoxCompute provides persistent Linux VMs in Malaysia with a built-in agent and MCP integration, but starts new instances in about 28 seconds.
Why Your Sandbox Never Quite Matches Production (And Why That's Fine)
The gap between sandbox and production environments is structural and inevitable because they change on different schedules with different triggers. Infrastructure divergence rarely affects what integration tests catch, but behavioral contract drift—when simulated upstream responses no longer match real ones—causes tests to pass while production fails. The most effective teams connect simulation updates to upstream deployment events rather than to test failures, using observation-based tools like Keploy that capture real HTTP traffic to keep simulations current. Full production parity is not the goal; targeted accuracy for the specific behavioral contracts that integration tests validate is sufficient to catch the failures that matter most in distributed systems. The sandbox covers what it can, production reveals what it cannot, and the maintenance work is keeping the sandbox’s coverage accurate within its boundary, not expanding it to match production exactly.
Sidecars: A low-latency trust boundary for Sandboxes
Modal introduces Sidecars, isolated containers that run alongside a main Sandbox on the same host, establishing a trust boundary between trusted and untrusted code. Sidecars enable communication across trust boundaries at least 3x faster than using separate Sandboxes, reducing latency for operation-heavy agent workloads. The feature addresses the security risk of running an agent’s harness and tool calls together, which creates the “lethal trifecta” of private data, untrusted content, and external communication. Existing solutions either move the harness to a remote service (adding network latency) or rely on egress controls that lack flexibility. Sidecars allow trusted services such as credential injection, proxy traffic, and harness logic to run locally alongside the Sandbox, with independent network policies and dynamic creation via the Modal SDK.
Your sandbox can now serve requests
Sandboxes have traditionally been outbound-only machines, unable to receive inbound connections because they sit behind NAT with no public IP or open ports. BoxCompute now enables sandboxes to serve requests by using Tailcat, an open-source library from Tailscale that performs NAT traversal. Tailcat establishes a direct peer-to-peer WireGuard-encrypted path between the client and sandbox, using a DERP relay only for the initial handshake. This approach avoids the latency and bandwidth bottlenecks of relay-based tools like ngrok or Cloudflare Tunnel, and keeps the relay out of the data path. The feature is rolling out as an early preview with scoped, short-lived grants for selected TCP ports.
Devin Outposts on Modal
Devin, an AI software engineer by Cognition, plans, writes, tests, and ships code semi-autonomously. Cognition now extends Devin with Outposts, moving execution into user-controlled environments while reasoning stays in Cognition’s cloud. Modal is a launch partner with modal-devin, an open-source integration running Outpost sessions in Modal Sandboxes with pre-built custom images, fast cold-starts, snapshotting, and cost-efficient bursting. For example, a task that requires a GPU fails immediately in the default sandbox but succeeds on a Modal-backed Outpost that spins up a GPU on demand and scales to zero when done. One command, uvx modal-devin init, sets up secure infrastructure with a scheduler and worker functions, and each team can have its own outpost with separate credentials.
Unpacking sandbox startup latency: why started ≠ ready
Sandbox startup benchmarks measure container boot time, but in production application-level initialization after boot dominates, making container boot the smallest variable. Modal defines a lifecycle with events Created, Scheduled, Started, and Ready, where Ready indicates completion of tasks like git pulls or dependency installs. The gap between Started and Ready can be multiple seconds, directly affecting user-perceived latency for coding agents needing cloned repos and running services. To reduce perceived latency, Modal recommends warm pools that pre-initialize sandboxes using a Queue, combined with Directory Snapshots for per-project customization without rebuilding the environment. Readiness Probes, now generally available, allow defining a shell command that exits 0 or a TCP port that accepts connections, with wait_until_ready() blocking until the sandbox is truly ready, simplifying warm pool producer code and providing dashboard events for observability.
Building with Modal and the OpenAI Agents SDK
The post walks through constructing a custom agent harness with the OpenAI Agents SDK and Modal Sandboxes, starting from a minimal coding agent that executes shell commands directly on the host. To improve safety, the agent is moved into isolated Modal Sandboxes, which are secure Linux environments that can be equipped with GPUs for compute-intensive tasks like training models. Memory is added via Sessions to accumulate context across turns, and subagents are introduced to handle focused subtasks with fresh context windows, preventing context bloat in the orchestrator while allowing long-horizon work. An async subagent pool enables parallel execution, with quotas to limit GPU spend, and filesystem snapshots allow checkpointing and deduplication of setup work across subagents, saving time and offloading memory. The harness is applied to the Parameter Golf challenge, where an orchestrator delegates parallel training experiments across different ML frameworks on GPUs, demonstrating autonomous research capabilities with composable skills.
Related topics
All topics →Weekly digest
The best engineering reads, once a week.