After the package is published:
pip install langchain-e2bfrom e2b import Sandbox
from langchain_e2b import E2BSandbox
sandbox = Sandbox.create()
backend = E2BSandbox(sandbox=sandbox)
try:
result = backend.execute("echo hello")
print(result.output)
finally:
sandbox.kill()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 backend interface.
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.
Contributions are welcome. Keep the adapter focused on implementing the Deep Agents sandbox backend protocol over the official E2B SDK.
uv sync --group test
make test
make lintIntegration tests require E2B_API_KEY:
E2B_API_KEY=... make integration_tests