Docker sandbox integration for Deep Agents
Project description
deepagents-docker-sandbox
Docker sandbox integration for Deep Agents.
This package exposes DockerSandbox as the Deep Agents-compatible backend and DockerSandboxRuntime as the lower-level Docker runtime.
Quick install (PyPI)
When/if the project is published to PyPI end users should be able to install with:
pip install deepagents-docker-sandbox
Local development
The project installs deepagents from PyPI by default, so a standalone checkout can run with uv sync --group test or the test commands below.
Usage with DockerSandbox
from deepagents_docker_sandbox import DockerSandbox
with DockerSandbox.create(default_timeout=120) as sandbox:
result = sandbox.execute("echo hello")
print(result.output)
Low-level DockerSandboxRuntime example
For direct access to the lower-level Docker runtime:
from deepagents_docker_sandbox import DockerSandboxRuntime
with DockerSandboxRuntime.create() as runtime:
runtime.write_file("/tmp/hello.txt", "hello")
result = runtime.run("cat /tmp/hello.txt")
print(result.stdout)
Requirements
This package requires a working Docker daemon for real sandbox execution.
The default runtime creates a container from python:3.11-slim, injects a small helper process, exposes that helper on a random host port, and applies conservative resource and security settings.
Security
Docker isolation depends on the host Docker daemon and container configuration. Do not treat this package as a complete multi-tenant security boundary without additional host hardening, image controls, network controls, and workload isolation.
Tests
Default suite:
PYTHONPATH=src uv run --group test pytest -q
Docker-gated runtime round trip:
DEEPAGENTS_DOCKER_SANDBOX_TESTS=1 PYTHONPATH=src uv run --group test pytest tests/test_docker_runtime.py::test_optional_docker_runtime_roundtrip -q
Deep Agents standard sandbox integration checks:
DEEPAGENTS_DOCKER_SANDBOX_RUN_INTEGRATION=1 PYTHONPATH=src uv run --group test pytest tests/integration_tests -q
Notebooks
Example notebooks live in notebooks/ and are not part of the installed library.
Release process
Releases are published through GitHub Actions with PyPI Trusted Publishing.
One-time publishing setup
Configure pending trusted publishers on TestPyPI and PyPI for the deepagents-docker-sandbox project:
- Owner:
Alex2Yang97 - Repository:
deepagents_docker_sandbox - Workflow:
publish.yml - TestPyPI environment:
testpypi - PyPI environment:
pypi
In GitHub repository settings, create matching Actions environments:
testpypi: allow manual deployments frommain.pypi: require reviewer approval and restrict deployments to release tags matchingv*when available.
Protect main with pull request reviews, required CI status checks, resolved conversations, and disabled force pushes/deletions before publishing production releases.
Publishing a release
- Open a pull request and wait for the CI workflow to pass.
- Run the
Publishworkflow manually frommainto publish the current version to TestPyPI. - Smoke test the TestPyPI package in a clean environment:
python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ deepagents-docker-sandbox==0.0.1
python -c "from deepagents_docker_sandbox import DockerSandboxRuntime; print(DockerSandboxRuntime)"
- Create and push a version tag, for example
v0.0.1, to publish the same version to PyPI.
Before tagging a release, keep the version in pyproject.toml and src/deepagents_docker_sandbox/_version.py synchronized.
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 deepagents_docker_sandbox-0.0.1.tar.gz.
File metadata
- Download URL: deepagents_docker_sandbox-0.0.1.tar.gz
- Upload date:
- Size: 146.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8dae6d77f0450d186204e3ac1359152cffc6513a512d21bfed3a033c48bfc8ee
|
|
| MD5 |
10e76c98ed830a21a2edfa2450f7b14d
|
|
| BLAKE2b-256 |
6013941da383b465f631ccb9307aa398aeb0d8b8c578889e0446abc63914afc4
|
Provenance
The following attestation bundles were made for deepagents_docker_sandbox-0.0.1.tar.gz:
Publisher:
publish.yml on Alex2Yang97/deepagents_docker_sandbox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
deepagents_docker_sandbox-0.0.1.tar.gz -
Subject digest:
8dae6d77f0450d186204e3ac1359152cffc6513a512d21bfed3a033c48bfc8ee - Sigstore transparency entry: 1562236539
- Sigstore integration time:
-
Permalink:
Alex2Yang97/deepagents_docker_sandbox@a3bff02f666288712d85a82719bb1bac42e0ed9c -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/Alex2Yang97
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a3bff02f666288712d85a82719bb1bac42e0ed9c -
Trigger Event:
push
-
Statement type:
File details
Details for the file deepagents_docker_sandbox-0.0.1-py3-none-any.whl.
File metadata
- Download URL: deepagents_docker_sandbox-0.0.1-py3-none-any.whl
- Upload date:
- Size: 11.8 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 |
0c2f945d54c256d28c6ed0da193b326aa422b721fc2d325d78c00f49b7e0bd1a
|
|
| MD5 |
7a50726097f90150fdf5889fc157dbfe
|
|
| BLAKE2b-256 |
3a9670310e8231d86f6e7c75a3724e696c949636de1a818be96d8e6f800bf1a6
|
Provenance
The following attestation bundles were made for deepagents_docker_sandbox-0.0.1-py3-none-any.whl:
Publisher:
publish.yml on Alex2Yang97/deepagents_docker_sandbox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
deepagents_docker_sandbox-0.0.1-py3-none-any.whl -
Subject digest:
0c2f945d54c256d28c6ed0da193b326aa422b721fc2d325d78c00f49b7e0bd1a - Sigstore transparency entry: 1562236556
- Sigstore integration time:
-
Permalink:
Alex2Yang97/deepagents_docker_sandbox@a3bff02f666288712d85a82719bb1bac42e0ed9c -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/Alex2Yang97
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a3bff02f666288712d85a82719bb1bac42e0ed9c -
Trigger Event:
push
-
Statement type: