Registry / security / hyperlight-sandbox

hyperlight-sandbox

JSON →
library0.4.0pypypi✓ verified 80d ago

Python API for running untrusted or isolated code in Hyperlight sandboxes with swappable backends (e.g., Wasm). Version 0.4.0, actively developed on GitHub.

pip install hyperlight-sandbox
INSTALL
IMPORT
SIG · HYPERLIGHT-SANDBOX
H
hyperlight-sandbox
securitypythonv0.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Sandbox
from hyperlight_sandbox import Sandbox
from hyperlight import Sandbox
CodeExecutionTool
from hyperlight_sandbox import CodeExecutionTool
ExecutionResult
from hyperlight_sandbox import ExecutionResult

Create a sandbox with restricted host access, run a Python module string, and print output.

import os from hyperlight import Sandbox, SandboxConfiguration conf = SandboxConfiguration( host_allowed=False, network_allowed=False, allowed_dirs=[], max_memory_mb=128, ) with Sandbox(conf) as sb: result = sb.run_module("print('hello')") print(result)
Debug
Known issues
breakingThe import path changed in 0.4.0 from 'hyperlight_sandbox' to 'hyperlight'.
fix
Use 'from hyperlight import Sandbox' instead.
affects: <=0.3.0
gotchaSandbox.run_module() returns stdout/stderr merged; do not assume separate streams.
fix
Parse output carefully or use run_module_async() for streaming.
affects: all
deprecatedThe 'SandboxConfiguration' parameter 'max_memory_mb' may be renamed to 'memory_limit_mb' in future releases.
fix
Monitor release notes; consider using memory_limit_mb if available.
affects: 0.4.0
Upgrade
Version history
0.4.0latest on PyPI · released May 2, 2026
Audit
Dependencies
grpciorequiredgRPC communication with sandbox runtime
protobufrequiredMessage serialization
Agent activity
24 hits · last 30 days
node
22
Amazon
1
Resources
hyperlight-sandbox — pip install hyperlight-sandbox · libregistry