Skip to content

Feature: Enable auto resume sandbox on network traffic (beta)#1120

Closed
matthewlouisbrockman wants to merge 6 commits intomainfrom
auto-resume-sandbox-on-network-traffic-eng-3456
Closed

Feature: Enable auto resume sandbox on network traffic (beta)#1120
matthewlouisbrockman wants to merge 6 commits intomainfrom
auto-resume-sandbox-on-network-traffic-eng-3456

Conversation

@matthewlouisbrockman
Copy link
Copy Markdown
Contributor

@matthewlouisbrockman matthewlouisbrockman commented Feb 6, 2026

Sandbox Auto-Resume (Paused Sandboxes)

Depends on e2b-dev/infra#1862
Actually, need to load test the infra side, closing this for now.

E2B sandboxes can be paused (for example via Sandbox.beta_pause() or autoPause in beta create). When a sandbox is paused, it can be resumed explicitly (for example by calling Sandbox.connect(...)), or automatically depending on the sandbox's auto-resume policy.

Policies

auto_resume / autoResume accepts:

  • {"policy": "off"} (default): disable auto-resume
  • {"policy": "any"}: allow any incoming request to trigger a resume

If you omit auto_resume / autoResume (or pass None / undefined), the SDK omits the field from the create request payload.

Python

from e2b import Sandbox

sandbox = Sandbox.create(
    "base",
    timeout=300,
    metadata={"project": "demo"},
    auto_resume={"policy": "any"},
)

Beta create with auto-pause + auto-resume:

from e2b import Sandbox

sandbox = Sandbox.beta_create(
    "base",
    timeout=300,
    auto_pause=True,
    auto_resume={"policy": "any"},
)

Note: Sandbox.create() and Sandbox.beta_create() keep the historical positional argument order (template, timeout, metadata, envs, ...). If you use auto_resume, pass it as a keyword argument.

JavaScript / TypeScript

import { Sandbox } from 'e2b'

const sandbox = await Sandbox.create('base', {
  apiKey: process.env.E2B_API_KEY,
  timeoutMs: 300_000,
  metadata: { project: 'demo' },
  autoResume: { policy: 'any' },
})

Beta create with auto-pause + auto-resume:

import { Sandbox } from 'e2b'

const sandbox = await Sandbox.betaCreate('base', {
  apiKey: process.env.E2B_API_KEY,
  autoPause: true,
  autoResume: { policy: 'any' },
})

@linear
Copy link
Copy Markdown

linear bot commented Feb 6, 2026

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 6, 2026

⚠️ No Changeset found

Latest commit: 2c73315

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@matthewlouisbrockman matthewlouisbrockman added the feature New feature or request label Feb 6, 2026
@matthewlouisbrockman matthewlouisbrockman changed the title Feature: Auto resume sandbox on network traffic eng 3456 Feature: Enable auto resume sandbox on network traffic (beta) Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant