How to use BoxLite with Python? BoxLite released a Python SDK, installable via `pip install boxlite` on Python 3.10 or later, that boots a dedicated hardware-virtualized microVM per Box from standard OCI images such as `python:slim` so model-generated code runs isolated from the host. The Apache-2.0 runtime runs embedded microVMs inside the Python process, while the SDK's REST client (`Boxlite.rest`) targets a self-hosted `boxlite serve` instance or the managed BoxLite Cloud service for AI agents. The SDK adds `NetworkSpec` hostname allowlisting with DNS sinkholing and TLS SNI/HTTP Host inspection, plus `Secret` objects that pass placeholders like `` into the guest and swap in real credentials only for allowlisted hosts. Install the BoxLite Python SDK with pip install boxlite Python 3.10 or later , then run commands inside a local microVM using async with boxlite.SimpleBox image="python:slim" as box: and await box.exec ... . The Apache-2.0 open-source runtime runs embedded microVMs directly in your Python process, while the SDK's REST client Boxlite.rest also lets you target self-hosted boxlite serve or BoxLite Cloud, the managed isolated compute service for AI agents. Calling subprocess.run executes model-generated code straight on your laptop or server. With BoxLite, your Python process embeds hardware virtualization and boots a dedicated microVM for each Box from standard OCI images like python:slim . You need Python 3.10 or later: pip install boxlite Running Boxes locally requires CPU virtualization: Apple Silicon macOS 12+ Hypervisor.framework , /dev/kvm on Linux, or KVM inside WSL2 on Windows our embedded sandbox guide https://blog.boxlite.ai/embed-a-microvm-sandbox-in-your-agent-at-zero-extra-cost covers the local architecture . If your CI runner doesn't expose KVM, install boxlite anyway. You can point your client at a remote boxlite serve instance or BoxLite Cloud https://blog.boxlite.ai/one-sdk-one-microvm-runtime-from-laptop-to-boxlite-cloud . Start an async with block with an OCI image, then pass your command to box.exec : python import asyncio import boxlite async def main : async with boxlite.SimpleBox image="python:slim" as box: result = await box.exec "python", "-c", "print 'Hello from BoxLite' " print result.stdout asyncio.run main On the first run, BoxLite pulls python:slim and caches the OCI image layers under ~/.boxlite so later runs skip the download. When the async with block exits, SimpleBox stops and removes that temporary Box for you. Untrusted code with plain environment variables and open outbound networking has an easy path to leak your keys. Mount only the repository directory the task needs instead of exposing your home directory. Use NetworkSpec mode="disabled" for offline code runs, or NetworkSpec mode="enabled", allow net= ... so BoxLite resolves only allowlisted hostnames, sinkholes other DNS lookups to 0.0.0.0 , and inspects TLS SNI and HTTP Host headers. For API keys, Secret keeps the real token out of the guest environment by passing a placeholder like