Caricamento in corso...
Caricamento in corso...
Last synced: Today, 22:00
Technical reference for the OpenClaw framework. Real-time synchronization with the official documentation engine.
Use this file to discover all available pages before exploring further.
Goal: run OpenClaw as a named delegate — an agent with its own identity that acts "on behalf of" people in an organization. The agent never impersonates a human. It sends, reads, and schedules under its own account with explicit delegation permissions.
This extends Multi-Agent Routing from personal use into organizational deployments.
A delegate is an OpenClaw agent that:
AGENTS.mdThe delegate model maps directly to how executive assistants work: they have their own credentials, send mail "on behalf of" their principal, and follow a defined scope of authority.
OpenClaw's default mode is a personal assistant — one human, one agent. Delegates extend this to organizations:
| Personal mode | Delegate mode |
|---|---|
| Agent uses your credentials | Agent has its own credentials |
| Replies come from you | Replies come from the delegate, on your behalf |
| One principal | One or many principals |
| Trust boundary = you | Trust boundary = organization policy |
Delegates solve two problems:
Start with the lowest tier that meets your needs. Escalate only when the use case demands it.
The delegate can read organizational data and draft messages for human review. Nothing is sent without approval.
This tier requires only read permissions from the identity provider. The agent does not write to any mailbox or calendar — drafts and proposals are delivered via chat for the human to act on.
The delegate can send messages and create calendar events under its own identity. Recipients see "Delegate Name on behalf of Principal Name."
This tier requires send-on-behalf (or delegate) permissions.
The delegate operates autonomously on a schedule, executing standing orders without per-action human approval. Humans review output asynchronously.
This tier combines Tier 2 permissions with Cron Jobs and Standing Orders.
Define these in the delegate's
SOUL.mdAGENTS.mdThese rules load every session. They are the last line of defense regardless of what instructions the agent receives.
Use per-agent tool policy (v2026.1.6+) to enforce boundaries at the Gateway level. This operates independently of the agent's personality files — even if the agent is instructed to bypass its rules, the Gateway blocks the tool call:
json5{ id: "delegate", workspace: "~/.openclaw/workspace-delegate", tools: { allow: ["read", "exec", "message", "cron"], deny: ["write", "edit", "apply_patch", "browser", "canvas"], }, }
For high-security deployments, sandbox the delegate agent so it cannot access the host filesystem or network beyond its allowed tools:
json5{ id: "delegate", workspace: "~/.openclaw/workspace-delegate", sandbox: { mode: "all", scope: "agent", }, }
See Sandboxing and Multi-Agent Sandbox & Tools.
Configure logging before the delegate handles any real data:
~/.openclaw/cron/runs/<jobId>.jsonl~/.openclaw/agents/delegate/sessionsAll delegate actions flow through OpenClaw's session store. For compliance, ensure these logs are retained and reviewed.
With hardening in place, proceed to grant the delegate its identity and permissions.
Use the multi-agent wizard to create an isolated agent for the delegate:
bashopenclaw agents add delegate
This creates:
~/.openclaw/workspace-delegate~/.openclaw/agents/delegate/agent~/.openclaw/agents/delegate/sessionsConfigure the delegate's personality in its workspace files:
AGENTS.mdSOUL.mdUSER.mdThe delegate needs its own account in your identity provider with explicit delegation permissions. Apply the principle of least privilege — start with Tier 1 (read-only) and escalate only when the use case demands it.
Create a dedicated user account for the delegate (e.g.,
delegate@[organization].orgSend on Behalf (Tier 2):
powershell# Exchange Online PowerShell Set-Mailbox -Identity "principal@[organization].org" ` -GrantSendOnBehalfTo "delegate@[organization].org"
Read access (Graph API with application permissions):
Register an Azure AD application with
Mail.ReadCalendars.ReadpowershellNew-ApplicationAccessPolicy ` -AppId "<app-client-id>" ` -PolicyScopeGroupId "<mail-enabled-security-group>" ` -AccessRight RestrictAccess
Create a service account and enable domain-wide delegation in the Admin Console.
Delegate only the scopes you need:
texthttps://www.googleapis.com/auth/gmail.readonly # Tier 1 https://www.googleapis.com/auth/gmail.send # Tier 2 https://www.googleapis.com/auth/calendar # Tier 2
The service account impersonates the delegate user (not the principal), preserving the "on behalf of" model.
Route inbound messages to the delegate agent using Multi-Agent Routing bindings:
json5{ agents: { list: [ { id: "main", workspace: "~/.openclaw/workspace" }, { id: "delegate", workspace: "~/.openclaw/workspace-delegate", tools: { deny: ["browser", "canvas"], }, }, ], }, bindings: [ // Route a specific channel account to the delegate { agentId: "delegate", match: { channel: "whatsapp", accountId: "org" }, }, // Route a Discord guild to the delegate { agentId: "delegate", match: { channel: "discord", guildId: "123456789012345678" }, }, // Everything else goes to the main personal agent { agentId: "main", match: { channel: "whatsapp" } }, ], }
Copy or create auth profiles for the delegate's
agentDirbash# Delegate reads from its own auth store ~/.openclaw/agents/delegate/agent/auth-profiles.json
Never share the main agent's
agentDirA complete delegate configuration for an organizational assistant that handles email, calendar, and social media:
json5{ agents: { list: [ { id: "main", default: true, workspace: "~/.openclaw/workspace" }, { id: "org-assistant", name: "[Organization] Assistant", workspace: "~/.openclaw/workspace-org", agentDir: "~/.openclaw/agents/org-assistant/agent", identity: { name: "[Organization] Assistant" }, tools: { allow: ["read", "exec", "message", "cron", "sessions_list", "sessions_history"], deny: ["write", "edit", "apply_patch", "browser", "canvas"], }, }, ], }, bindings: [ { agentId: "org-assistant", match: { channel: "signal", peer: { kind: "group", id: "[group-id]" } }, }, { agentId: "org-assistant", match: { channel: "whatsapp", accountId: "org" } }, { agentId: "main", match: { channel: "whatsapp" } }, { agentId: "main", match: { channel: "signal" } }, ], }
The delegate's
AGENTS.mdIf you grant
sessions_history<relevant-memories><tool_call>...</tool_call><function_call>...</function_call><tool_calls>...</tool_calls><function_calls>...</function_calls>[sessions_history omitted: message too large]The delegate model works for any small organization:
Multiple organizations can share one Gateway server using multi-agent routing — each org gets its own isolated agent, workspace, and credentials.
© 2024 TaskFlow Mirror
Powered by TaskFlow Sync Engine