From 3e7355bcb62cc54edb490cee876831af1fe47b8b Mon Sep 17 00:00:00 2001 From: Julia Passynkova Date: Thu, 2 Apr 2026 00:31:34 -0400 Subject: [PATCH 1/3] Add Leap0 sandbox integration docs --- src/images/providers/leap0-icon.svg | 1 + src/oss/deepagents/sandboxes.mdx | 5 ++ .../python/integrations/providers/leap0.mdx | 13 +++ .../python/integrations/sandboxes/index.mdx | 5 ++ .../python/integrations/sandboxes/leap0.mdx | 80 +++++++++++++++++++ 5 files changed, 104 insertions(+) create mode 100644 src/images/providers/leap0-icon.svg create mode 100644 src/oss/python/integrations/providers/leap0.mdx create mode 100644 src/oss/python/integrations/sandboxes/leap0.mdx diff --git a/src/images/providers/leap0-icon.svg b/src/images/providers/leap0-icon.svg new file mode 100644 index 0000000000..a55f7237ce --- /dev/null +++ b/src/images/providers/leap0-icon.svg @@ -0,0 +1 @@ +Leap0 \ No newline at end of file diff --git a/src/oss/deepagents/sandboxes.mdx b/src/oss/deepagents/sandboxes.mdx index 545be39125..70f8647787 100644 --- a/src/oss/deepagents/sandboxes.mdx +++ b/src/oss/deepagents/sandboxes.mdx @@ -96,6 +96,11 @@ For provider-specific setup, authentication, and lifecycle details, see [sandbox Node VFS + + + Leap0 + + LangSmith diff --git a/src/oss/python/integrations/providers/leap0.mdx b/src/oss/python/integrations/providers/leap0.mdx new file mode 100644 index 0000000000..eb78197ea5 --- /dev/null +++ b/src/oss/python/integrations/providers/leap0.mdx @@ -0,0 +1,13 @@ +--- +title: "Leap0 integrations" +sidebarTitle: "Leap0" +description: "Integrate with Leap0 using LangChain Python." +--- + +[Leap0](https://leap0.dev) provides cloud sandboxes for AI agents: isolated compute, filesystem, and network boundaries, with sandboxes that start in about 200ms. See the [Leap0 docs](https://leap0.dev/docs) for signup, API keys, and platform details. + + + + Leap0 sandbox backend for Deep Agents. + + diff --git a/src/oss/python/integrations/sandboxes/index.mdx b/src/oss/python/integrations/sandboxes/index.mdx index d996a6cd6b..bd98f60081 100644 --- a/src/oss/python/integrations/sandboxes/index.mdx +++ b/src/oss/python/integrations/sandboxes/index.mdx @@ -31,6 +31,11 @@ Sandboxes provide isolated execution environments for running agent-generated co Runloop + + + Leap0 + + LangSmith diff --git a/src/oss/python/integrations/sandboxes/leap0.mdx b/src/oss/python/integrations/sandboxes/leap0.mdx new file mode 100644 index 0000000000..7774b0e5b8 --- /dev/null +++ b/src/oss/python/integrations/sandboxes/leap0.mdx @@ -0,0 +1,80 @@ +--- +title: "Leap0Sandbox integration" +description: "Integrate with the Leap0Sandbox sandbox backend using LangChain Python." +--- + +[Leap0](https://leap0.dev) provides cloud sandboxes for AI agents: isolated compute, filesystem, and network boundaries, with sandboxes that start in about 200ms. See the [Leap0 docs](https://leap0.dev/docs) for signup, API keys, and platform details. + +Set `LEAP0_API_KEY` in your environment before running the examples below. + +## Installation + + +```bash pip +pip install langchain-leap0 +``` + +```bash uv +uv add langchain-leap0 +``` + + +## Create a sandbox backend + +In Python, you create the sandbox using the provider SDK, then wrap it with the [deepagents backend](/oss/deepagents/backends). + +```python +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") + print(result.output) +finally: + client.sandboxes.delete(sandbox) + client.close() +``` + +## Use with Deep Agents + +```python +from leap0 import Leap0Client +from langchain_anthropic import ChatAnthropic + +from deepagents import create_deep_agent +from langchain_leap0 import Leap0Sandbox + +client = Leap0Client() +sandbox = client.sandboxes.create() +backend = Leap0Sandbox(client=client, sandbox=sandbox) + +agent = create_deep_agent( + model=ChatAnthropic(model="claude-sonnet-4-20250514"), + system_prompt="You are a coding assistant with sandbox access.", + backend=backend, +) + +try: + result = agent.invoke( + { + "messages": [ + {"role": "user", "content": "Create a hello world Python script and run it"} + ] + } + ) +finally: + client.sandboxes.delete(sandbox) + client.close() +``` + +## Cleanup + +You are responsible for managing the sandbox lifecycle via the Leap0 SDK. +When you are done, delete the sandbox and close the client. + +See also: [Sandboxes](/oss/deepagents/sandboxes). From 84119570eca90699b39f60cd35413fb629f90738 Mon Sep 17 00:00:00 2001 From: Julia Passynkova Date: Thu, 9 Apr 2026 20:28:29 -0400 Subject: [PATCH 2/3] Add Leap0 sandbox integration docs --- src/images/providers/dark/leap0.svg | 1 + src/images/providers/light/leap0.svg | 1 + src/oss/deepagents/sandboxes.mdx | 11 ++--- .../python/integrations/sandboxes/index.mdx | 11 ++--- src/snippets/deepagents-sandbox-basic-py.mdx | 45 +++++++++++++++++++ 5 files changed, 59 insertions(+), 10 deletions(-) create mode 100644 src/images/providers/dark/leap0.svg create mode 100644 src/images/providers/light/leap0.svg diff --git a/src/images/providers/dark/leap0.svg b/src/images/providers/dark/leap0.svg new file mode 100644 index 0000000000..31aea0eae3 --- /dev/null +++ b/src/images/providers/dark/leap0.svg @@ -0,0 +1 @@ +Leap0 diff --git a/src/images/providers/light/leap0.svg b/src/images/providers/light/leap0.svg new file mode 100644 index 0000000000..e2d7fb5169 --- /dev/null +++ b/src/images/providers/light/leap0.svg @@ -0,0 +1 @@ +Leap0 diff --git a/src/oss/deepagents/sandboxes.mdx b/src/oss/deepagents/sandboxes.mdx index 70f8647787..0f6c39620d 100644 --- a/src/oss/deepagents/sandboxes.mdx +++ b/src/oss/deepagents/sandboxes.mdx @@ -96,15 +96,16 @@ For provider-specific setup, authentication, and lifecycle details, see [sandbox Node VFS - - - Leap0 - - LangSmith + + + + + Leap0 + ::: diff --git a/src/oss/python/integrations/sandboxes/index.mdx b/src/oss/python/integrations/sandboxes/index.mdx index bd98f60081..2164fd35ed 100644 --- a/src/oss/python/integrations/sandboxes/index.mdx +++ b/src/oss/python/integrations/sandboxes/index.mdx @@ -31,15 +31,16 @@ Sandboxes provide isolated execution environments for running agent-generated co Runloop - - - Leap0 - - LangSmith + + + + + Leap0 + If you'd like to contribute a sandbox, see [Implement a sandbox integration](/oss/contributing/implement-langchain#sandboxes). diff --git a/src/snippets/deepagents-sandbox-basic-py.mdx b/src/snippets/deepagents-sandbox-basic-py.mdx index 61af3c0e9e..164b193be8 100644 --- a/src/snippets/deepagents-sandbox-basic-py.mdx +++ b/src/snippets/deepagents-sandbox-basic-py.mdx @@ -180,4 +180,49 @@ ``` + + + + ```bash pip + pip install langchain-leap0 + ``` + + ```bash uv + uv add langchain-leap0 + ``` + + + ```python + from deepagents import create_deep_agent + from langchain_anthropic import ChatAnthropic + from langchain_leap0 import Leap0Sandbox + from leap0 import Leap0Client + + client = Leap0Client() + sandbox = client.sandboxes.create() + backend = Leap0Sandbox(client=client, sandbox=sandbox) + + agent = create_deep_agent( + model=ChatAnthropic(model="claude-sonnet-4-6"), + system_prompt="You are a Python coding assistant with sandbox access.", + backend=backend, + ) + + try: + result = agent.invoke( + { + "messages": [ + { + "role": "user", + "content": "Create a small Python package and run pytest", + } + ] + } + ) + finally: + client.sandboxes.delete(sandbox) + client.close() + ``` + + From 10eedae685260c9e285967012c5ab15eb3fd7afa Mon Sep 17 00:00:00 2001 From: Julia Passynkova Date: Sun, 12 Apr 2026 13:41:21 -0400 Subject: [PATCH 3/3] Add Leap0 sandbox integration docs (js) --- src/oss/deepagents/sandboxes.mdx | 2 +- .../integrations/providers/leap0.mdx | 122 ++++++++++++++++++ .../integrations/sandboxes/index.mdx | 6 + 3 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 src/oss/javascript/integrations/providers/leap0.mdx diff --git a/src/oss/deepagents/sandboxes.mdx b/src/oss/deepagents/sandboxes.mdx index 0f6c39620d..570aa2b7c9 100644 --- a/src/oss/deepagents/sandboxes.mdx +++ b/src/oss/deepagents/sandboxes.mdx @@ -101,7 +101,7 @@ For provider-specific setup, authentication, and lifecycle details, see [sandbox LangSmith - + Leap0 diff --git a/src/oss/javascript/integrations/providers/leap0.mdx b/src/oss/javascript/integrations/providers/leap0.mdx new file mode 100644 index 0000000000..553995d6f7 --- /dev/null +++ b/src/oss/javascript/integrations/providers/leap0.mdx @@ -0,0 +1,122 @@ +--- +title: "Leap0" +sidebarTitle: "Leap0" +description: "Use Leap0 sandbox backends with Deep Agents for isolated code execution with fast cold starts" +--- + +[Leap0](https://leap0.dev) provides cloud sandboxes for AI agents: isolated compute, filesystem, and network boundaries, with sandboxes that start in about 200ms. See the [Leap0 docs](https://leap0.dev/docs) for signup, API keys, and platform details. + +The LangChain integration is published as [`@leap0/langchain-leap0`](https://www.npmjs.com/package/@leap0/langchain-leap0). It implements the Deep Agents sandbox backend and pairs with the [`leap0`](https://www.npmjs.com/package/leap0) TypeScript SDK. + +## Setup + + + ```bash npm + npm install @leap0/langchain-leap0 deepagents leap0 + ``` + + ```bash yarn + yarn add @leap0/langchain-leap0 deepagents leap0 + ``` + + ```bash pnpm + pnpm add @leap0/langchain-leap0 deepagents leap0 + ``` + + +`@leap0/langchain-leap0` declares **peer dependencies** on `deepagents` and `leap0`; install them alongside the integration package as shown above. + +### Authentication + +```bash +export LEAP0_API_KEY="your-key" +``` + +## Create a sandbox backend + +Create a sandbox with the Leap0 SDK, then connect it with `Leap0Sandbox.fromConnected`. + +:::js +```typescript +import { Leap0Client } from "leap0"; +import { Leap0Sandbox } from "@leap0/langchain-leap0"; + +const client = new Leap0Client(); +const sandbox = await client.sandboxes.create(); +const backend = Leap0Sandbox.fromConnected(client, sandbox); + +try { + const result = await backend.execute("echo 'Hello from Leap0'"); + console.log(result.output); +} finally { + try { + await sandbox.delete(); + } finally { + await client.close(); + } +} +``` +::: + +### One-step create + +To have the integration create a `Leap0Client`, provision a sandbox, and own teardown: + +:::js +```typescript +import { Leap0Sandbox } from "@leap0/langchain-leap0"; + +const backend = await Leap0Sandbox.create({ + leap0Config: {}, + createParams: { templateName: "base" }, +}); + +try { + const result = await backend.execute("echo hello"); + console.log(result.output); +} finally { + await backend.close(); // deletes sandbox and closes the client +} +``` +::: + +## Usage with Deep Agents + +:::js +```typescript +import { createDeepAgent } from "deepagents"; +import { ChatAnthropic } from "@langchain/anthropic"; +import { Leap0Sandbox } from "@leap0/langchain-leap0"; +import { Leap0Client } from "leap0"; + +const client = new Leap0Client(); +const sandbox = await client.sandboxes.create(); +const backend = Leap0Sandbox.fromConnected(client, sandbox); + +try { + const agent = createDeepAgent({ + model: new ChatAnthropic({ model: "claude-sonnet-4-20250514" }), + systemPrompt: "You are a coding assistant with sandbox access.", + backend, + }); + + const result = await agent.invoke({ + messages: [ + { role: "user", content: "Create a hello world Python script and run it" }, + ], + }); +} finally { + try { + await sandbox.delete(); + } finally { + await client.close(); + } +} +``` +::: + +## Cleanup + +You are responsible for managing the sandbox lifecycle via the Leap0 SDK unless you use `Leap0Sandbox.create` and `backend.close()` as above. + +See also: [Sandboxes](/oss/deepagents/sandboxes). diff --git a/src/oss/javascript/integrations/sandboxes/index.mdx b/src/oss/javascript/integrations/sandboxes/index.mdx index bee1ecbb87..4c868c754f 100644 --- a/src/oss/javascript/integrations/sandboxes/index.mdx +++ b/src/oss/javascript/integrations/sandboxes/index.mdx @@ -29,6 +29,12 @@ Sandboxes provide isolated execution environments for running agent-generated co LangSmith + + + + + Leap0 + If you'd like to contribute a sandbox, see [Implement a sandbox integration](/oss/contributing/implement-langchain#sandboxes).