Skip to content
PluginStats

@e2b/ai-sdk-sandbox weekly downloads statistics

By e2b · npm · AI SDKs

E2B sandbox provider for the Vercel AI SDK

View on npm Fresh · Oct 28, 2026

@e2b/ai-sdk-sandbox has 1,440 recorded weekly downloads on npm, ranking #1352 of 2,644 tracked listings.

Weekly downloads
1,440
Official API · Oct 26, 2026
7-day growth
—
Insufficient history
30-day growth
—
Insufficient history
90-day growth
—
Insufficient history
Rank
#1352
Among tracked npm listings

About @e2b/ai-sdk-sandbox

AI SDK - E2B Sandbox

This package is experimental and targets AI SDK 7 (now stable).

Run your agent's code inside E2B sandboxes from the AI SDK. It's the E2B counterpart to @ai-sdk/sandbox-vercel. Drop it into a HarnessAgent, or hand a session straight to your AI SDK tools.

For how the harness itself works, see the AI SDK harness docs.

Setup

npm i @e2b/ai-sdk-sandbox

Set E2B_API_KEY (or pass apiKey in the settings). Calling createE2BSandbox() doesn't reach E2B on its own. The sandbox is created when you call createSession().

Usage

import { createE2BSandbox } from '@e2b/ai-sdk-sandbox';

const e2bSandbox = createE2BSandbox({ template: 'base' });

const sandboxSession = await e2bSandbox.createSession();
// restricted() returns the same sandbox narrowed to the tool-safe surface
// (file I/O, run, spawn) with no lifecycle or network controls — this is what
// you hand an AI SDK tool's execute().
const restrictedSandboxSession = sandboxSession.restricted();

await restrictedSandboxSession.writeTextFile({ path: 'hello.txt', content: 'hi' });

const { stdout } = await restrictedSandboxSession.run({ command: 'cat hello.txt' });
console.log(stdout); // "hi"

await sandboxSession.stop();

restricted() gives you an Experimental_SandboxSession: the same underlying sandbox, narrowed to the tool-facing surface (file I/O, run, spawn), just a view with the infra bits (ports, getPortEndpoint, setNetworkPolicy, stop) removed. That's the security boundary: code you hand the restricted view can't stop the box or change its network policy. Pass it to an AI SDK tool's execute() via experimental_sandbox; the full session stays with the harness. (See the harness docs for the restricted() contract.)

Settings

Everything goes in the object you pass to createE2BSandbox(...):

const e2bSandbox = createE2BSandbox({
  template: 'base',                                // any E2B SandboxOpts
  envs: { NODE_ENV: 'production' },
  timeoutMs: 10 * 60 * 1000,                       // optional; defaults to 30 min
  ports: [3000],                                   // provider option
  setupCommands: ['sudo npm install -g pnpm@9'],   // provider option
});

Any of E2B's [SandboxOpts](https://e2b.dev/docs) (template, envs, metadata, network, and so on) are forwarded straight through. The provider adds two more options that aren't part of E2B's SDK:

optiondefaultwhat it does
ports[]Ports to advertise on session.ports. The harness bridge binds to the first one. E2B can reach any listening port through getHost, so this is really just the list it advertises.
setupCommands[]Commands to run once on a fresh sandbox, before the harness bootstraps. For example, ['sudo npm install -g pnpm@9'] to add pnpm for the claude-code/codex adapters.

Already have a sandbox? Pass it as sandbox to reuse it (handy when you want to share one across sessions). The provider won't touch its lifecycle, so stop() and destroy() become no-ops and cleanup stays yours.

import { createE2BSandbox } from '@e2b/ai-sdk-sandbox';
import { Sandbox } from 'e2b';

const e2bSandbox = createE2BSandbox({
  sandbox: await Sandbox.create({ template: 'base' }),
});
Mid-session network policy

You can tighten or loosen outbound access on a sandbox that's already running:

await sandboxSession.setNetworkPolicy?.({
  mode: 'custom',
  allowedHosts: ['api.example.com'],
  deniedCIDRs: ['169.254.169.254/32'],
});
Request transformations and credential brokering

setRequestTransformations() replaces the managed rules, addRequestTransformations() adds without replacing. Headers in transform.headers are injected by E2B's egress proxy after the request leaves the sandbox, so real credentials never enter it — harness adapters use this automatically for their model API keys. E2B matches rules by host: a path matcher is applied host-wide, and method/queryString/headers matchers are rejected rather than silently widened. E2B allows one transform rule per host, so multiple transformations for the same host are merged into one rule (later headers override earlier ones). Rules match the host exactly (a rule for example.com does not cover www.example.com) and the egress proxy transforms HTTPS requests only. Network policies remain authoritative over which hosts can be reached. See examples/request-transformations.ts for a live end-to-end check.

Running an agent (Claude Code, Codex)
const agent = new HarnessAgent({
  harness: createClaudeCode(),
  sandbox: createE2BSandbox({
    template: 'pnpm-base', // base image + pnpm + 2GB, built via build-template.ts
    ports: [4000],
  }),
});

One thing to know about templates: the claude-code adapter installs its own pinned CLI and bridge inside the sandbox with pnpm (it doesn't use a system claude). That install pulls claude-code's ~238 MB native binary, and pnpm staging it peaks around 1.5 GB — so the sandbox needs pnpm and ~2 GB of RAM. E2B RAM is fixed at template-build time (you can't set it per sandbox), so build a 2 GB template with pnpm baked in via examples/build-template.ts and pass its name. A full, runnable version lives in examples/harness.ts.

Good to know…

Description from the npm listing.

  • ai-sdk
  • e2b
  • sandbox
  • code-execution
  • harness

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

@e2b/ai-sdk-sandbox weekly downloads on npm, last 90 days: 1,440 weekly downloads as of Oct 26, 2026.@e2b/ai-sdk-sandboxWeekly downloads on npm · Last 90 days1,440downloads / week1.3K1.3K1.4K1.4K1.5K1.5K1.6K1.6KJul 28Aug 12Aug 27Sep 11Sep 26Oct 11Oct 26downloads / weekOct 26, 2026 – Oct 26, 2026 · 1 observations · Updated Oct 26, 2026pluginstats.com
@e2b/ai-sdk-sandbox weekly downloads on npm, last 90 days: 1,440 weekly downloads as of Oct 26, 2026.

7/30/90-day growth

@e2b/ai-sdk-sandbox weekly downloads growth on npm: 7-day growth unavailable, 30-day growth unavailable, 90-day growth unavailable.@e2b/ai-sdk-sandboxWeekly downloads growth on npm1,440downloads / week now7-day growthinsufficient historyInsufficient history30-day growthinsufficient historyInsufficient history90-day growthinsufficient historyInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Oct 26, 2026pluginstats.com
@e2b/ai-sdk-sandbox weekly downloads growth on npm: 7-day growth unavailable, 30-day growth unavailable, 90-day growth unavailable.

Ranking history

@e2b/ai-sdk-sandbox npm ranking history: currently #1352 (by weekly downloads).@e2b/ai-sdk-sandboxnpm ranking · by weekly downloads · Last 90 days#1352current rank#1350#1351#1352#1353#1354Jul 30Aug 14Aug 29Sep 13Sep 28Oct 13Oct 28rankOct 28, 2026 – Oct 28, 2026 · 1 observations · Updated Oct 26, 2026pluginstats.com
@e2b/ai-sdk-sandbox npm ranking history: currently #1352 (by weekly downloads).

Listing placement

All npm2,642 listings · 133 pages · 1,322 shown · page 79, #13 (overall #1,573)
All npm: every listing in weekly downloads order

Listing placement

AI SDKs292 listings · 15 pages · page 8, #16 (overall #156)
AI SDKs: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (1)
Recent weekly downloads observations for @e2b/ai-sdk-sandbox
Date (UTC)Weekly downloadsChange vs. previous
1,440—

Similar npm AI SDKs plugins

All 20 @e2b/ai-sdk-sandbox alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/@e2b/ai-sdk-sandbox. First seen Oct 28, 2026; last successful collection Oct 28, 2026. See the methodology.