Upstash Box sandbox integration for Deep Agents
Project description
langchain-upstash-box
Upstash Box sandbox integration for Deep Agents.
An Upstash Box is a secure, isolated cloud container with a full Linux shell, filesystem, git, and a runtime. This package wraps a box as a Deep Agents SandboxBackendProtocol, so agents can run shell commands and read/write files inside it.
Quick install
uv add langchain-upstash-box
# or: pip install langchain-upstash-box
Usage
Set your Box API key (create one in the Upstash Console):
export UPSTASH_BOX_API_KEY="box_xxxxxxxxxxxx"
Provision a box and use it as a sandbox backend:
from langchain_upstash_box import UpstashBoxSandbox
# Creates a box and waits until it is ready.
sandbox = UpstashBoxSandbox.create(runtime="python")
result = sandbox.execute("echo hello")
print(result.output) # "hello"
print(result.exit_code) # 0
# Filesystem helpers (ls / read / write / edit / glob / grep) are provided by
# BaseSandbox on top of execute() + upload/download.
sandbox.write("/workspace/home/hello.py", "print('hi from box')")
print(sandbox.read("/workspace/home/hello.py").content)
sandbox.delete()
Wrap an existing box instead of creating one:
from langchain_upstash_box import UpstashBoxSandbox
sandbox = UpstashBoxSandbox(box_id="current-wasp-05510")
Use with a Deep Agent
from deepagents import create_deep_agent
from langchain_upstash_box import UpstashBoxSandbox
sandbox = UpstashBoxSandbox.create(runtime="python")
agent = create_deep_agent(
model="anthropic:claude-opus-4-6",
backend=sandbox,
)
agent.invoke({"messages": [{"role": "user", "content": "Create app.py and run it."}]})
🤔 What is this?
UpstashBoxSandbox subclasses BaseSandbox and implements execute(), upload_files(), download_files(), and id. All other filesystem tool operations are derived from those by BaseSandbox, which relies on python3 being available inside the box (it is, on the default Debian-based runtimes).
Configuration
| Setting | Source |
|---|---|
| API key | api_key= argument or UPSTASH_BOX_API_KEY env var |
| Base URL | base_url= argument or UPSTASH_BOX_BASE_URL env var (defaults to https://us-east-1.box.upstash.com) |
Development
make test # unit tests (no credentials needed)
make integration_test # integration tests (requires UPSTASH_BOX_API_KEY)
make lint
make format
💁 Contributing
Issues and pull requests are welcome at https://github.com/upstash/box.
License
MIT
Project details
Release history Release notifications | RSS feed
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_upstash_box-0.0.2.tar.gz.
File metadata
- Download URL: langchain_upstash_box-0.0.2.tar.gz
- Upload date:
- Size: 145.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e33dad5bf7b4f10704f8439edf776e96e8dbd639038bb3b902cd7fcf1b7527ea
|
|
| MD5 |
83aecf6e58af4e868397a9b7a4064111
|
|
| BLAKE2b-256 |
92e6398e5f4c9ffe911c2d1c84197fa157da64f078e90691724d22d479e1b508
|
Provenance
The following attestation bundles were made for langchain_upstash_box-0.0.2.tar.gz:
Publisher:
release.yml on upstash/langchain-upstash-box
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_upstash_box-0.0.2.tar.gz -
Subject digest:
e33dad5bf7b4f10704f8439edf776e96e8dbd639038bb3b902cd7fcf1b7527ea - Sigstore transparency entry: 1851938347
- Sigstore integration time:
-
Permalink:
upstash/langchain-upstash-box@6ea0b796240d1ea9bba55d9875270fe1a81dd2b7 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/upstash
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6ea0b796240d1ea9bba55d9875270fe1a81dd2b7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file langchain_upstash_box-0.0.2-py3-none-any.whl.
File metadata
- Download URL: langchain_upstash_box-0.0.2-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b8035f690dd2c9769fd75465e271a34425b0e3ad44d3f6c1a920ab943832225
|
|
| MD5 |
6aca52f11674524f6569d98affee3d57
|
|
| BLAKE2b-256 |
408514990ed3e573cd67577e632948f23ea57cef580d7d0762144512d2ff8f62
|
Provenance
The following attestation bundles were made for langchain_upstash_box-0.0.2-py3-none-any.whl:
Publisher:
release.yml on upstash/langchain-upstash-box
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_upstash_box-0.0.2-py3-none-any.whl -
Subject digest:
9b8035f690dd2c9769fd75465e271a34425b0e3ad44d3f6c1a920ab943832225 - Sigstore transparency entry: 1851938452
- Sigstore integration time:
-
Permalink:
upstash/langchain-upstash-box@6ea0b796240d1ea9bba55d9875270fe1a81dd2b7 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/upstash
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6ea0b796240d1ea9bba55d9875270fe1a81dd2b7 -
Trigger Event:
release
-
Statement type: