langchain-e2b
Quick Install
pip install langchain-e2b
Deep Agents SDK
from e2b import Sandbox
from langchain_e2b import E2BSandbox
e2b_sandbox = Sandbox.create()
backend = E2BSandbox(sandbox=e2b_sandbox)
try:
result = backend.execute("echo hello")
print(result.output)
finally:
e2b_sandbox.kill()
For async agents, use E2B's async SDK with the async backend:
from e2b import AsyncSandbox
from langchain_e2b import AsyncE2BSandbox
e2b_sandbox = await AsyncSandbox.create()
backend = AsyncE2BSandbox(sandbox=e2b_sandbox)
try:
result = await backend.aexecute("echo hello")
print(result.output)
finally:
await e2b_sandbox.kill()
Deep Agents Code
Install langchain-e2b into the dcode environment, then run with the E2B
sandbox provider:
dcode --install langchain-e2b --package
export E2B_API_KEY=...
dcode --sandbox e2b
What is this?
langchain-e2b adapts an existing E2B sandbox to the Deep Agents sandbox
protocol. It uses the low-level e2b SDK so Deep Agents can run shell commands
and move files through the standard Deep Agents sandbox interface.
For SDK use, this package intentionally does not hide E2B sandbox lifecycle
management. Use the E2B SDK to create, connect to, configure, and kill
sandboxes, then pass the connected sandbox object to E2BSandbox.
For Deep Agents Code, the package also exposes a dcode sandbox provider entry
point. The provider creates, reconnects to, and deletes E2B sandboxes for
dcode --sandbox e2b.
Contributing
Contributions are welcome. Keep the adapter focused on implementing the Deep Agents sandbox backend protocol over the official E2B SDK.
Development
uv sync --group test
make test
make lint
Integration tests require E2B_API_KEY:
E2B_API_KEY=... make integration_tests
Metadata
Release files for langchain-e2b 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| langchain_e2b-0.0.6.tar.gz | 213.0 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_e2b-0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 224.1 kB
Release files / langchain_e2b-0.0.6.tar.gz
| Download URL | langchain_e2b-0.0.6.tar.gz |
|---|---|
| Size | 213.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d835df2c229e4b0879f44c0d4666873b33ce89901aba645bd870e4a13832e1c3
|
|
BLAKE2b-256 checksum How to use checksums |
1d9e3a59e5169746c6951c8b4ddfc09e3540e96d8845ebe33b7e98900bf7259b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 24, 2026.
Transparency logRelease files / langchain_e2b-0.0.6-py3-none-any.whl
| Download URL | langchain_e2b-0.0.6-py3-none-any.whl |
|---|---|
| Size | 11.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ca2e627835234e9e4ab6d9ce95e9e16bbc9ce2c4f88027c6ccf7157bbd2a4f19
|
|
BLAKE2b-256 checksum How to use checksums |
3e190ec2edc2f2540e278518415ee9b6822167e234d6fff9a8ab09513e904135
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 24, 2026.
Transparency logSecurity for langchain-e2b 0.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for langchain_e2b-0.0.6.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 24, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.