Run untrusted Python safely
An open-source WebAssembly sandbox for full CPython 3.14. Embed it from Python, JavaScript or Rust, and let sandboxed code await the functions you expose.
app.py
import eryx
def get_user(args):
return {"id": args["id"], "name": "Alice"}
sandbox = eryx.Sandbox(callbacks=[
{"name": "get_user", "fn": get_user},
])
# Untrusted code: no filesystem, no network,
# only the callbacks you hand it
result = sandbox.execute('''
user = await get_user(id=123)
print(f"Hello {user['name']}")
''')
print(result.stdout) # Hello Alice
What's in the sandbox
Real CPython 3.14
The full standard library, plus your own wheels.
Async callbacks
Sandboxed code can await the functions you expose.
Locked down
No filesystem or network unless you allow it, with limits on every run.
Fast startup
New sandboxes in about 1–5 ms.
Install
Python
pip install pyeryx
# or try it with nothing installed
uvx --with pyeryx eryx -c 'print("hi")'
Rust
cargo add eryx --features embedded
let sandbox = Sandbox::embedded().build()?;
let result = sandbox.execute("print(1 + 1)").await?;
JavaScript
npm install @bsull/eryx
gRPC server
docker run -p 50051:50051 sd2k/eryx-server
Built for agents
eryx as an MCP server
// Claude Desktop, Cursor, VS Code, ...
{
"mcpServers": {
"eryx": {
"command": "uvx",
"args": ["--with", "pyeryx[serve]",
"eryx", "serve"]
}
}
}
MCP tools inside the sandbox
# Servers are discovered from your Claude Code,
# Cursor, VS Code, Zed, Gemini or Codex config
repos = await mcp["github"].search_repos(
query="eryx sandbox"
)
for r in repos["items"][:5]:
print(r["full_name"])
Hosted eryx
Run code on our machines over HTTP, WebSocket or MCP. Sign in with GitHub to get an API key.