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.2.0.tar.gz (8.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_leap0-0.2.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for langchain_leap0-0.2.0.tar.gz
Algorithm Hash digest
SHA256 76cee0a1ae3dbdfcf4ce02599f5e5ee964ae11e49c44d05848986e6d97c145d2
MD5 483dee1316aac72a8a663f0e1c3b9b5e
BLAKE2b-256 761669b97aebed6d0f9c0fb36ece5fc6d9534f41808e4f86ee77a5a652c28a39

See more details on using hashes here.

Provenance

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

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

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

File metadata

File hashes

Hashes for langchain_leap0-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f4cc2c091560389b5eadb83675b7e4318a74745ae3a5b83798259077da7864d9
MD5 95dd84d0321ba713848666c1e83dfbee
BLAKE2b-256 5808f9e6335b18473d1892fd4aced03ea09fe420d1fe33fd47dcf55c50966b86

See more details on using hashes here.

Provenance

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

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

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