Atlas
PluginsSandboxes

Sandbox Plugins

Isolate code execution with E2B, Daytona, nsjail, sidecar, and Vercel sandbox plugins.

Sandbox plugins provide isolation backends for the explore tool. They run user-initiated commands (file listing, grep, cat) in restricted environments to prevent unauthorized filesystem or network access. Each plugin implements the AtlasSandboxPlugin interface from @useatlas/plugin-sdk.

All five plugins follow the same pattern: validate config via a Zod schema, create an isolated environment, upload semantic layer files, execute commands, and clean up. The differences are in the isolation technology and where the sandbox runs.

Available Sandbox Plugins

Priority Order

When multiple sandbox backends are available, Atlas selects the highest-priority one. Higher priority means stronger isolation guarantees.

PluginPriorityIsolation TypeRuns on
Vercel100Firecracker microVMVercel infrastructure
E2B90Firecracker microVM (managed)E2B cloud
Daytona85Managed cloud sandboxDaytona cloud
nsjail75Linux namespace sandboxSame host (Linux only)
Plugin default60SANDBOX_DEFAULT_PRIORITY--
Sidecar50HTTP-isolated containerSeparate container
just-bash (built-in)0OverlayFs (dev fallback)Same host

The built-in just-bash backend (priority 0) is a development-only fallback. It uses OverlayFs for read-only filesystem protection but provides no network isolation. Never use it in production.

Choosing a Sandbox

Use this decision tree to pick the right sandbox for your deployment:

  1. Deploying on Vercel? Use Vercel Sandbox -- it is auto-selected as the highest-priority backend and requires no configuration.
  2. Want managed cloud isolation with no infrastructure? Use E2B or Daytona. Both provide ephemeral VMs/sandboxes via a managed API.
  3. Self-hosting on Linux with root access? Use nsjail -- strong namespace isolation with no external dependencies beyond the nsjail binary.
  4. Self-hosting on Docker/Railway without root? Use Sidecar -- deploy the sidecar container alongside the API. No special kernel capabilities needed.
  5. Local development? bun run db:up starts a sidecar container alongside Postgres -- no plugin needed.

Combining Multiple Sandboxes

You can register multiple sandbox plugins. Atlas picks the highest-priority one that is available at runtime:

// atlas.config.ts
import { defineConfig } from "@atlas/api/lib/config";
import { nsjailSandboxPlugin } from "@useatlas/nsjail";
import { sidecarSandboxPlugin } from "@useatlas/sidecar";

export default defineConfig({
  plugins: [
    // nsjail (priority 75) is preferred when available
    nsjailSandboxPlugin({ timeLimitSec: 15 }),
    // Sidecar (priority 50) is the fallback
    sidecarSandboxPlugin({
      url: process.env.ATLAS_SANDBOX_URL ?? "http://sandbox-sidecar:8080",
    }),
  ],
});

On this page