praisonai-sandbox
Isolated agent code execution for PraisonAI — Docker, subprocess, E2B, Modal, Novita, Sandlock, and SSH backends.
Install
pip install praisonai-sandbox[docker]
Usage
from praisonai_sandbox import DockerSandbox
from praisonaiagents.sandbox import SandboxConfig
config = SandboxConfig.docker("python:3.12-slim")
sandbox = DockerSandbox(image=config.image, config=config)
Or via the agents manager:
from praisonaiagents.sandbox import SandboxManager, SandboxConfig
manager = SandboxManager(SandboxConfig.subprocess())
result = await manager.run_code("print('hello')")
Tenki compute lifecycle
Install praisonai-sandbox[tenki] to use TenkiCompute with Tenki SDK 1.4.0 or
newer. With ComputeConfig(auto_shutdown=True), the provider terminates the
sandbox after idle_timeout_s without an active command, package installation,
or file transfer. Activity restarts the idle countdown; status checks do not.
Idle cleanup runs while the Python process is alive and does not track background
processes after their launching command returns. Always call shutdown() in a
finally block (or use the framework's managed cleanup). Tenki's server-side
maximum lifetime is a separate safeguard and is not an idle timeout.
Timed-out commands return exit code 124 and preserve any partial output.
Console script
praisonai-sandbox --help
Backward-compatible imports via the umbrella package:
from praisonai.sandbox import SubprocessSandbox # shim → praisonai_sandbox
Validating your install
Note: The
e2e-validation/bundle andtests/ship with the source repository, not the published wheel. Run these commands from a checkout of this repo (src/praisonai-sandbox/), not from apip installed environment.
Run the single-command end-to-end smoke suite (no API keys needed for the subprocess path; Docker is optional and skipped when unavailable):
python e2e-validation/run_e2e.py
Or use the pytest live probes:
python -m pytest tests/test_live_sandbox.py -v
See e2e-validation/ for the manual guide.
Metadata
Release files for praisonai-sandbox 0.1.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| praisonai_sandbox-0.1.11.tar.gz | 86.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| praisonai_sandbox-0.1.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 164.4 kB
Release files / praisonai_sandbox-0.1.11.tar.gz
| Download URL | praisonai_sandbox-0.1.11.tar.gz |
|---|---|
| Size | 86.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7af62b97ed0f1ccfb14dd3eeeea7e761316dab8371609e3f747c40d3a594f68c
|
|
BLAKE2b-256 checksum How to use checksums |
c9e9b970612edf019303d39e697ae74f5157f32f28d4035cbfed0e2d05e2ab45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / praisonai_sandbox-0.1.11-py3-none-any.whl
| Download URL | praisonai_sandbox-0.1.11-py3-none-any.whl |
|---|---|
| Size | 78.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7a3d5b6b5294514e44b0442f1bc9bcfa6934c4fa5974aabcbbd4fc3ea452a2b9
|
|
BLAKE2b-256 checksum How to use checksums |
78ba529d538083a5df64d9a8a003a96e122adffa6a30f7cdd569782f078fee5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|