Skip to content

E2B Sandboxes

IDe2b
CategorySandboxes
FeaturesNone
Dependenciessession_storage

Run code in cloud sandboxes powered by E2B. Create isolated Linux environments, execute commands, and manage sandbox files. Sandboxes are scoped to the session and cleaned up automatically.

Create a new E2B sandbox.

ParameterTypeRequiredDescription
templatestringnoSandbox template name or ID
timeout_msintegernoTimeout in milliseconds

Returns sandbox_id and connection details.

Execute a shell command in a sandbox.

ParameterTypeRequiredDescription
sandbox_idstringyesTarget sandbox
commandstringyesShell command to run
cwdstringnoWorking directory

Read a text file from a sandbox filesystem.

ParameterTypeRequiredDescription
sandbox_idstringyesTarget sandbox
pathstringyesFile path
offsetintegernoLine offset to start reading from
limitintegernoMaximum number of lines to return

Write a text file into a sandbox filesystem.

ParameterTypeRequiredDescription
sandbox_idstringyesTarget sandbox
pathstringyesFile path
contentstringyesFile content

List all E2B sandboxes created in the current session.

Pause or kill an E2B sandbox.

ParameterTypeRequiredDescription
sandbox_idstringyesTarget sandbox
actionstringyespause or kill

E2B API key is resolved automatically from Settings > Connections > E2B.

  • Each sandbox is an isolated Linux environment with internet access
  • Sandboxes are tracked per session; use e2b_manage_sandbox to kill when done
  • File operations target the sandbox filesystem, not the session workspace