Skip to main content

eryx-run

Run untrusted Python in an eryx sandbox on eryx.run, with the same API as pyeryx, which runs sandboxes in your own process. Moving between the two is an import:

import eryx_run as eryx  # or: import eryx

sandbox = eryx.Sandbox()
result = sandbox.execute("print(2 + 2)")
print(result.stdout_text)  # 4

eryx-run is pure Python (it depends on httpx and websockets), so it installs anywhere, with no WebAssembly runtime of its own.

pip install eryx-run
export ERYX_API_KEY=eryx_...   # from https://app.eryx.run

Callbacks

Sandboxed code can await functions you provide. They run in your process, sync or async:

import eryx_run as eryx

callbacks = eryx.CallbackRegistry()

@callbacks.callback(description="Look up a user by id")
async def get_user(id: int) -> dict:
    return {"id": id, "name": "Ada"}

sandbox = eryx.Sandbox(callbacks=callbacks)
result = sandbox.execute("""
user = await get_user(id=123)
print(user["name"])
""")

Code calls them with keyword arguments. pyeryx's list-of-dicts form works too: callbacks=[{"name": "get_user", "fn": get_user}].

Results and errors

execute returns an ExecuteResult (stdout, stderr, stdout_text, duration_ms, fuel_consumed, result, ...). Set a variable called result to return a value:

sandbox.execute("result = {'answer': 42}").result  # {'answer': 42}

A run that fails raises what pyeryx raises: PythonExceptionError (with stdout and stderr) when the code raises, TimeoutError, or ResourceLimitError. Requests eryx.run refuses raise an APIError subclass: AuthenticationError, RateLimitError (with retry_after), NotFoundError, ConflictError, InvalidRequestError or ServiceUnavailableError; APIConnectionError if eryx.run can't be reached or the connection drops mid-run. All of them are EryxErrors.

From asyncio, use await sandbox.execute_async(code).

Sessions

A Session keeps variables, imports and files under /data between runs:

session = eryx.Session()
session.execute("x = 21")
session.execute("print(x * 2)").stdout_text  # "42\n"
session.delete()

Session(id=...) uses an existing session, such as one another process created (session.id).

What's different from pyeryx

  • Limits: ResourceLimits(execution_timeout_ms=..., max_fuel=...); None (the default) means your org's limit. eryx.run sets memory and callback limits itself.
  • Hosted-only arguments: environment (an environment you uploaded), connections (MCP servers), network_policies, and api_key / base_url (defaults $ERYX_API_KEY and $ERYX_URL).
  • Local-only arguments raise a ValueError saying what to use instead: network, secrets and scrub_* (use network policies), mcp (use connections), volumes, on_stdout / on_stderr and cancel (not yet), and result_variable other than result. Sessions don't have snapshot_state / restore_state: eryx.run keeps the state.

See the API reference for the limits and errors.

Metadata

Release files for eryx-run 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eryx-run 0.1.0
File Size Uploaded Provenance Actions
eryx_run-0.1.0.tar.gz 80.6 kB With provenance Details for eryx_run-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for eryx-run 0.1.0
File Interpreter ABI Platform Actions
eryx_run-0.1.0-py3-none-any.whl Python 3 none any Details for eryx_run-0.1.0-py3-none-any.whl

Total release size: 99.6 kB

Release files / eryx_run-0.1.0.tar.gz

Download URL eryx_run-0.1.0.tar.gz
Size 80.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7017b2322170c152aceef7475613df967aaf9d4fdec0f3672f84269f759dd1d2
BLAKE2b-256 checksum
How to use checksums
b3ae2d50e783fc4cd054ae4149ed5aab51c1938be621f67276d930232dcaf327
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / eryx_run-0.1.0-py3-none-any.whl

Download URL eryx_run-0.1.0-py3-none-any.whl
Size 19.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6013b545d03f34709d3248b481b7029867c1b892cd515269f3078d30bc8e4557
BLAKE2b-256 checksum
How to use checksums
33e6a1ebc3f517de69c221e9235aa2c818ddaea6301662076ecc08f826e01dee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for eryx-run 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for eryx_run-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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