Multi-Agent Sandbox & Tools Configuration
Overview
Each agent in a multi-agent setup can now have its own:- Sandbox configuration (
agents.list[].sandboxoverridesagents.defaults.sandbox) - Tool restrictions (
tools.allow/tools.deny, plusagents.list[].tools)
- Personal assistant with full access
- Family/work agents with restricted tools
- Public-facing agents in sandboxes
setupCommand belongs under sandbox.docker (global or per-agent) and runs once
when the container is created.
Auth is per-agent: each agent reads from its own agentDir auth store at:
agentDir across agents.
If you want to share creds, copy auth-profiles.json into the other agent’s agentDir.
For how sandboxing behaves at runtime, see Sandboxing.
For debugging “why is this blocked?”, see Sandbox vs Tool Policy vs Elevated and clawdia sandbox explain.
Configuration Examples
Example 1: Personal + Restricted Family Agent
mainagent: Runs on host, full tool accessfamilyagent: Runs in Docker (one container per agent), onlyreadtool
Example 2: Work Agent with Shared Sandbox
Example 2b: Global coding profile + messaging-only agent
- default agents get coding tools
supportagent is messaging-only (+ Slack tool)
Example 3: Different Sandbox Modes per Agent
Configuration Precedence
When both global (agents.defaults.*) and agent-specific (agents.list[].*) configs exist:
Sandbox Config
Agent-specific settings override global:agents.list[].sandbox.{docker,browser,prune}.*overridesagents.defaults.sandbox.{docker,browser,prune}.*for that agent (ignored when sandbox scope resolves to"shared").
Tool Restrictions
The filtering order is:- Tool profile (
tools.profileoragents.list[].tools.profile) - Provider tool profile (
tools.byProvider[provider].profileoragents.list[].tools.byProvider[provider].profile) - Global tool policy (
tools.allow/tools.deny) - Provider tool policy (
tools.byProvider[provider].allow/deny) - Agent-specific tool policy (
agents.list[].tools.allow/deny) - Agent provider policy (
agents.list[].tools.byProvider[provider].allow/deny) - Sandbox tool policy (
tools.sandbox.toolsoragents.list[].tools.sandbox.tools) - Subagent tool policy (
tools.subagents.tools, if applicable)
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.2).
Tool groups (shorthands)
Tool policies (global, agent, sandbox) supportgroup:* entries that expand to multiple concrete tools:
group:runtime:exec,bash,processgroup:fs:read,write,edit,apply_patchgroup:sessions:sessions_list,sessions_history,sessions_send,sessions_spawn,session_statusgroup:memory:memory_search,memory_getgroup:ui:browser,canvasgroup:automation:cron,gatewaygroup:messaging:messagegroup:nodes:nodesgroup:clawdia: all built-in Clawdia tools (excludes provider plugins)
Elevated Mode
tools.elevated is the global baseline (sender-based allowlist). agents.list[].tools.elevated can further restrict elevated for specific agents (both must allow).
Mitigation patterns:
- Deny
execfor untrusted agents (agents.list[].tools.deny: ["exec"]) - Avoid allowlisting senders that route to restricted agents
- Disable elevated globally (
tools.elevated.enabled: false) if you only want sandboxed execution - Disable elevated per agent (
agents.list[].tools.elevated.enabled: false) for sensitive profiles
Migration from Single Agent
Before (single agent):agent.* configs are migrated by clawdia doctor; prefer agents.defaults + agents.list going forward.
Tool Restriction Examples
Read-only Agent
Safe Execution Agent (no file modifications)
Communication-only Agent
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:-
Check agent resolution:
-
Verify sandbox containers:
-
Test tool restrictions:
- Send a message requiring restricted tools
- Verify the agent cannot use denied tools
-
Monitor logs:
Troubleshooting
Agent not sandboxed despite mode: "all"
- Check if there’s a global
agents.defaults.sandbox.modethat overrides it - Agent-specific config takes precedence, so set
agents.list[].sandbox.mode: "all"
Tools still available despite deny list
- 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}
Container not isolated per agent
- Set
scope: "agent"in agent-specific sandbox config - Default is
"session"which creates one container per session
