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.8.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.8.0
File Size Uploaded Provenance Actions
hyperlight_sandbox-0.8.0.tar.gz 11.9 kB Without provenance Details for hyperlight_sandbox-0.8.0.tar.gz

Built distribution (wheel)

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

Total release size: 18.2 kB

Release files / hyperlight_sandbox-0.8.0.tar.gz

Download URL hyperlight_sandbox-0.8.0.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3a7c9f4a3e3c41ddd8bd2b9f48db6ece652b2c18be384f459d6b168d33c063ee
BLAKE2b-256 checksum
How to use checksums
9dee3d97cd3ca57addeae74eaf82a1d64475f151f884e4bb8dca874b01ba3788
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.8.0-py3-none-any.whl

Download URL hyperlight_sandbox-0.8.0-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7aac916fa4dc1f630a72787d22082a1c1eed058ff866cb1d5ed53d2e9801f312
BLAKE2b-256 checksum
How to use checksums
9822522d2c6b186b66a5335e0fff99fe3ffdd82ce32b4968f9c9e951dd0a398b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.8.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