opensandbox
OpenSandbox Python SDK - Secure, isolated execution environments
What it is and what it does
OpenSandbox is a Python SDK for interacting with remote secure sandbox environments hosted by an OpenSandbox service. It abstracts the HTTP API (via httpx) and provides both async and synchronous interfaces to create sandboxes, execute shell commands, manage files, and monitor resource usage. The package includes lifecycle management (pause, resume, renew), context managers for resource cleanup, and a sandbox pool abstraction to reduce acquisition latency by maintaining a buffer of ready environments.
The SDK targets developers who need to execute untrusted or isolated code safely—such as code evaluation platforms, CI/CD systems, or security research tools. It depends on attrs, pydantic, and python-dateutil for configuration and data modeling. Optional Redis support (via opensandbox[pool-redis]) enables distributed pool state management for multi-process or multi-pod deployments, though the core SDK works with in-memory state stores for development and single-process use.
Use it for:
- Execute untrusted user code safely in isolated environments for code evaluation or sandbox-as-a-service platforms.
- Manage a pool of pre-warmed sandboxes to reduce latency in high-throughput code execution workloads.
- Automate testing or security analysis workflows that require isolated file systems and process isolation.
- Build CI/CD pipelines that need to run build steps or tests in ephemeral, secure containers.
- Implement distributed sandbox orchestration across multiple processes or Kubernetes pods using Redis-backed pool state.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
OpenSandbox SDK provides low-level Python bindings to create, manage, and interact with remote secure sandbox environments, supporting shell command execution, file management, and resource monitoring through both async and sync APIs.
Yes, if you have access to an OpenSandbox service and need a Python client for sandbox lifecycle and command execution. The package is actively maintained, has low install friction, and covers both async and sync use cases. However, note the alpha status (Development Status :: 3 - Alpha) and verify API stability guarantees before adopting in production; also confirm that the optional Redis pool backend meets your deployment model.
Install
opensandbox on PyPI
pip
pip install opensandboxuv
uv add opensandboxpoetry
poetry add opensandboxInstalling opensandbox
Before you install
Low install friction with four lightweight runtime dependencies (attrs, httpx, pydantic, python-dateutil). Active maintenance with recent releases and a healthy repository signal (12930 stars, last commit 2026-08-14). Supports Python 3.10–3.13.
License in practice
Apache License 2.0 is permissive; you may use, modify, and distribute this package freely in commercial and open-source projects, provided you include the license text and document any changes.
Quickstart
import asyncio
from opensandbox.sandbox import Sandbox
from opensandbox.config import ConnectionConfig
async def main():
config = ConnectionConfig(domain="api.opensandbox.io", api_key="your-api-key")
sandbox = await Sandbox.create("ubuntu", connection_config=config)
try:
execution = await sandbox.commands.run("echo 'Hello Sandbox!'")
print(execution.logs.stdout[0].text)
finally:
await sandbox.destroy()
asyncio.run(main())
Requires an active OpenSandbox service endpoint (domain and API key); the SDK is a client library and does not run sandboxes locally.
Verify before relying
- Whether the optional Redis pool backend (opensandbox[pool-redis]) is production-ready or still alpha-stage.
- Performance characteristics and latency of sandbox creation and command execution under load.
- API stability guarantees given the Development Status :: 3 - Alpha classifier.
Package facts
| License | Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — attrs, httpx, pydantic, python-dateutil |
| Maintenance | actively maintained — 21 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 185,249/month — #10,014 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: opensandbox-0.1.15-py3-none-any.whl
Keywords: code-execution, docker, opensandbox, sandbox, sdk, security
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
k8s-agent-sandboxA Python client library for creating and…
permissive · top 15,000 on PyPI
e2bE2B provides a Python SDK to create and control…
permissive · top 5,000 on PyPI
koyeb-sdkOfficial Python SDK for Koyeb that provides…
permissive · top 15,000 on PyPI
e2b-desktopProvides a Python SDK to create and control…
permissive · top 15,000 on PyPI
prime-sandboxesPython SDK for creating, managing, and…
permissive · top 15,000 on PyPI
cwsandboxA Python client library for running and…
permissive · top 15,000 on PyPI
e2b-code-interpreterRuns AI-generated or arbitrary Python code in…
permissive · top 5,000 on PyPI
hyperlight-sandboxHyperlight-sandbox provides a Python API for…
permissive · top 15,000 on PyPI
daytonaDaytona is a Python SDK for managing and…
permissive · top 5,000 on PyPI
cloudshell-shell-coreProvides the base driver interface and context…
permissive · top 15,000 on PyPI