skillfed

opensandbox

OpenSandbox Python SDK - Secure, isolated execution environments

opensandbox v0.1.15 185.2K downloads/30d#10,014 on PyPI12,930
Permissive 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) Active released

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 opensandbox

uv

uv add opensandbox

poetry

poetry add opensandbox

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Software Development :: LibrariesTyping :: Typed

Tags

sandbox environment apiremote code execution sdkisolated execution environmentsdocker sandbox managementsecure code executionsandbox pool managementcontainer lifecycle control
sandbox-executionasync-syncpool-management

More Libraries packages