Skip to main content

langchain-e2b

PyPI - Version PyPI - License PyPI - Downloads

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.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-e2b 0.0.7
File Size Uploaded Provenance Actions
langchain_e2b-0.0.7.tar.gz 228.3 kB With provenance Details for langchain_e2b-0.0.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-e2b 0.0.7
File Interpreter ABI Platform Actions
langchain_e2b-0.0.7-py3-none-any.whl Python 3 none any Details for langchain_e2b-0.0.7-py3-none-any.whl

Total release size: 239.6 kB

Release files / langchain_e2b-0.0.7.tar.gz

Download URL langchain_e2b-0.0.7.tar.gz
Size 228.3 kB
Tags Source
SHA-256 checksum
How to use checksums
dcb407b3b5693bdd686e84d8254d40a82b79a62019428e57329e77cad5b8f080
BLAKE2b-256 checksum
How to use checksums
f82053774dff929a833b5db7459cfd78d8f3ee25f38294f98bd5f77ebc99a2bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 14, 2026.

Transparency log

Release files / langchain_e2b-0.0.7-py3-none-any.whl

Download URL langchain_e2b-0.0.7-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d834376474efd1e9a19b4b76e5b73e76ff8ee8f1df3eb68f6285296e5e712bdb
BLAKE2b-256 checksum
How to use checksums
10f1c720f541f218672a03b2fcce88373e626f09539005de4dfdaadb4962e80f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 14, 2026.

Transparency log

Security for langchain-e2b 0.0.7

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for langchain_e2b-0.0.7.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 Nov 14, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page