Skip to main content

CubePod Python SDK

Async-first Python client for CubePod — a persistent, writable-RootFS MicroVM execution platform for AI agents with an E2B-compatible Control & Data Plane API.

Installation

pip install cubepod

Requires Python 3.11+.

Quickstart (Async & Sync)

import asyncio
from cubepod import AsyncCubePod, CubePod

async def main() -> None:
    async with AsyncCubePod(base_url="http://localhost:8080", api_key="...") as client:
        box = await client.create("cubeplex-ubuntu24-desktop")
        res = await client.execute(box.sandbox_id, "python3 --version")
        print(res.output)
        await client.delete(box.sandbox_id)

asyncio.run(main())

# Synchronous client
with CubePod(base_url="http://localhost:8080", api_key="...") as client:
    box = client.create("cubeplex-ubuntu24-desktop")
    print(client.execute(box.sandbox_id, "uname -a").output)
    client.delete(box.sandbox_id)

Command Execution & Cursor Logs

  • Foreground: await client.execute(sandbox_id, "echo hello", workdir="/workspace", envs={"FOO": "bar"})
  • Background & Incremental Polling:
    cmd = await client.start_command(sandbox_id, "for i in 1 2 3; do echo $i; sleep 1; done")
    logs = await client.poll_command(sandbox_id, cmd.id, cursor=0)
    # Or stream until completion:
    async for chunk in client.stream_command(sandbox_id, cmd.id):
        print(chunk.content, end="")
    

Files & Streaming Archive Sync

await client.write_file(sandbox_id, "/workspace/hello.txt", "hello cubepod\n")

# Stream large files incrementally
stream = await client.stream_file(sandbox_id, "/workspace/hello.txt")
async for chunk in stream:
    print(chunk)

# Atomic tar.gz directory sync into the sandbox
await client.archive_sync(
    sandbox_id,
    {"app/main.py": "print('synced')\n"},
    dest="/workspace",
)

Persistent Lifecycle, Reset & 1s CoW Fork

CubePod decouples the container RootFS upperdir from /workspace:

  • await client.pause(sandbox_id) — suspend compute while retaining both RootFS Upper and Workspace block PVCs.
  • await client.connect(sandbox_id) — resume a paused sandbox automatically.
  • await client.reset_rootfs(sandbox_id) — wipe RootFS upperdir changes while keeping /workspace intact.
  • await client.fork(sandbox_id) — create a Copy-on-Write clone of both RootFS and Workspace volumes.

Zero-Trust cpodref_ Egress

Never inject raw API credentials into agent sandboxes. Pass secret_bindings with cpodref_ placeholders at create(...) time; cubepod-egress swaps placeholders for real credentials over per-sandbox mTLS only when outbound requests leave the sandbox toward allowed target hosts.

Metadata

Release files for cubepod 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cubepod 0.4.1
File Size Uploaded Provenance Actions
cubepod-0.4.1.tar.gz 26.7 kB With provenance Details for cubepod-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cubepod 0.4.1
File Interpreter ABI Platform Actions
cubepod-0.4.1-py3-none-any.whl Python 3 none any Details for cubepod-0.4.1-py3-none-any.whl

Total release size: 44.9 kB

Release files / cubepod-0.4.1.tar.gz

Download URL cubepod-0.4.1.tar.gz
Size 26.7 kB
Tags Source
SHA-256 checksum
How to use checksums
eca9a5d5435a4459b82c3f28e81c99e760d694d6e8d1ea68e1fd6aeb632ef90d
BLAKE2b-256 checksum
How to use checksums
fa2bfce732dc0e7c39a7e2824eda15f1306ee98aa91ae5d406f39d4659b6b21f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

Release files / cubepod-0.4.1-py3-none-any.whl

Download URL cubepod-0.4.1-py3-none-any.whl
Size 18.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c97a7738d9b276bcff2ece5e838eeaa4b7078e3ae061f0eb91ce265b93cd9f16
BLAKE2b-256 checksum
How to use checksums
1750a62f3947d57a74f0ee12da1aee23b38a3fee9763d96d8998aea234e4542d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

Security for cubepod 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cubepod-0.4.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page