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.

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.9.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.9.0
File Size Uploaded Provenance Actions
hyperlight_sandbox-0.9.0.tar.gz 13.3 kB Without provenance Details for hyperlight_sandbox-0.9.0.tar.gz

Built distribution (wheel)

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

Total release size: 20.0 kB

Release files / hyperlight_sandbox-0.9.0.tar.gz

Download URL hyperlight_sandbox-0.9.0.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
248320cbdf116c4198d08228a0ada6b7697c3033894878a5c6cd577bce5d53d1
BLAKE2b-256 checksum
How to use checksums
88063b3e54583ea790bd154dcec18a7eb73394dce50337bff99fb4513991d443
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","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.9.0-py3-none-any.whl

Download URL hyperlight_sandbox-0.9.0-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b953effd1f0d80385ceda74cd914ae841e03aefa5a30c051f7a85f4fb1c425ec
BLAKE2b-256 checksum
How to use checksums
a5b0f50c1afc6e544f57548bc3ab0ad6868021d2676707b33941c6a20a813bc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","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.9.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