Sandbox CLI
Secure command execution in sandboxed environments
The praisonai sandbox command manages sandbox containers. The legacy --sandbox prompt flag is display-only.
Quick Start
# Contain every agent shell command (macOS Seatbelt / Linux bwrap)
PRAISON_SHELL=sandboxed praisonai code
# Check sandbox status
praisonai sandbox statusSandbox Commands
praisonai sandbox <command> [OPTIONS]| Command | Description |
|---|---|
run | Execute code in a registered sandbox backend |
shell | Open an interactive shell inside a registered sandbox backend |
backends | List registered backends and their availability |
status | Check sandbox container status |
explain | Explain sandbox configuration |
list | List all sandbox containers |
recreate | Recreate sandbox containers |
Status
Check the status of sandbox containers:
praisonai sandbox statusOutput:
Sandbox Status
Container: praisonai-sandbox-main
Status: Running
Uptime: 2h 15m
Memory: 256MB / 512MB
CPU: 2%
Container: praisonai-sandbox-work
Status: Stopped
Last Run: 30m agoWith specific agent:
praisonai sandbox status --agent workExplain
Explain the sandbox configuration for an agent:
praisonai sandbox explainOutput:
Sandbox Configuration
Mode: basic
Isolation Level: process
Allowed Commands:
✓ ls, cat, grep, find
✓ python, pip
✓ git (read-only)
Restricted:
✗ rm, mv (write operations)
✗ sudo, su (privilege escalation)
✗ curl, wget (network access)
Filesystem:
Read: /home/user, /tmp
Write: /tmp/sandbox
Denied: /etc, /var, /usrFor specific agent:
praisonai sandbox explain --agent workList
List all sandbox containers:
praisonai sandbox listOutput:
Sandbox Containers
NAME STATUS CREATED SIZE
praisonai-sandbox-main Running 2 hours ago 45MB
praisonai-sandbox-work Stopped 1 day ago 32MB
praisonai-sandbox-test Exited 3 days ago 28MBOutput as JSON:
praisonai sandbox list --jsonRecreate
Recreate sandbox containers (useful for updates or fixing issues):
praisonai sandbox recreateRecreate specific container:
praisonai sandbox recreate --agent workForce recreate all:
praisonai sandbox recreate --all --force| Option | Description |
|---|---|
--agent NAME | Recreate for specific agent |
--all | Recreate all containers |
--force | Skip confirmation prompt |
Run
Execute code in a registered sandbox backend using --type to select the backend.
praisonai sandbox run --code "print('hello')" --type subprocesspraisonai sandbox run --code "print('hello')" --type docker --image python:3.12-slimpraisonai sandbox run --code "print('hello')" --type novita| Flag | Default | Description |
|---|---|---|
--code, -c | — | Inline code to execute |
--file, -f | — | Path to a Python file to execute |
--type, -t | subprocess | Sandbox backend name: subprocess, docker, e2b, modal, ssh, sandlock, daytona, or novita |
--image | python:3.12-slim | Docker image (docker backend only) |
--timeout | 60 | Execution timeout in seconds |
Shell
Open an interactive shell inside a registered sandbox backend.
praisonai sandbox shell --type subprocessType exit or press Ctrl+D to quit the shell. If the backend isn’t installed, the CLI exits with code 2 and prints a fix-it hint.
Backends
List every registered backend and whether it is installed and ready to use:
praisonai sandbox backendsOutput:
Sandbox backends
NAME AVAILABILITY INSTALL HINT
subprocess available —
sandlock available —
docker unavailable pip install 'praisonai[docker]'
ssh unavailable pip install 'praisonai-sandbox[ssh]'
modal unavailable pip install 'praisonai[modal]'
e2b unavailable pip install 'praisonai[e2b]'
daytona unavailable pip install 'praisonai[daytona]'
novita unavailable pip install 'praisonai-sandbox[novita]'Unavailable backends show the exact install command. See Sandbox Backends for the full matrix and praisonai-sandbox Package for the slim standalone install.
Sandbox Modes
The legacy --sandbox values are accepted but not enforced — commands run uncontained in every mode.
| Mode | Description |
|---|---|
off | No banner (default) |
basic | Prints the not-enforced warning; no containment |
strict | Prints the not-enforced warning; no containment |
Usage with Prompts
Basic Mode
praisonai "Execute ls -la" --sandbox basicOutput:
⚠ --sandbox is not enforced here; commands run uncontained. Use `praisonai code` with PRAISON_SHELL=sandboxed for OS-level containment.
╭─────────────── 🔒 Tool Approval Required ───────────────╮
│ Function: execute_command │
│ Risk Level: CRITICAL │
│ Arguments: │
│ command: ls -la │
╰─────────────────────────────────────────────────────────╯
Execute this critical risk tool? [y/n]:Strict Mode
praisonai "Run python script.py" --sandbox strictStrict mode prints the same warning and applies no restrictions. Use PRAISON_SHELL=sandboxed praisonai code to limit writes to the workspace.
Combine with Other Features
# With auto-approve for low-risk commands
praisonai "List files" --sandbox basic --approve-level low
# With verbose output
praisonai "Run tests" --sandbox strict --verbose
# With bot
praisonai bot telegram --token $TOKEN --sandboxSecurity Features
- Command Validation: All commands are validated before execution
- Risk Assessment: Commands are assigned risk levels (low, medium, high, critical)
- User Approval: Critical commands require explicit user approval
- Audit Trail: All executed commands are logged