Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.openclaw.ai/llms.txt

Use this file to discover all available pages before exploring further.

Each agent in a multi-agent setup can override the global sandbox and tool policy. This page covers per-agent configuration, precedence rules, and examples.

Sandboxing

Backends and modes — full sandbox reference.

Sandbox vs tool policy vs elevated

Debug “why is this blocked?”

Elevated mode

Elevated exec for trusted senders.
Auth is per-agent: each agent reads from its own agentDir auth store at ~/.openclaw/agents/<agentId>/agent/auth-profiles.json. Credentials are not shared between agents. Never reuse agentDir across agents. If you want to share creds, copy auth-profiles.json into the other agent’s agentDir.

Configuration examples

{
  "agents": {
    "list": [
      {
        "id": "main",
        "default": true,
        "name": "Personal Assistant",
        "workspace": "~/.openclaw/workspace",
        "sandbox": { "mode": "off" }
      },
      {
        "id": "family",
        "name": "Family Bot",
        "workspace": "~/.openclaw/workspace-family",
        "sandbox": {
          "mode": "all",
          "scope": "agent"
        },
        "tools": {
          "allow": ["read"],
          "deny": ["exec", "write", "edit", "apply_patch", "process", "browser"]
        }
      }
    ]
  },
  "bindings": [
    {
      "agentId": "family",
      "match": {
        "provider": "whatsapp",
        "accountId": "*",
        "peer": {
          "kind": "group",
          "id": "120363424282127706@g.us"
        }
      }
    }
  ]
}
Result:
  • main agent: runs on host, full tool access.
  • family agent: runs in Docker (one container per agent), only read tool.
{
  "agents": {
    "list": [
      {
        "id": "personal",
        "workspace": "~/.openclaw/workspace-personal",
        "sandbox": { "mode": "off" }
      },
      {
        "id": "work",
        "workspace": "~/.openclaw/workspace-work",
        "sandbox": {
          "mode": "all",
          "scope": "shared",
          "workspaceRoot": "/tmp/work-sandboxes"
        },
        "tools": {
          "allow": ["read", "write", "apply_patch", "exec"],
          "deny": ["browser", "gateway", "discord"]
        }
      }
    ]
  }
}
{
  "tools": { "profile": "coding" },
  "agents": {
    "list": [
      {
        "id": "support",
        "tools": { "profile": "messaging", "allow": ["slack"] }
      }
    ]
  }
}
Result:
  • default agents get coding tools.
  • support agent is messaging-only (+ Slack tool).
{
  "agents": {
    "defaults": {
      "sandbox": {
        "mode": "non-main",
        "scope": "session"
      }
    },
    "list": [
      {
        "id": "main",
        "workspace": "~/.openclaw/workspace",
        "sandbox": {
          "mode": "off"
        }
      },
      {
        "id": "public",
        "workspace": "~/.openclaw/workspace-public",
        "sandbox": {
          "mode": "all",
          "scope": "agent"
        },
        "tools": {
          "allow": ["read"],
          "deny": ["exec", "write", "edit", "apply_patch"]
        }
      }
    ]
  }
}

Configuration precedence

When both global (agents.defaults.*) and agent-specific (agents.list[].*) configs exist:

Sandbox config

Agent-specific settings override global:
agents.list[].sandbox.mode > agents.defaults.sandbox.mode
agents.list[].sandbox.scope > agents.defaults.sandbox.scope
agents.list[].sandbox.workspaceRoot > agents.defaults.sandbox.workspaceRoot
agents.list[].sandbox.workspaceAccess > agents.defaults.sandbox.workspaceAccess
agents.list[].sandbox.docker.* > agents.defaults.sandbox.docker.*
agents.list[].sandbox.browser.* > agents.defaults.sandbox.browser.*
agents.list[].sandbox.prune.* > agents.defaults.sandbox.prune.*
agents.list[].sandbox.{docker,browser,prune}.* overrides agents.defaults.sandbox.{docker,browser,prune}.* for that agent (ignored when sandbox scope resolves to "shared").

Tool restrictions

The filtering order is:
1

Tool profile

tools.profile or agents.list[].tools.profile.
2

Provider tool profile

tools.byProvider[provider].profile or agents.list[].tools.byProvider[provider].profile.
3

Global tool policy

tools.allow / tools.deny.
4

Provider tool policy

tools.byProvider[provider].allow/deny.
5

Agent-specific tool policy

agents.list[].tools.allow/deny.
6

Agent provider policy

agents.list[].tools.byProvider[provider].allow/deny.
7

Sandbox tool policy

tools.sandbox.tools or agents.list[].tools.sandbox.tools.
8

Subagent tool policy

tools.subagents.tools, if applicable.
  • Each level can further restrict tools, but cannot grant back denied tools from earlier levels.
  • If agents.list[].tools.sandbox.tools is set, it replaces tools.sandbox.tools for that agent.
  • If agents.list[].tools.profile is set, it overrides tools.profile for that agent.
  • Provider tool keys accept either provider (e.g. google-antigravity) or provider/model (e.g. openai/gpt-5.4).
If any explicit allowlist in that chain leaves the run with no callable tools, OpenClaw stops before submitting the prompt to the model. This is intentional: an agent configured with a missing tool such as agents.list[].tools.allow: ["query_db"] should fail loudly until the plugin that registers query_db is enabled, not continue as a text-only agent.
Tool policies support group:* shorthands that expand to multiple tools. See Tool groups for the full list. Per-agent elevated overrides (agents.list[].tools.elevated) can further restrict elevated exec for specific agents. See Elevated mode for details.

Migration from single agent

{
  "agents": {
    "defaults": {
      "workspace": "~/.openclaw/workspace",
      "sandbox": {
        "mode": "non-main"
      }
    }
  },
  "tools": {
    "sandbox": {
      "tools": {
        "allow": ["read", "write", "apply_patch", "exec"],
        "deny": []
      }
    }
  }
}
Legacy agent.* configs are migrated by openclaw doctor; prefer agents.defaults + agents.list going forward.

Tool restriction examples

{
  "tools": {
    "allow": ["read"],
    "deny": ["exec", "write", "edit", "apply_patch", "process"]
  }
}

Common pitfall: “non-main”

agents.defaults.sandbox.mode: "non-main" is based on session.mainKey (default "main"), not the agent id. Group/channel sessions always get their own keys, so they are treated as non-main and will be sandboxed. If you want an agent to never sandbox, set agents.list[].sandbox.mode: "off".

Testing

After configuring multi-agent sandbox and tools:
1

Check agent resolution

openclaw agents list --bindings
2

Verify sandbox containers

docker ps --filter "name=openclaw-sbx-"
3

Test tool restrictions

  • Send a message requiring restricted tools.
  • Verify the agent cannot use denied tools.
4

Monitor logs

tail -f "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}/logs/gateway.log" | grep -E "routing|sandbox|tools"

Troubleshooting

  • Check if there’s a global agents.defaults.sandbox.mode that overrides it.
  • Agent-specific config takes precedence, so set agents.list[].sandbox.mode: "all".
  • Check tool filtering order: global → agent → sandbox → subagent.
  • Each level can only further restrict, not grant back.
  • Verify with logs: [tools] filtering tools for agent:${agentId}.
  • Set scope: "agent" in agent-specific sandbox config.
  • Default is "session" which creates one container per session.