> ## Documentation Index
> Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Sandbox CLI

> Secure command execution in sandboxed environments

The `--sandbox` flag enables secure command execution with validation and restrictions. The `praisonai sandbox` command manages sandbox containers.

## Quick Start

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Enable sandbox mode
praisonai "Run echo hello" --sandbox basic

# Check sandbox status
praisonai sandbox status
```

***

## Sandbox Commands

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai sandbox <command> [OPTIONS]
```

| Command    | Description                    |
| ---------- | ------------------------------ |
| `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:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai sandbox status
```

**Output:**

```
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 ago
```

With specific agent:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai sandbox status --agent work
```

***

## Explain

Explain the sandbox configuration for an agent:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai sandbox explain
```

**Output:**

```
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, /usr
```

For specific agent:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai sandbox explain --agent work
```

***

## List

List all sandbox containers:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai sandbox list
```

**Output:**

```
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      28MB
```

Output as JSON:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai sandbox list --json
```

***

## Recreate

Recreate sandbox containers (useful for updates or fixing issues):

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai sandbox recreate
```

Recreate specific container:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai sandbox recreate --agent work
```

Force recreate all:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai sandbox recreate --all --force
```

| Option         | Description                 |
| -------------- | --------------------------- |
| `--agent NAME` | Recreate for specific agent |
| `--all`        | Recreate all containers     |
| `--force`      | Skip confirmation prompt    |

***

## Sandbox Modes

| Mode     | Description                                   |
| -------- | --------------------------------------------- |
| `off`    | No sandboxing (default)                       |
| `basic`  | Basic isolation with command validation       |
| `strict` | Strict isolation with filesystem restrictions |

## Usage with Prompts

### Basic Mode

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai "Execute ls -la" --sandbox basic
```

**Output:**

```
🔒 Sandbox Mode: BASIC
Commands will be validated before execution

╭─────────────── 🔒 Tool Approval Required ───────────────╮
│ Function: execute_command                               │
│ Risk Level: CRITICAL                                    │
│ Arguments:                                              │
│   command: ls -la                                       │
╰─────────────────────────────────────────────────────────╯
Execute this critical risk tool? [y/n]:
```

### Strict Mode

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai "Run python script.py" --sandbox strict
```

Strict mode adds additional restrictions:

* Filesystem access limited to current directory
* Network access may be restricted
* Resource limits applied

## Combine with Other Features

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# 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 --sandbox
```

## Security 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

<Warning>
  Sandbox mode provides an additional layer of security but should not be considered a complete security solution. Always review commands before approving execution.
</Warning>

***

## Related

<CardGroup cols={2}>
  <Card title="Bot CLI" icon="robot" href="/cli/bot">
    Deploy messaging bots with sandbox
  </Card>

  <Card title="Browser CLI" icon="globe" href="/cli/browser">
    Browser automation
  </Card>
</CardGroup>
