Skip to main content

Overview

Sandboxing controls the agent’s ability to interact with your system. It determines which tools are available, which operations need approval, and what actions are blocked entirely.

Sandbox Modes

{ "security": { "mode": "unrestricted" } }
  • All tools available
  • No approval required
  • Suitable for: trusted personal environments, development

Tool Policies

Fine-grained policies override the global sandbox mode for individual tools:
{
  "toolPolicies": {
    "exec": {
      "mode": "approval-required",
      "blockedPatterns": [
        "rm -rf",
        "sudo",
        "chmod 777",
        "mkfs",
        "> /dev/"
      ],
      "allowedPaths": [
        "/Users/sem/projects/",
        "/tmp/"
      ]
    },
    "browser": {
      "mode": "allowed",
      "blockedDomains": [
        "banking.example.com",
        "*.internal.company.com"
      ]
    },
    "memory_store": {
      "mode": "allowed"
    },
    "memory_recall": {
      "mode": "allowed"
    }
  }
}

Blocked Patterns

The blockedPatterns array uses substring matching against the command string. If any pattern matches, the command is rejected without asking for approval. Common patterns to block:
PatternReason
rm -rf /Prevents recursive deletion of root
sudoPrevents privilege escalation
chmod 777Prevents world-writable permissions
mkfsPrevents filesystem formatting
> /dev/Prevents writing to device files
“ :(){ ::& };: “Fork bomb

Approval Flow

When an operation requires approval:
A modal appears with the command or action details. The user clicks “Approve” or “Reject.”
If no approval is received within a configurable timeout (default: 5 minutes), the operation is rejected automatically.

Path Restrictions

The allowedPaths array restricts where the exec tool can operate:
{
  "exec": {
    "allowedPaths": ["/Users/sem/projects/", "/tmp/"]
  }
}
Commands that attempt to access paths outside the allowed list are blocked.

Testing Your Sandbox

# Verify current security mode
argent config get security.mode

# Test a command against policies
argent security test "rm -rf /tmp/old-files"