langchain-microsandbox
Community-maintained Microsandbox integration for Deep Agents. It adapts an
existing microsandbox.Sandbox to the current
Deep Agents BaseSandbox interface.
This project targets the current local microVM-based Microsandbox SDK. It does
not use the legacy PythonSandbox server/JSON-RPC API.
Requirements
- Python 3.11 or newer.
deepagents>=0.7.0,<0.8.0.microsandbox>=0.6.8,<0.7.0.- A platform supported by Microsandbox: Apple Silicon macOS, glibc-based Linux with KVM, or Windows with Windows Hypervisor Platform.
- A sandbox image containing
python3, because inherited Deep Agents file and search operations execute small Python helpers inside the guest.
Install
uv add langchain-microsandbox
Usage
Microsandbox's Python SDK is asynchronous, so construct the backend with
await MicrosandboxSandbox.create(...).
from deepagents import create_deep_agent
from microsandbox import Sandbox
from langchain_microsandbox import MicrosandboxSandbox
sandbox = await Sandbox.create(
"deepagents-session",
image="python:3.13-slim",
ephemeral=True,
)
try:
backend = await MicrosandboxSandbox.create(sandbox)
agent = create_deep_agent(backend=backend)
result = await agent.ainvoke(
{
"messages": [
{
"role": "user",
"content": "Create a small Python package and run pytest.",
}
]
}
)
finally:
await sandbox.stop()
The adapter does not own the sandbox lifecycle. The application that creates a
sandbox must also stop it and choose the appropriate persistence or removal
policy. In the example above, ephemeral=True removes sandbox state when the
sandbox stops.
Both synchronous and asynchronous Deep Agents backend methods are available. Async calls use the Microsandbox SDK directly. Sync calls use a compatibility bridge that is safe to call from a thread that already has a running asyncio event loop.
Development
Install the locked development environment:
uv sync --all-groups
Run the local checks:
make check
Integration tests start a real ephemeral microVM and require working local virtualization:
uv run msb doctor
make integration_test
Use make integration_smoke for a faster command, timeout, and file-transfer
subset while iterating locally.
See CONTRIBUTING.md for the complete development and release workflow.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_microsandbox-0.0.2.tar.gz.
File metadata
- Download URL: langchain_microsandbox-0.0.2.tar.gz
- Upload date:
- Size: 171.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1573d95cfb1b9287c828812d60b7309bfb6fffb881e664be00721c59f9a6b5af
|
|
| MD5 |
5e91c84dcc45273a06a3549da52c305a
|
|
| BLAKE2b-256 |
a2fe13c38d32760105ba9f50320def17a84c5d63ffce40a4c0345c0b2cfe4482
|
Provenance
The following attestation bundles were made for langchain_microsandbox-0.0.2.tar.gz:
Publisher:
release.yml on kenwoodjw/langchain-microsandbox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_microsandbox-0.0.2.tar.gz -
Subject digest:
1573d95cfb1b9287c828812d60b7309bfb6fffb881e664be00721c59f9a6b5af - Sigstore transparency entry: 2581364756
- Sigstore integration time:
-
Permalink:
kenwoodjw/langchain-microsandbox@8a2f0b646c5af81373f3fba8708a0c4b159a7bc2 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/kenwoodjw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8a2f0b646c5af81373f3fba8708a0c4b159a7bc2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file langchain_microsandbox-0.0.2-py3-none-any.whl.
File metadata
- Download URL: langchain_microsandbox-0.0.2-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcf3fce58aeb126059147d8ae81334c356bd61738684561830073ec796441b30
|
|
| MD5 |
1358a44d873e2d64df5d8f70e9dbe539
|
|
| BLAKE2b-256 |
bb3a485e0988f1af17168d025dd27fc11a70287b4a9c1e2fb1896c70a44840d4
|
Provenance
The following attestation bundles were made for langchain_microsandbox-0.0.2-py3-none-any.whl:
Publisher:
release.yml on kenwoodjw/langchain-microsandbox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_microsandbox-0.0.2-py3-none-any.whl -
Subject digest:
dcf3fce58aeb126059147d8ae81334c356bd61738684561830073ec796441b30 - Sigstore transparency entry: 2581364765
- Sigstore integration time:
-
Permalink:
kenwoodjw/langchain-microsandbox@8a2f0b646c5af81373f3fba8708a0c4b159a7bc2 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/kenwoodjw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8a2f0b646c5af81373f3fba8708a0c4b159a7bc2 -
Trigger Event:
release
-
Statement type: