Skip to main content

MimoBox — Local Sandbox Runtime for AI Agents

Project description

MimoBox Python SDK

PyO3 Python bindings for mimobox sandbox execution with context manager support.

Repository: https://github.com/showkw/mimobox

Architecture

mimobox-python is a thin Python wrapper over mimobox-sdk; Rust owns backend selection, isolation, lifecycle, streaming, snapshots, files, and HTTP proxying.

maturin develop -m crates/mimobox-python/Cargo.toml

Quick Example

from mimobox import Sandbox

with Sandbox(isolation="auto") as sandbox:
    result = sandbox.execute("echo hello", timeout=5.0)
    print(result.stdout)

Streaming output:

from mimobox import Sandbox

with Sandbox(isolation="os") as sandbox:
    for event in sandbox.stream_execute("printf 'a\\nb\\n'"):
        if event.stdout:
            print(event.stdout.decode(), end="")

API

API Purpose
execute, stream_execute Run commands normally or as events.
read_file, write_file Transfer sandbox files as bytes.
snapshot, from_snapshot, fork Capture, restore, or copy state.
http_request Use the whitelisted host HTTP proxy.
wait_ready, is_ready, close Manage lifecycle and readiness.
Isolation Meaning
auto Let mimobox choose the backend.
os Use the OS sandbox backend.
wasm Use the Wasm backend.
microvm Use the microVM backend.

Exceptions

SandboxError is the base exception; SandboxProcessError, SandboxHttpError, and SandboxLifecycleError derive from it.

License

MIT OR Apache-2.0

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

mimobox-0.1.0a0-cp313-abi3-macosx_11_0_arm64.whl (351.7 kB view details)

Uploaded CPython 3.13+macOS 11.0+ ARM64

mimobox-0.1.0a0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

File details

Details for the file mimobox-0.1.0a0-cp313-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mimobox-0.1.0a0-cp313-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ac10dbab0b759e4d9ba9b8c1a70913e6104ddf3676f6fae475b9ccfd1b8b1fd0
MD5 2b4270e7a641c12bc7b6f469de809783
BLAKE2b-256 68fbdd31c82ce373cbbbcd1202c1eb025692cfc470f286d0265fac89d0e2a312

See more details on using hashes here.

File details

Details for the file mimobox-0.1.0a0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mimobox-0.1.0a0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1a2278dddcbb70bf2f82bf351044189f7aed2704cc3705ebba3604fe237d8245
MD5 31e4d21d173f12847dbd9f5fe0d22864
BLAKE2b-256 cafb2117314cb551b2827f346300e3a9e5a37955b8405f62e5972af49a0f593e

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