Python SDK for the Concave sandbox service - isolated code execution environments
Project description
What's this?
This is a Python SDK for creating and managing sandboxes. These sandboxes run at scale on our infrastructure, while you can focus on using them to do anything you want.
Well, what can I do with it?
Run untrusted AI generated code, power deep research systems, environment for coding agents, train RL agents, malware analysis, or build interactive compute experiences—all in secure, high-performance sandboxes.
Features
- Secure Isolation: Complete VM-level isolation using Firecracker microVMs—every sandbox runs in its own kernel (unlike Docker containers that share the host kernel)
- Python Execution: Run Python code securely in isolated sandboxes
- Blazing Fast: Full VM boot up in under 200ms
- Simple API: Clean, intuitive interface with easy-to-use client SDKs
- Production Ready: Comprehensive error handling and type hints
Installation
pip install concave-sandbox
Quick Start
Configuration
Set your API key as an environment variable:
export CONCAVE_SANDBOX_API_KEY="your_api_key_here"
Sign up at concave.ai to get your API key.
Run Python Code
Execute Python code securely in isolated sandboxes:
from concave import sandbox
with sandbox(name="python-sandbox") as sbx:
result = sbx.run("print(668.5 * 2)")
print(result.stdout)
# Output: 1337.0
Manual Cleanup
If you prefer to manage the sandbox lifecycle yourself:
from concave import Sandbox
sbx = Sandbox.create(name="my-sandbox")
# Execute shell commands
result = sbx.execute("uname -a")
print(result.stdout) # Linux ...
# Run Python code
result = sbx.run("print('Hello from Python!')")
print(result.stdout) # Hello from Python!
# Clean up
sbx.delete()
Documentation
For complete API reference, advanced examples, error handling, and best practices, visit docs.concave.ai.
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 concave_sandbox-0.2.1.tar.gz.
File metadata
- Download URL: concave_sandbox-0.2.1.tar.gz
- Upload date:
- Size: 584.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d0c2251a26314b8aa842185004a6568bd1780514a6f5d52681bb45ae55a8d9c
|
|
| MD5 |
145bc6529fd52acef2ed822ce4f66aa2
|
|
| BLAKE2b-256 |
cb7cb807934b8c72d469494d6eedd589bffd81269dd3fdc6bb4edbbf77d1ff86
|
File details
Details for the file concave_sandbox-0.2.1-py3-none-any.whl.
File metadata
- Download URL: concave_sandbox-0.2.1-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62dd5bc9cbd3d441ae8d155c2bab2c4593f78969a224908135bcb4f8383573c5
|
|
| MD5 |
03ac3e63f23c49a96edb4ded4eef43cf
|
|
| BLAKE2b-256 |
b1af04463a29791dbf56f7504c3aa9d09f8b67dce84e16509d031cdc5847002e
|