Skip to main content Switch to mobile version Pre-release This release is a pre-release and may not be stable for production use.
(alpha, invite-only) Python SDK for CeyNox Sandbox, hosted sandboxes for AI agents and any untrusted code, forked from the E2B Python SDK
pip install ceynox-sandbox==0.1.0a1 Copy PIP instructions
⚠️ Alpha: not for production use. CeyNox Sandbox is not open to the public yet. This pre-release is for invited testers only; you need an invitation to get an API address and key, which your console then shows you. Interfaces may change between alpha releases without notice. Interested? Email support@ceynovahq.com.
Run untrusted code, from AI agents or anywhere else, in isolated cloud sandboxes instead of on your own machine.
Isolated Linux sandboxes, each separate from your machine and from every other customer's sandbox.
Commands in the foreground or background, with streamed output, exit codes and timeouts.
Files: read, write and list.
Pause a sandbox with its memory and disk, and resume it later.
Sync (Sandbox) and async (AsyncSandbox) APIs, fully typed.
The ceynox-sandbox command: sandboxes, commands, file copies and SSH from a terminal.
Compatible with code written for the E2B SDK.
An invitation to the alpha: your console then gives you your API address and an API key.
pip install --pre ceynox-sandbox --pre is needed while only pre-releases exist.
Save your API key and your API's address once. Your console's API keys page shows this line with your address filled in; the command asks for the key:
ceynox-sandbox login --api-url https://api. Then:
from ceynox_sandbox import Sandbox with Sandbox.create() as sandbox: result = sandbox.commands.run("python3 -c 'print(6 * 7)'") print(result.exit_code, result.stdout) # 0 42 The sandbox is killed when the with block ends.
from ceynox_sandbox import CommandExitException, Sandbox with Sandbox.create() as sandbox: result = sandbox.commands.run("echo $NAME", cwd="/tmp", envs={"NAME": "hello"}) print(result.stdout) # hello # A non-zero exit raises, carrying the exit code and the output. try: sandbox.commands.run("exit 3") except CommandExitException as error: print(error.exit_code) # 3 # Stream output as it arrives, and end the command after 10 seconds. sandbox.commands.run( "for i in 1 2 3; do echo $i; sleep 1; done", on_stdout=lambda data: print("out:", data, end=""), timeout=10, ) # Run as root instead of the unprivileged `user`. print(sandbox.commands.run("whoami", user="root").stdout) # root # In the background: wait for it later. handle = sandbox.commands.run("sleep 2 && echo done", background=True) print(handle.wait().stdout) # done Files
with Sandbox.create() as sandbox: sandbox.files.write("/home/user/hello.txt", "hello") print(sandbox.files.read("/home/user/hello.txt")) # hello for entry in sandbox.files.list("/home/user"): print(entry.name, entry.type) Async
import asyncio from ceynox_sandbox import AsyncSandbox async def main() -> None: async with await AsyncSandbox.create() as sandbox: result = await sandbox.commands.run("uname -a") print(result.stdout) asyncio.run(main()) Lifetime, pause and resume
sandbox = Sandbox.create(timeout=600) # ends after 10 minutes unless extended sandbox.set_timeout(3600) # now an hour from now sandbox.pause() # keeps its memory and disk same = Sandbox.connect(sandbox.sandbox_id) # resumes it where it left off same.kill() Passing the key and address in code
import os sandbox = Sandbox.create(api_key=os.environ["MY_CEYNOX_KEY"], api_url="https://api. ") Command line
The package installs ceynox-sandbox:
The key and the address always go together:
Neither given in code or the environment: both come from the saved default profile.
Only one given: the other is never taken from the default profile. Without a key nothing is sent; without an address the production API is used.
A profile named (profile= or CEYNOX_PROFILE): that profile is used as a whole, filling whichever of the two is not given.
ceynox-sandbox login --profile --api-url … saves more than one profile, for example one per environment.
Every error the SDK raises is a CeyNoxException:
from ceynox_sandbox import ( ApiUnreachableException, AuthenticationException, CeyNoxException, Sandbox, ) try: sandbox = Sandbox.create() except AuthenticationException as error: print("no key, or the key was refused:", error) except ApiUnreachableException as error: print("the API could not be reached at", error.api_url) except CeyNoxException as error: print("something else went wrong:", error) As in the E2B SDK, AuthenticationException and ServiceBusyException are not SandboxExceptions, so catch CeyNoxException to handle everything.
Your key and a sandbox's access tokens are sent only over HTTPS. Plain HTTP is refused except to this computer (localhost, 127.0.0.0/8, ::1).
A key is sent only to the address it is paired with (see Configuration), and a key that is not a CeyNox key (cnx_…) is never sent, so another provider's key left in the environment stays where it is.
Saved profiles live in ~/.ceynox/credentials.json, written readable only by you, and refused if anyone else can read it. login reads the key from the terminal or standard input, never from the command line.
Output from a sandbox is produced by code you may not control: treat it as untrusted data.
To report a vulnerability, email support@ceynovahq.com.
This SDK is a fork of the E2B Python SDK and keeps its interface, so code written for E2B needs little change: import from ceynox_sandbox and use a CeyNox key. Anything the service does not offer yet fails at once with a "not supported by CeyNox Sandbox yet" error, before any request is made. A few E2B options are kept only for compatibility and will go before 1.0: keep_memory (a pause always keeps memory) and the headers option (use api_headers).
Pre-1.0 alpha; no stability guarantees; not for production. Breaking changes are possible between alphas. From 1.0 the package follows semantic versioning. ceynox_sandbox.__version__ and ceynox-sandbox --version say which version is installed.
Email support@ceynovahq.com.
Apache License 2.0 (LICENSE) for CeyNova Labs' code. The parts taken from the E2B SDK keep their original licences, included as LICENSE.upstream-package (MIT) and LICENSE.upstream-repository (Apache 2.0). NOTICE says where the code came from and what was changed.
Author/Maintainer: CeyNova Labs
Apache-2.0 View SPDX License List
sandbox ai-agents code-execution ceynox
Development Status 3 - Alpha
Intended Audience Developers
Operating System OS Independent
Programming Language Python :: 3
Release files for ceynox-sandbox 0.1.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 463.7 kB
Release files / ceynox_sandbox-0.1.0a1.tar.gz
Security for ceynox-sandbox 0.1.0a1
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.
None of the files in this release were uploaded with provenance metadata.
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.
Release history Release notifications | RSS feed
Dec 2, 2026 2 release files No provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation




