pip install universal-sandbox
One SDK for every
sandbox provider
A unified Python SDK for secure code execution across E2B, AWS Bedrock, and Volcengine. Same interface, any provider.
from universal_sandbox import sandbox
with sandbox.code_interpreter.create() as sbx:
result = sbx.execute("print('Hello')")
print(result.stdout)Features
Unified Interface
Same API across all providers. Switch with a single parameter.
Three Sandbox Types
Code interpreter, browser automation, and all-in-one environments.
Context Managers
Automatic resource cleanup with Python's with statement.
Type Hints
Full type annotations for better IDE support and code safety.
VNC & MCP Support
Remote desktop access and Model Context Protocol integration.
Multi-Region
Deploy to 16+ AWS regions, global E2B, or cn-beijing on Volcengine.
Providers
Switch providers with one line of code.
E2B
Fast sandbox creation with global availability
Global
AWS Bedrock
Managed code interpreter in 16+ regions
us-east-1, us-west-2, eu-west-1, ...
Volcengine
ByteDance cloud with MCP and VNC
cn-beijing
Sandbox Types
| Type | Description | Providers |
|---|---|---|
| code_interpreter | Python code execution | E2B, Volcengine, AWS Bedrock |
| browser | Browser automation with WebSocket | E2B, Volcengine |
| aio | All-in-one with MCP and VNC | Volcengine |
Examples
from universal_sandbox import sandbox
with sandbox.code_interpreter.create() as sbx:
result = sbx.execute("print('Hello World!')")
print(result.stdout)
# Use AWS Bedrock
with sandbox.code_interpreter.create(provider="aws") as sbx:
result = sbx.execute("import math; print(math.pi)")
print(result.stdout)