@seclink: The biggest difference between Agent execution and general code execution is: Agent execution requires extremely low cold start time (millisecond-level response), frequent file system state synchronization (Agent needs to read and write intermediate code, output files), and flexible API/network access control. Below are two condensed core recommended solutions: Solution 1…

X AI KOLs Timeline News

Summary

This article discusses the differences between Agent execution and general code execution and recommends two sandbox solutions: E2B (based on Firecracker) and OpenSandbox (based on Docker), which are suitable for production-grade and private deployment scenarios, respectively.

The biggest difference between Agent execution and general code execution is: Agent execution requires extremely low cold start time (millisecond-level response), frequent file system state synchronization (Agent needs to read and write intermediate code, output files), and flexible API/network access control. Below are two condensed core recommended solutions: ### Solution 1: E2B Infrastructure (Proprietary Agent Sandbox Based on Firecracker) — Production-Grade Preferred E2B is currently the de facto standard for code execution sandboxes across the entire large model industry (including AutoGPT, Devin-like projects, LangChain, etc.). Although it has a cloud service, its core sandbox scheduling and isolation engine is fully open-source. **Technical Foundation:** Firecracker MicroVM (hardware-level kernel isolation). **Multi-tenancy and Isolation:** Each execution of each Agent runs in its own independent MicroVM. Since Firecracker removes all non-essential peripheral drivers, cold start time is controlled within 150ms, making it ideal for interactive, high-concurrency execution modes typical of Agents. **Dynamic Resource Limits:** Supports fine-grained allocation of vCPU count (e.g., 1 core, 2 cores) and memory size (e.g., 512MB, 1GB) during template definition and startup. Resources are strictly enforced by KVM, so a single tenant overflow won't affect the host. **Network Policy (Egress Control):** Through a custom virtual network interface (TAP) combined with host scheduler. Public network can be disabled by default, allowing Agents to access only specific third-party API domains (e.g., OpenAI/Anthropic API endpoints, preventing Agents from leaking sensitive host data). **File System and State Management:** Agent-specific optimization: supports sub-second snapshots based on Memfs/Overlayfs. Agents can install dependencies (e.g., pip install pandas) inside the sandbox, and E2B can instantly save that state as a "custom sandbox template" for reuse in subsequent tasks. Provides dedicated APIs for bidirectional file synchronization between the host and the sandbox file system. **Use Case:** You need to build a commercial Agent platform that allows users to input arbitrary prompts for the Agent to generate and run Python/JS code, with absolutely no security incidents. **Open Source Repository:** http://github.com/e2b-dev/infra ### Solution 2: OpenSandbox (Lightweight Agent Security Sandbox Based on Docker/K8s) — Preferred for Domestic/Intranet Environments Open-sourced by Alibaba, this sandbox environment is specifically designed for LLM Agent code execution scenarios. If your physical machine or cloud server cannot enable KVM (e.g., nested virtualization is restricted), or you prefer to run directly in an existing Kubernetes/Docker container cluster, this is the best option. **Technical Foundation:** Docker container isolation / K8s Pod isolation (optional gVisor as secure runtime). **Multi-tenancy and Isolation:** Provides multi-tenant management APIs. Although container isolation is the default, it specifically targets common Agent attack vectors (e.g., using Python reflection to read system environment variables, executing sensitive system commands, port scanning) with security hardening and interception at both the application layer and system call layer. **Dynamic Resource Limits:** Based on Cgroups mechanism. When pulling up a sandbox via API, it can dynamically limit CPU shares, memory limits, and disk IOPS to prevent an Agent stuck in an infinite loop (e.g., while True) from overwhelming the host CPU. **Network Policy:** Integrates container network NetworkPolicy. Can dynamically control inbound and outbound traffic of the sandbox (e.g., block access to internal databases and configuration centers, only allow access to the public internet). **File System and Directory Control:** Agent-optimized: strictly limits the root directory mount within the sandbox. The Agent can only read and write files under the designated /workspace directory and cannot access any host files. Provides standard interfaces for external retrieval of result files such as charts and CSVs generated by the Agent. **Use Case:** Private deployment, intranet environments, or cloud servers that cannot use KVM virtualization, requiring rapid integration with mainstream domestic large model development frameworks. **Open Source Repository:** http://github.com/alibaba/OpenSandbox
Original Article
View Cached Full Text

Cached at: 07/08/26, 05:41 AM

Agent execution differs from general code execution in three key ways: extremely low cold-start latency (millisecond response), frequent filesystem state synchronization (agents need to read and write intermediate code and output files), and flexible API/network access control.

Below are two streamlined recommended solutions:

Solution 1: E2B Infrastructure (Proprietary Agent Sandbox Based on Firecracker) – Production-Grade First Choice

E2B is the de facto standard for code execution sandboxes across the LLM industry (including AutoGPT, Devin-like projects, LangChain, etc.). Although it offers a cloud service, its core sandbox scheduling and isolation engine is fully open-source.

  • Technical Foundation: Firecracker MicroVM (hardware-level kernel isolation).
  • Multi-tenancy & Isolation: Each execution of an agent runs in an independent MicroVM. Because Firecracker removes all unnecessary peripheral drivers, cold-start times are kept under 150ms, making it ideal for interactive, high-concurrency agent execution.
  • Dynamic Resource Limits: Fine-grained allocation of vCPUs (e.g., 1 core, 2 cores) and memory (e.g., 512MB, 1GB) can be set in template definitions and at startup. Resources are strictly enforced by KVM, preventing single-tenant overflow from affecting the host.
  • Network Policy (Egress Control): Custom virtual NICs (TAP) combined with a host scheduler allow public internet to be disabled by default, granting only specific third-party API domains (e.g., OpenAI/Anthropic API endpoints) to prevent an agent from leaking sensitive host data.
  • Filesystem & State Management: Agent-optimized: supports second-level snapshots based on Memfs/Overlayfs. An agent can install dependencies (e.g., pip install pandas) inside the sandbox, and E2B can instantly save that state as a custom sandbox template for reuse in the next task. Provides a dedicated API for bidirectional file synchronization between the host and the sandbox filesystem.
  • Use Case: You want to build a commercial agent platform that allows users to input arbitrary prompts, have the agent generate and run Python/JS code, with zero security incidents.
  • Open-Source Repo: http://github.com/e2b-dev/infra

Solution 2: OpenSandbox (Lightweight Agent Security Sandbox Based on Docker/K8s) – Preferred for Domestic/Intranet Environments

Open-sourced by Alibaba, this sandbox environment is specifically designed for LLM agent code execution. It is the best option if your physical machine or cloud server cannot enable KVM (e.g., nested virtualization is restricted) or if you want to run directly on an existing Kubernetes/Docker container cluster.

  • Technical Foundation: Docker container isolation / K8s Pod isolation (optionally mount gVisor as a secure runtime).
  • Multi-tenancy & Isolation: Provides multi-tenant management API. Although it defaults to container isolation, it performs security hardening and interception at the application layer and system call layer specifically against common agent attack patterns (e.g., using Python reflection to read system environment variables, executing sensitive system commands, port scanning).
  • Dynamic Resource Limits: Based on Cgroups. When creating a sandbox via API, you can dynamically limit CPU shares, memory limits, and disk IOPS to prevent an agent from getting stuck in an infinite loop (e.g., while True) and overwhelming the host CPU.
  • Network Policy: Integrates container network NetworkPolicy. Inbound and outbound traffic of the sandbox can be dynamically controlled (e.g., block access to internal databases and config centers, allow only public internet access).
  • Filesystem & Directory Control: Agent-optimized: strictly restricts the root mount inside the sandbox. Agents can only read/write files in the designated /workspace directory and cannot touch any host files. Provides standard interfaces for external reads of charts, CSVs, and other result files generated by the agent.
  • Use Case: Private deployment, intranet environments, or cloud server environments where KVM virtualization is unavailable, and you need quick integration with major domestic LLM development frameworks.
  • Open-Source Repo: http://github.com/alibaba/OpenSandbox…

e2b-dev/infra

Source: https://github.com/e2b-dev/infra

[E2B Infra Preview Light]

[E2B Infra Preview Dark]

E2B Infrastructure

E2B (https://e2b.dev) is an open-source infrastructure for AI code interpreting. In our main repository e2b-dev/e2b (https://github.com/e2b-dev/E2B) we give you SDKs and CLI to customize and manage environments and run your AI agents in the cloud.

This repository contains the infrastructure that powers the E2B platform.

Contributing

See CONTRIBUTING.md for ways you can contribute to E2B Infrastructure.

Self-hosting

Read the self-hosting guide to learn how to set up the infrastructure on your own. The infrastructure is deployed using Terraform.

Supported cloud providers:

  • 🟢 GCP
  • 🟢 AWS (Beta)
  • Azure
  • General linux machine

Similar Articles

@yibie: Recommend this concise but sharp observation. Agents are increasingly running in ephemeral sandboxes, but all sandbox providers are optimizing the "time from boot to command execution" (median 690ms). Matt Rickard points out: the real overlooked bottleneck isn't boot time—it's cloning code...

X AI KOLs Timeline

The article points out that when AI agents run in ephemeral sandboxes, git clone has become a new bottleneck (often taking several seconds). Matt Rickard's Corigin rebuilds the git read path to reduce clone time to 184-646ms, which is faster than sandbox startup (690ms TTI).

@xfgong: https://x.com/xfgong/status/2111002582311149742

X AI KOLs Timeline

The article systematically lays out the overall architecture of a "Decoupled Brain and Hand" enterprise agent platform: the control plane (Harness) holds reasoning and session state, an elastic sandbox pool executes commands on demand, and the design revolves around four boundary governance mechanisms — control plane / execution plane decoupling, key exclusion with dynamic broker replacement at the edge, and an append-only incremental event stream.

@teach_fireworks: A one-image comparison of mainstream Agent development frameworks! How to choose among so many Agent development frameworks? For personal heavy daily coding / research on open-source projects: try Pi Agent AI SaaS or enterprise-level agents: OpenAI Agents SDK + Lang…

X AI KOLs Timeline

A tweet compares mainstream AI Agent development frameworks (such as Pi Agent, OpenAI Agents SDK, LangGraph, LlamaIndex, Pydantic AI) and gives selection recommendations for different scenarios.