Skip to main content

E2B sandbox integration for Deep Agents

Project description

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()

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_e2b-0.0.4.tar.gz (207.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_e2b-0.0.4-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file langchain_e2b-0.0.4.tar.gz.

File metadata

  • Download URL: langchain_e2b-0.0.4.tar.gz
  • Upload date:
  • Size: 207.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for langchain_e2b-0.0.4.tar.gz
Algorithm Hash digest
SHA256 bf543ad7394b83c3f097c9914adfc59bb3af3af9837dea9ada5064abcf4666d2
MD5 549eb6d8a2a5d1b2842db9beb4b82dd4
BLAKE2b-256 3c1aab8db1288a70b25bfb2489327fae0d3a82ea07231d446083a2dcb0bfc174

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_e2b-0.0.4.tar.gz:

Publisher: release.yml on e2b-dev/langchain-e2b

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file langchain_e2b-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: langchain_e2b-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for langchain_e2b-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6cf20f155ebf6b1a8f36d69dec4b5925c242dfcf779209c94ccb18fda3296419
MD5 5efe64864cf9272f0a11d6b2da35c0d3
BLAKE2b-256 816f4e2263f5372019bd05fc8c7fe50674b041cc6b22df3faf3037897587413f

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_e2b-0.0.4-py3-none-any.whl:

Publisher: release.yml on e2b-dev/langchain-e2b

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page