description: "One shared remote Linux sandbox for E2B-backed file and command work: configuration, lifetime, and what happens at startup and shutdown."
English | 中文
dsh-e2b runs the agent's file operations, shell commands, and terminals in one shared remote Linux sandbox instead of on your machine. The sandbox is created at startup and deleted when its configured lifetime expires or the app shuts down, so everything it holds is ephemeral. Configure an API key, an absolute remote working directory, and the sandbox lifetime. Use it with dsh-fs-e2b and dsh-subprocess-e2b; by itself it adds no user-visible capability. It sends nothing to the model, and no shipped composition enables E2B by default.
Use this package when you want the agent's file and command work to run in a remote Linux sandbox rather than on your machine. It is the foundation of the E2B family: with the filesystem and subprocess packages mounted, all of that work shares one remote working directory and process world.
Choose the E2B family when work should be isolated from the host machine — for example, when you want the agent's file edits and command runs to happen somewhere disposable. Choose the local filesystem and subprocess packages when running on the host is fine. This package is invisible to the model and adds no request cost.
Three settings matter: an API key (or the E2B_API_KEY environment variable), an absolute remote working directory, and the sandbox lifetime. A bad key, a relative working directory, or an invalid lifetime rejects startup before any remote work happens.
- name: '@deepseek-ai/dsh-e2b'
config:
apiKey: <E2B API key>
cwd: /home/user/workspace
timeoutMs: 300000
- name: '@deepseek-ai/dsh-subprocess-e2b'
- name: '@deepseek-ai/dsh-fs-e2b'
| Field | Default | Meaning |
|---|---|---|
apiKey |
E2B_API_KEY |
API key for the host SDK connection; never installed in the sandbox |
cwd |
/home/user/workspace |
Remote working directory the family shares; absolute POSIX path |
timeoutMs |
300,000 |
Sandbox lifetime in milliseconds; the sandbox is deleted when it expires |
The generated configuration catalog is the exhaustive source for every accepted field and its JSDoc.
With this package mounted, file reads and writes, shell commands, and terminals all operate inside the sandbox's working directory, so the agent sees one consistent remote world: what it writes with the file features is what its commands can read, and vice versa. The remote working directory is created if it does not exist yet.
Loading the plugin starts the sandbox in the background; the filesystem and subprocess features are ready once it is up. The sandbox lives for the configured lifetime (default five minutes) unless the app stops first — in both cases it is deleted, so save anything you still need before then. If the sandbox disappears while running (expired or removed elsewhere), the family treats that as a clean end rather than an error.
Read these pages when the package-level contract is not enough. They move from the family composition to the subprocess seam surface and the decision evidence behind the remote execution world.
ctx.e2b.ctx.fs and ctx.subprocess, and what stays in the host.None, as the shared remote-runtime owner registers no model context; provider adapters and consumers own rendered effects.
No direct invalidation: the owner contributes no request tokens and never mutates a request prefix, so provider cache reuse is unaffected.
These limits define when the E2B family is a poor fit or needs special operational care. They are current package constraints, not a task backlog.
cwd is a resolution convention, not containment — adapters and commands can address other sandbox paths; E2B network access retains the base image's policy.