Skip to main content

Python SDK for the Concave sandbox service - isolated code execution environments

Project description

Concave Sandbox Banner

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

Get Your API Key

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", api_key="api_key_here") 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", api_key="api_key_here")

# 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

concave_sandbox-0.1.45.tar.gz (584.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

concave_sandbox-0.1.45-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file concave_sandbox-0.1.45.tar.gz.

File metadata

  • Download URL: concave_sandbox-0.1.45.tar.gz
  • Upload date:
  • Size: 584.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for concave_sandbox-0.1.45.tar.gz
Algorithm Hash digest
SHA256 4ea016928962d8f2a65fc034d93187f8428c066516dba78bb96ffd24a0acb08b
MD5 382b63dbc6512e04983a4506ee45aaaa
BLAKE2b-256 696de5d6ad8328cdcfbd9087b4120398a701938dc6df869797a85d68b8462298

See more details on using hashes here.

File details

Details for the file concave_sandbox-0.1.45-py3-none-any.whl.

File metadata

File hashes

Hashes for concave_sandbox-0.1.45-py3-none-any.whl
Algorithm Hash digest
SHA256 f80f162e9f6003e15fade2bb6475c50199235468c205fe689ca685c902e9325c
MD5 bd083251a7d4ae1d55a5df9314aeb207
BLAKE2b-256 08554f164a4d1df9c7a47807839084d73ca50a42d94eb3143cd2a8444ca6f703

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page