Gateway Security
Sandboxing, tool policies, and exec approval workflows.
Overview
The gateway enforces security policies that control what the agent can do. This includes sandboxing command execution, restricting tool access, and requiring user approval for dangerous operations.
Security Modes
Unrestricted
All tools are available with no approval required. Suitable for trusted environments where the agent has full system access.
{
"agents": {
"defaults": {
"security": {
"mode": "unrestricted"
}
}
}
}Sandboxed (Default)
Tools are available but dangerous operations require user approval. This is the recommended mode for most deployments.
{
"agents": {
"defaults": {
"security": {
"mode": "sandboxed"
}
}
}
}Locked
Only safe tools (memory, tasks) are available. Command execution and browser are disabled. Suitable for customer-facing agents.
{
"agents": {
"defaults": {
"security": {
"mode": "locked"
}
}
}
}Tool Policies
Fine-grained control over individual tools:
{
"agents": {
"defaults": {
"toolPolicies": {
"exec": {
"mode": "approval-required",
"blockedPatterns": ["rm -rf", "sudo", "chmod 777"],
"allowedPaths": ["/Users/sem/projects/"]
},
"browser": {
"mode": "allowed",
"blockedDomains": ["banking.example.com"]
},
"memory_store": {
"mode": "allowed"
}
}
}
}
}Policy Modes
| Mode | Behavior |
|---|---|
allowed | Tool executes without approval |
approval-required | User must approve each use |
blocked | Tool is not available |
Exec Approval Flow
When the agent requests a command that requires approval:
- The command is displayed to the user (in dashboard or channel)
- User reviews the command
- User approves or rejects
- If approved, the command executes normally
- If rejected, the agent is informed and can try an alternative
Gateway Authentication
Protect the WebSocket API from unauthorized access:
{
"gateway": {
"auth": {
"enabled": true,
"token": "your-secret-token"
}
}
}Without authentication, anyone with network access to the gateway port can send messages to your agent.
Recommendations
- Personal use: Sandboxed mode with approval for destructive commands
- Team use: Sandboxed mode with restricted paths
- Customer-facing: Locked mode with only safe tools
- Development: Unrestricted mode for rapid iteration