Skip to main content

langchain-sandbox-opensandbox

PyPI - Version PyPI - License PyPI - Downloads

OpenSandbox sandbox integration for Deep Agents.

Quick Install

uv add langchain-sandbox-opensandbox

The distribution is published as langchain-sandbox-opensandbox, but the import package is langchain_opensandbox.

from opensandbox import SandboxSync

from langchain_opensandbox import OpenSandboxBackend

sandbox = SandboxSync.create("python:3.12")
backend = OpenSandboxBackend(sandbox=sandbox, timeout=300)

result = backend.execute("echo hello")
print(result.output)

🤔 What is this?

OpenSandboxBackend adapts the OpenSandbox Python SDK to the BaseSandbox interface used by Deep Agents, so you can run agent-generated commands and file operations inside an OpenSandbox environment.

It implements the three sandbox primitives — execute, upload_files, and download_files — on top of the OpenSandbox SDK. The higher-level file helpers (ls, read_file, write_file, glob, grep) are provided by BaseSandbox and built on top of execute.

Configuration

OpenSandboxBackend wraps an existing opensandbox.SandboxSync instance, so it inherits the SDK's configuration. The SDK reads connection settings from the environment:

Variable Description
OPENSANDBOX_DOMAIN Host (and optional port) of the OpenSandbox server.
OPENSANDBOX_PROTOCOL Protocol used to reach the server (http or https).
OPENSANDBOX_API_KEY API key, if the server requires authentication.

Development

uv sync
make lint            # ruff check + format --diff
make test            # unit tests (no network)
make integration_tests   # conformance suite (requires a running OpenSandbox server)
make build           # build wheel + sdist

The integration tests run the standard SandboxIntegrationTests conformance suite from langchain-tests. They are skipped unless OPENSANDBOX_DOMAIN is set.

Releases & Versioning

This package follows semantic versioning.

Contributing

Contributions are welcome. Please open an issue or pull request on GitHub.

License

Apache License 2.0. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_sandbox_opensandbox-0.1.0.tar.gz (161.7 kB view details)

Uploaded Source

Built Distribution

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

langchain_sandbox_opensandbox-0.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for langchain_sandbox_opensandbox-0.1.0.tar.gz
Algorithm Hash digest
SHA256 334a6c4bbb73fcbb3ad21114af2f86319b7f0cb90dfb4dcb7291ce8f226b699e
MD5 d3fa8b802eab2c61ee80855dfdcf278a
BLAKE2b-256 ee6c5d50a8d35c07effc4ae59e140df2a223ebb50f8daf0edd59692e4359c2ac

See more details on using hashes here.

File details

Details for the file langchain_sandbox_opensandbox-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_sandbox_opensandbox-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f6f26cbc3824d345ebfa321911e052c7e00a049d14cde948138f6fef009ce6a7
MD5 e892a706d6d6faa34f928809b52ca599
BLAKE2b-256 4da0a9fde7b2b0ddea7500f504b56cf6ed583e83f2b6f83bdd84f364bb236462

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.2

2 files

0.1.1

2 files

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page