skillfed

hyperlight-sandbox

Python API for running code in isolated Hyperlight sandboxes with swappable backends

hyperlight-sandbox v0.5.0 197.5K downloads/30d#9,757 on PyPI722
Permissive license Apache-2.0 Active released

What it is and what it does

Hyperlight-sandbox is a Python API for running untrusted or isolated code inside sandboxes with multiple backend options (WASM, HyperlightJS) and guest language support (Python, JavaScript). It lets you register tools that guest code can call, capture output, and manage sandbox state through snapshots and restores. The package ships with separately installable backend and guest packages, so you only pull in what you need—for example, installing with [wasm,python_guest] gives you WASM execution with a Python runtime.

The core workflow is straightforward: create a Sandbox with your chosen backend and guest module, register any tools the guest code should access, then run code and inspect stdout or other outputs. Output files under /output are ephemeral per run. This design is useful for scenarios where you need to execute code safely without giving it full system access, or where you want to isolate execution contexts from one another.

Use it for:

  • Run untrusted user-submitted code safely without exposing the host system.
  • Execute code in isolated contexts with controlled tool access for multi-tenant applications.
  • Snapshot and restore sandbox state for testing, debugging, or resuming long-running computations.
  • Combine Python and JavaScript code execution in the same application via different guest packages.
  • Build code execution services (e.g., online judges, notebook environments) with pluggable backends.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Hyperlight-sandbox provides a Python API for executing code inside isolated sandboxes with pluggable backends (WASM, HyperlightJS) and guest language runtimes, enabling secure code execution with tool registration and snapshot/restore semantics.

Yes, if you need isolated code execution with a clean Python API and don't mind the Alpha maturity level. The low install friction, active maintenance, permissive license, and zero known vulnerabilities make it a reasonable choice. However, verify that snapshot/restore semantics and backend stability meet your production requirements before relying on it for critical workloads.

Install

hyperlight-sandbox on PyPI

pip

pip install hyperlight-sandbox

uv

uv add hyperlight-sandbox

poetry

poetry add hyperlight-sandbox

Installing hyperlight-sandbox

Before you install

Low install friction with a pure-Python wheel distribution. Active maintenance with recent commits and steady releases since March 2026. Requires Python 3.10 or later and optional backend/guest package extras depending on your use case.

License in practice

Apache-2.0 permissive license allows commercial and private use with minimal restrictions, making it suitable for most production deployments.

Quickstart

pip install hyperlight-sandbox[wasm,python_guest]

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)\nprint(result)")
print(result.stdout)

Requires Python 3.10 or later; backend and guest package extras must be installed based on your chosen backend (e.g., [wasm,python_guest] for WASM with Python guest).

Verify before relying

  • Whether snapshot/restore semantics work correctly across all supported backends and guest runtimes.
  • Performance characteristics and overhead of sandbox initialization and code execution.
  • Compatibility and stability of the HyperlightJS backend relative to WASM.
  • Whether the package is production-ready or remains in active development (Alpha status).

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 51 days since the last release
Last repo commit
First released
Downloads 197,533/month — #9,757 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: hyperlight_sandbox-0.5.0-py3-none-any.whl

Keywords: hyperlight, wasm, sandbox, isolation, code-execution

Development Status :: 3 - AlphaIntended Audience :: DevelopersOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Rust

Tags

wasm sandbox code executionisolated code runner pythonhyperlight sandbox apisecure code isolationsandboxed python execution
code-isolationwasm-runtimesandboxing

More Security packages