Skip to main content

Python SDK for Concave - Secure Sandboxes for AI Agents

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)
  • Code Execution: Run Python and JavaScript 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 Code

Execute Python or JavaScript code securely in isolated sandboxes:

from concave import sandbox

with 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()

# 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!

# Run JavaScript code
result = sbx.run("console.log('Hello from Node.js!')", language="javascript")
print(result.stdout)  # Hello from Node.js!

# 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.7.1.tar.gz (593.3 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.7.1-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: concave_sandbox-0.7.1.tar.gz
  • Upload date:
  • Size: 593.3 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.7.1.tar.gz
Algorithm Hash digest
SHA256 ab644ab9ce269684fb8b1fb0079465b10536d14d5bce9bd0cece77e6df9fa9df
MD5 6e77acbba213e216aa22b1cfd130aef1
BLAKE2b-256 a56340969e9207d18f889fd7c4b292c57d7b8f76447a043816d26c4a0bbbd4e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concave_sandbox-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 202296085f85a920c5eeeb7325d3d9cc1e12651a59ba795f83e9686017bb80cf
MD5 9798b51ddce9c31484702d6d01f3f64f
BLAKE2b-256 2a4b25f2bbd906db286cc94355be40ab9e5cd76d793d16d128a28626400a391b

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