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 and backend-managed sandbox files.
  • restore() rewinds both runtime state and sandbox file state to the snapshot point.
  • Output files under /output are ephemeral per run() and are cleared before each execution.

Build

just python-build

Download files

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

Source Distribution

hyperlight_sandbox-0.6.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

hyperlight_sandbox-0.6.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file hyperlight_sandbox-0.6.0.tar.gz.

File metadata

  • Download URL: hyperlight_sandbox-0.6.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","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}

File hashes

Hashes for hyperlight_sandbox-0.6.0.tar.gz
Algorithm Hash digest
SHA256 b35a6a20429423d9b2b518b3a6451a1fc346752e04f39a3cd507efff70f6c612
MD5 dfcc048123c0e6774e02579cdff0a17d
BLAKE2b-256 d9c2df0daba1a3f4401ecc6af06d1294e45fb8fad8f01c7257e74aa56261481b

See more details on using hashes here.

File details

Details for the file hyperlight_sandbox-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: hyperlight_sandbox-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","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}

File hashes

Hashes for hyperlight_sandbox-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 741780f8984ae83360c3ace1391992920fcac15651a336efba7696050e450928
MD5 e6e4ed917fbab507a9751aac96be173f
BLAKE2b-256 ef2a823bc8704f7ef9ea28150633b473750ff677c5c22b4c811977c2b99879b0

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

0.0.1

2 files

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