Sandbox backends now ship in a dedicated
praisonai-sandbox package. If you use the agent-level API (sandbox=True, SandboxConfig), the existing from praisonai.sandbox import ... imports and praisonai extras continue to work — the standalone package is installed for you. Install praisonai-sandbox directly only when you want the sandbox stack without the full praisonai wrapper (e.g. embedding a sandbox in a small script or another project).Package layout. Sandbox backends live in the standalone
praisonai-sandbox package. pip install praisonai pulls it in transitively; you can also install it alone with pip install praisonai-sandbox when you don’t need the rest of the framework. All praisonai.sandbox.* imports keep working via a compatibility shim, so existing agent code does not need to change. See The praisonai-sandbox Package for details.Quick Start
1
Simple Usage
Enable sandbox on the agent — subprocess backend is the default:
2
With Configuration
Pick a specific backend via
SandboxConfig or the CLI --sandbox-type flag:How It Works
Which Backend Should I Use?
Pick a backend based on where the code runs and how much you trust it.All Built-in Sandbox Backends
PR #2003 exposes all seven sandboxes throughSandboxRegistry — selectable by string name from the CLI or Python.
Plugin-registered backends (installed separately, resolved via the
praisonai.sandbox entry-point group):
Select by Name
- CLI
- Python
Using the Daytona backend
Run agent code in a Daytona cloud sandbox by selecting thedaytona backend.
Daytona requires
pip install "praisonai[daytona]" (or pip install "praisonai-sandbox[daytona]") and a DAYTONA_API_KEY environment variable. Optional DAYTONA_API_URL and DAYTONA_TARGET env vars override the API endpoint and region.Installing Optional Backends
Onlysubprocess and sandlock ship in the base install — every other backend requires an optional extra. The standalone praisonai-sandbox package is the preferred install; the legacy praisonai[...] extras still work as compatibility shims.
The
daytona backend is now a real cloud provider (DaytonaSandbox) backed by daytona-sdk, mirroring the Modal / E2B compute-provider pattern. It lives in the standalone praisonai-sandbox package — install it via praisonai-sandbox[daytona]. Set DAYTONA_API_KEY (and optional DAYTONA_API_URL) before selecting it.You’ll never get an unexpected backend — if
--sandbox-type X isn’t available, the CLI tells you exactly what to install.capsule), SandboxManager resolves the name through SandboxRegistry and raises a clearer error when the plugin is missing. When praisonai is installed but the plugin is not registered:
praisonai itself is not installed (the registry import fails):
Third-Party Sandbox Plugins
Register custom sandboxes via thepraisonai.sandbox entry-point group:
pip install, the new name appears alongside the built-ins when you call registry.list_names().
Example: Capsule (from praisonai-plugins)
capsule backend is registered by praisonai-plugins under the praisonai.sandbox entry-point group. SandboxManager resolves the name via SandboxRegistry the first time the sandbox starts.
Using the standalone package
The seven backends live in a dedicated package so you can use them without pulling in the fullpraisonai wrapper.
- Agent (default)
- Direct import
- CLI
- Legacy shim
Nothing to change — the standalone package is installed alongside
praisonai:Which Sandbox Should I Pick?
Configuration Options
Shell Parameter Control
- shell=False (Default)
- shell=True (Opt-in)
shlex.split().Decision Guide
Common Patterns
Backend Selection
- Development
- Production
- Remote
Safe Data Processing
Resource Limits
Best Practices
Always use shell=False for untrusted input
Always use shell=False for untrusted input
Model-generated commands or user input should never use
shell=True to prevent injection attacks. The default shell=False provides automatic protection.Quote arguments when building shell commands
Quote arguments when building shell commands
If you must use
shell=True, quote all dynamic arguments with shlex.quote():Prefer list form for complex commands
Prefer list form for complex commands
Using argument lists avoids shell parsing entirely:
Use appropriate backend for your security needs
Use appropriate backend for your security needs
Choose the sandbox backend based on your isolation requirements:
- Development:
SubprocessSandboxfor speed and convenience (no longer inherits host environment) - Production:
DockerSandboxfor container-level isolation - Remote:
SSHSandboxfor network-isolated execution - High Security: Always use Docker or SSH backends with
shell=False
Handle missing backends explicitly in scripts and CI
Handle missing backends explicitly in scripts and CI
Catch exit code 2 from In CI pipelines, install the required extra before running:
praisonai sandbox run --type <X> and either install the extra or fall back to --sandbox-type subprocess:Related
Sandbox
Agent-level sandbox=True and SandboxConfig
Sandbox CLI
CLI reference for praisonai sandbox run and praisonai sandbox shell
praisonai-sandbox Package
Standalone sandbox package — sandboxed execution without the full wrapper

