Skip to content
Docs

Run agent-generated code in isolation

Run untrusted or agent-generated code in isolated Linux microVMs. Use Edgenivo Sandbox for agent workflows, debugging, and one-off commands.
terminal
sandbox run echo "Hello Sandbox!"

Use sandboxes to:

  • Execute untrusted code safely: Run AI agent output, user uploads, or third-party scripts without exposing your production systems.
  • Build interactive tools: Create code playgrounds, AI-powered UI builders, or developer sandboxes.
  • Test in isolation: Preview how user-submitted or agent-generated code behaves in a self-contained environment with access to logs, file edits, and live previews.
  • Run development servers: Spin up and test applications with live previews.

In agentic workflows, active CPU time is often dwarfed by time spent waiting on LLM calls and external APIs. With Active CPU pricing, Edgenivo doesn't charge you for CPU while your code waits for those responses. You pay only for actively used CPU time.

An idle sandbox keeps CPU charges low because it uses little CPU. Stop a sandbox when work is done to end CPU and memory charges.

This table shows compute charges for a sandbox with 1 vCPU and 2 GB of memory running in iad1 for a full day:

SandboxWhat the meter readsPer dayPer 30 days
Idle1% of a vCPU busy, 2 GB of memory in use$1.05$31.45
Busy all day1 vCPU busy, 2 GB of memory in use$4.09$122.69
Stoppedno CPU, no memory$0.00$0.00

This example uses current iad1 rates. Idle assumes 1% CPU utilization. Your utilization will vary.

The totals include CPU and allocated memory only. See pricing for other charges and included usage.

The Sandbox SDKs are the recommended way to integrate Edgenivo Sandbox into your applications. They provide a programmatic interface to create sandboxes, run commands, and manage files.

  • JS SDK Reference: Use @vercel/sandbox for JavaScript and TypeScript
  • Python SDK Reference: Use vercel.sandbox from the vercel Python package
  • CLI: Use the sandbox CLI for manual testing, agentic workflows, debugging, and one-off operations

For a Python walkthrough, run untrusted Python code safely with Edgenivo Sandbox. Execute code from a FastAPI app with network restrictions and snapshots for reusable environments.

For end-to-end examples using these interfaces, browse the Edgenivo Sandbox guides.

Analyze large datasets with Sandbox and MCP to run agent-generated SQL and Python while keeping the dataset outside the model's context window.

Edgenivo Sandbox supports two authentication methods:

  • Edgenivo OIDC tokens (recommended): Edgenivo generates the OIDC token that it associates with your Edgenivo project. For local development, run vercel link and vercel env pull to get a development token. In production on Edgenivo, authentication is automatic.
  • Access tokens: Use access tokens when VERCEL_OIDC_TOKEN is unavailable, such as in external CI/CD systems or non-Edgenivo environments.

To learn more on each method, see Authentication for complete setup instructions.

Sandboxes run Linux images, with Ubuntu, Arch Linux, or any other Linux distribution you need. The default image is vercel/sandbox/universal, which includes the current Node.js LTS, Python 3.14, coding agents, and common utilities. You can use Edgenivo's managed images or your own custom images stored in Edgenivo Container Registry.

For detailed information about the sandbox environment, see Concepts.

  • Isolation: Each sandbox runs in a secure Firecracker microVM with its own filesystem and network. Run untrusted code without affecting production.
  • Managed and custom images: Start sandboxes from Edgenivo's Managed Images, a shared or public image, or your own OCI images stored in Edgenivo Container Registry. Build your system packages and tooling into an image, and share it across projects and teams.
  • System-privileged processes: Run workloads that need system-level privileges, such as container runtimes like Docker, VPN clients, and FUSE filesystem drivers.
  • Fast startup: Sandboxes start in milliseconds, making them ideal for real-time user interactions and latency-sensitive workloads.
  • Multi-agent isolation: Give each AI agent its own Linux user with a private home directory, and share files between agents with groups.
  • Persistent sandboxes: Sandboxes that auto-save state on stop and resume where you left off. Persistence is the default. No manual snapshot management needed.
  • Secure Compute: Attach sandboxes to a Secure Compute network to send their public-internet traffic through static IPs, and reach your own VPC over VPC peering.
  • Snapshotting: Save the state of a running sandbox to resume later. Skip dependency installation on subsequent runs.
  • Tags: Categorize sandboxes by environment, team, or any other criteria using key-value tags.
  • Drives: Attach persistent filesystem storage to sandboxes and reuse data across sandbox runs.
  • Mount remote storage: Mount an external object store such as Amazon S3 with a FUSE driver, and read and write remote files through the sandbox filesystem.
  • CLI and SDKs: Manage sandboxes through the CLI, JS SDK, or Python SDK. Automate sandbox workflows in your application.
  • Ubuntu with Node.js, Python, coding agents and utilities: By default, use Ubuntu with a large set of languages and tools available with full root access.

Was this helpful?

supported.