Skip to main content

hyperlight-sandbox

Python API package for running code inside Hyperlight sandboxes with separately installable backends and packaged guest packages.

Quick Start

from hyperlight_sandbox import Sandbox

sandbox = Sandbox(backend="wasm", module="python_guest.path")
sandbox.register_tool("add", lambda a=0, b=0: a + b)

result = sandbox.run("""
result = call_tool('add', a=3, b=4)
print(result)
""")
print(result.stdout)  # "7\n"

Install the local repo packages for development with:

uv sync          # installs core + guest packages via workspace
just python-build  # builds maturin backends

Packaged guest packages expose importable module references such as python_guest.path and javascript_guest.path. The API resolves those to the packaged .aot artifact automatically.

Example dependency sets:

  • Sandbox(backend="wasm", module="python_guest.path") requires hyperlight-sandbox[wasm,python_guest]
  • Sandbox(backend="wasm", module="javascript_guest.path") requires hyperlight-sandbox[wasm,javascript_guest]
  • Sandbox(backend="hyperlight-js") requires hyperlight-sandbox[hyperlight_js]

Use Sandbox(backend="wasm", module="javascript_guest.path") to run the packaged JavaScript Wasm guest package.

Use Sandbox(backend="hyperlight-js") to run the separate HyperlightJS backend package.

macOS

Apple Silicon wheels provide developer-only support for macOS 13 and newer. The backend wheels include a signed Rust helper with the com.apple.security.hypervisor entitlement. This path is experimental, not for production.

Snapshot Semantics

  • snapshot() captures guest runtime state.
  • Output file contents under /output persist across run() calls, but open file handles must be reopened in each run.
  • restore() rewinds runtime state and clears output files.

Build

just python-build

Metadata

Release files for hyperlight-sandbox 0.10.0

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

Source distribution (sdist)

Source distribution for hyperlight-sandbox 0.10.0
File Size Uploaded Provenance Actions
hyperlight_sandbox-0.10.0.tar.gz 13.4 kB Without provenance Details for hyperlight_sandbox-0.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hyperlight-sandbox 0.10.0
File Interpreter ABI Platform Actions
hyperlight_sandbox-0.10.0-py3-none-any.whl Python 3 none any Details for hyperlight_sandbox-0.10.0-py3-none-any.whl

Total release size: 20.4 kB

Release files / hyperlight_sandbox-0.10.0.tar.gz

Download URL hyperlight_sandbox-0.10.0.tar.gz
Size 13.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8d92370f951678c9398d5dd6c5c2b1e7daaeceed73e0e4bee374c8599b4cb273
BLAKE2b-256 checksum
How to use checksums
b1d9236a6f2cfd1be9989e1ced7db07b41043dabffd9f213accbf13906dbdd6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / hyperlight_sandbox-0.10.0-py3-none-any.whl

Download URL hyperlight_sandbox-0.10.0-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c81f7faa0eef863b79e30a34fe1a67ea5a3444d36cfa6508292a2fc0f46ff81
BLAKE2b-256 checksum
How to use checksums
41d14a069882987900309f727a5bf238fb826bd3609c337204effef2e33500ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for hyperlight-sandbox 0.10.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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