PRAISON_SHELL decides what praisonai code does when a command contains a shell operator (>, |, &&, $(...)): refuse it, run it inside an OS sandbox, or run it uncontained.
Quick Start
1
Default — operators are refused
Without
PRAISON_SHELL, the coding agent runs plain commands as before, but a command with a shell operator fails loudly instead of silently dropping it.2
Enable a real, contained shell
Set
PRAISON_SHELL=sandboxed to run a real /bin/sh -c inside OS-native containment (Seatbelt on macOS, bwrap on Linux).The Three Modes
PRAISON_SHELL (or the mode= argument to execute_command) selects one behaviour.
Aliases resolve to these three:
1/true/yes/sandbox/native → sandboxed; raw/host → unsafe; empty/0/false/no/none → off.
Why the default refuses
The plain executor runsshlex.split + subprocess.Popen(shell=False), so an operator becomes a literal argument.
Quote-Aware Detection
Detection looks for operators outside quotes, so ordinary strings are never refused.$(...) and backticks are detected even inside double quotes because POSIX shells evaluate them there — reporting them as inert would reintroduce the false-success bug.
Approval
The real-shell path is wrapped inrequire_approval(risk_level="critical") under the tool name execute_command.
The approval wrap fails closed: if the approval machinery can’t be imported, the real shell does not run.
When Your Agent Hits a Refusal
An agent that hitsPRAISON_SHELL=off refusal has three honest paths.
PRAISON_SHELL=sandboxed to allow real operators inside a jail.
Best Practices
Prefer sandboxed over unsafe
Prefer sandboxed over unsafe
sandboxed gives a real /bin/sh while a kernel keeps writes inside the workspace. unsafe removes that boundary entirely — use it only when you accept an uncontained shell deliberately.Split multi-step commands
Split multi-step commands
Two
execute_command calls (one per && step) work in every mode and keep each step’s success signal honest.Write output instead of redirecting
Write output instead of redirecting
Replace
cmd > file.txt with a plain cmd call plus write_file. This works in off mode and keeps the file-creation step explicit.Related
OS Sandbox
Seatbelt and bwrap containment that
sandboxed mode runs inside.Safe Tools by Default
Why tools refuse rather than degrade.
Interactive Tools
The
execute_command tool in the coding session.Tool Approval
The critical-risk approval wrap on the real-shell path.

