TypeScript CLI Sandbox Filter
Use praisonai-ts sandbox exec, check, and mode to filter host commands — and know when to use real isolation instead
praisonai-ts sandbox checks shell commands against allow/deny lists and runs them on the host as the current user — it is a guard rail against accidents, not isolation and not a security boundary.
import { Agent } from 'praisonai';
const agent = new Agent({
name: 'Assistant',
instructions: 'Help inspect the workspace safely.',
});
await agent.start('Check the current project files');Quick Start
- Check whether a command is allowed
bash praisonai-ts sandbox check "rm -rf /" praisonai-ts sandbox check "ls -la" --jsonValidates the command against the filter rules without running it.
- Execute a filtered command
bash praisonai-ts sandbox exec "echo hello" --mode basic --timeout 30000 praisonai-ts sandbox exec "ls -la" --mode strict - Inspect filter modes
bash praisonai-ts sandbox modePrints the available filter modes and what each mode checks.
Subcommands and Modes
| Subcommand | Description |
|---|---|
praisonai-ts sandbox exec <command> | Checks <command> against the selected filter mode (--mode, default basic; --timeout, default 30000 ms) and runs it on the host. |
praisonai-ts sandbox check <command> | Runs CommandValidator on <command> without executing it. Supports --json / --output json. |
praisonai-ts sandbox mode | Lists the supported filter modes. |
| Mode | What it checks (runs on host) |
|---|---|
disabled | No command filtering. |
basic | Refuses deny-listed destructive/privilege commands and dangerous patterns. |
strict | Stricter command deny list including common network tools; runs in a temporary working directory on the host. |
network-isolated | Refuses common network CLI tools on the command line (does not create a network namespace). |
Best Practices
Use praisonai-ts sandbox check in dry-run pipelines
Validate generated commands with praisonai-ts sandbox check --json before deciding whether to run them.
Do not rely on command filters for untrusted code
String-based command filters can be worded around. Always use an isolating backend (docker, sandlock, e2b, modal, daytona, novita) when executing untrusted code.
Keep mode names distinct from OS containment
Mode names (basic, strict, network-isolated) are preserved for backward compatibility; they describe command filtering rules rather than kernel isolation.