Quick Start
How It Works
| Backend | Use Case | Security Level |
|---|---|---|
SubprocessSandbox | Local development, scripts | Medium (OS-level isolation, POSIX only) |
DockerSandbox | Production, untrusted code | High (container isolation) |
SSHSandbox | Remote execution | High (network isolation) |
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.
| Name | Class | Typical use |
|---|---|---|
docker | DockerSandbox | Container isolation for production |
subprocess | SubprocessSandbox | Fast local development (default) |
sandlock | SandlockSandbox | Hardened local sandbox |
ssh | SSHSandbox | Remote server execution |
modal | ModalSandbox | Modal cloud sandboxes |
daytona | DaytonaSandbox | Not implemented — use subprocess/docker/e2b |
e2b | E2BSandbox | E2B cloud code interpreter |
praisonai.sandbox entry-point group):
| Name | Source | Typical use |
|---|---|---|
capsule | Plugin (via praisonai.sandbox) | Plugin-provided secure sandbox — install via praisonai-plugins[capsule] |
Select by Name
- CLI
- Python
Installing Optional Backends
Onlysubprocess and sandlock ship in the base install — every other backend requires an optional extra.
| Backend | Install command |
|---|---|
subprocess | Built in — no extra required |
sandlock | Built in — no extra required |
docker | pip install "praisonai[docker]" |
ssh | pip install "praisonai[ssh]" |
modal | pip install "praisonai[modal]" |
daytona | pip install "praisonai[daytona]" |
e2b | pip install "praisonai[e2b]" |
capsule | pip install "praisonai-plugins[capsule]" |
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.
Which Sandbox Should I Pick?
Configuration Options
Shell Parameter Control
- shell=False (Default)
- shell=True (Opt-in)
shlex.split().Decision Guide
| Use Case | Recommended shell Value |
|---|---|
| Running a single executable with arguments | False |
Pipelines (grep | sort) | True |
| Globs and env-var expansion | True |
| Untrusted / model-generated commands | False |
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

