--- id: hyperlight-sandbox version: "0.5.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # hyperlight-sandbox — Python API for running code in isolated Hyperlight sandboxes with swappable backends License: permissive · Maintenance: active · Downloads: 197.5K/mo ## 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 above — 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 pip install hyperlight-sandbox uv add hyperlight-sandbox 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_current - Install friction: low - Maintenance: active - Downloads: 197.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags wasm sandbox code execution, isolated code runner python, hyperlight sandbox api, secure code isolation, sandboxed python execution, code-isolation, wasm-runtime, sandboxing [View on SkillFed](https://skillfed.io/packages/hyperlight-sandbox) · [View on PyPI](https://pypi.org/project/hyperlight-sandbox/)