Skip to main content

Leap0 sandbox integration for Deep Agents

Project description

langchain-leap0

Leap0 integration for LangChain Deep Agents: a BaseSandbox backend that runs shell commands and file transfers inside a Leap0 sandbox.

Leap0 is enterprise-grade cloud sandboxes for AI agents. Launch isolated sandboxes in ~200ms. Give every agent its own compute, filesystem, and network boundary while your agents run safely.

Quick install

pip install langchain-leap0

Set your API key (see Leap0 for account and key management):

export LEAP0_API_KEY="your-key"

Minimal usage with the [leap0](https://pypi.org/project/leap0/) SDK and Leap0Sandbox:

from leap0 import Leap0Client

from langchain_leap0 import Leap0Sandbox

client = Leap0Client()
sandbox = client.sandboxes.create()
backend = Leap0Sandbox(client=client, sandbox=sandbox)

try:
    result = backend.execute("echo 'Hello LangChain from Leap0.dev'")
    print(result.output)
finally:
    client.sandboxes.delete(sandbox)
    client.close()

Examples

Runnable scripts for Deep Agents sandboxes. See [examples/README.md](examples/README.md) for environment variables and how they map to LangChain **SandboxIntegrationTests**.

Script Summary
examples/basic_sandbox.py Minimal: create a sandbox, Leap0Sandbox.execute(), teardown.
examples/deep_agent_sandbox.py create_deep_agent(..., backend=Leap0Sandbox(...)) — create and run a script; prints a short execute summary.

From the repo root:

uv run python examples/basic_sandbox.py
uv run python examples/deep_agent_sandbox.py

Developing from source

From this directory (alongside leap0-python in the Leap0 workspace). Uses pyproject.toml dependencies; run:

cd langchain-leap0
uv sync --all-groups

Running tests

From the package root:

# Unit tests
make test

# LangChain standard sandbox integration tests
make integration_test

Integration tests require:

export LEAP0_API_KEY="your-key"

Documentation

Full documentation is available at leap0.dev/docs.

License

Apache License 2.0. See LICENSE for details.

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_leap0-0.1.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

langchain_leap0-0.1.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file langchain_leap0-0.1.0.tar.gz.

File metadata

  • Download URL: langchain_leap0-0.1.0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for langchain_leap0-0.1.0.tar.gz
Algorithm Hash digest
SHA256 095d5456909c687025a8a8a5c1c2dc96e29c9cd47958c67df65a059cc947e4f4
MD5 9e8dfcaeb71e97b45a388132abb86eb3
BLAKE2b-256 63fd350097c84126468d8bca948d707c9fa5d4c533c799b0d5f2cef0dd15b45d

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_leap0-0.1.0.tar.gz:

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

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_leap0-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_leap0-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9dbf06cfe8e9bed07f51a9d2a75f5a6ea6547c6312ff81d5508a192475dd276b
MD5 8a2808bd3b1aa5a050ac7deb40317dad
BLAKE2b-256 91e995b0dfb1acbfe2c5939245d07d43ab6e46485620eb013456702964575410

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_leap0-0.1.0-py3-none-any.whl:

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

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