> For the complete documentation index, see [llms.txt](https://www.openclawbook.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.openclawbook.xyz/en/ch09-multi-agent-in-practice/9.1-multi-agent-configuration-and-routing.md). Agents can also search and read this documentation through its [MCP server](https://www.openclawbook.xyz/~gitbook/mcp).

# 9.1 Multi-Agent Configuration and Routing

> **Generated by**: Claude Opus 5 (claude-opus-5\[1m]) **Token usage**: Input \~180,000 tokens, Output \~9,000 tokens (this section) **Source baseline**: `v2026.3.9` (`v2026.3.8-170-g665f67726`)

***

## 9.1.1 Why More Than One Agent

One agent works fine until you notice one of these:

| Signal                                                              | What multiple agents fix                                       |
| ------------------------------------------------------------------- | -------------------------------------------------------------- |
| Work and personal contexts bleeding together                        | Separate memory and personality                                |
| One agent needs a permissive tool policy, another shouldn't have it | Separate tool policies                                         |
| Different channels serving genuinely different purposes             | Route each to its own agent                                    |
| Wanting one agent's credentials separate from another's             | **Separate auth profiles** — each agent has its own `agentDir` |

That last one is worth noticing: agents don't just have separate memory, they have **separate credential pools, cooldown states, and round-robin pointers** (§39.4.1). A work agent on the company account and a personal agent on your own don't interfere.

**When you don't need it**: if you just want the same assistant reachable from several apps, you already have that — all DMs share one main session by default (§14.5.3). Multiple agents are for genuinely different *personas*, not different entrances.

## 9.1.2 Configuring `agents.list[]`

```json5
{
  agents: {
    defaults: {
      model: { primary: "anthropic/claude-opus-4-6" },
    },
    list: [
      {
        id: "main",
        default: true,
        // inherits defaults
      },
      {
        id: "work",
        workspace: "~/openclaw-work",
        model: { primary: "anthropic/claude-sonnet-4-6" },
        tools: { profile: "messaging" },   // narrower tool set
      },
      {
        id: "research",
        workspace: "~/openclaw-research",
        model: { primary: "anthropic/claude-opus-4-6" },
      },
    ],
  },
}
```

Each agent gets its own:

* **workspace** — including `AGENTS.md`, `SOUL.md`, and `MEMORY.md`, so personality and memory are fully separate;
* **agentDir** — auth profiles and session storage;
* **model chain** — primary and fallbacks;
* **skill filtering** and **tool policy**.

```bash
openclaw agents list
openclaw agents create <id>
```

### Giving each agent a personality

Since the workspace is separate, each agent's `SOUL.md` is separate:

```bash
# ~/openclaw-work/SOUL.md
```

```markdown
You are a work assistant. Be concise and factual.
Skip pleasantries. When asked about code, show the code.
Never discuss personal matters — redirect those to the personal agent.
```

That's the whole mechanism — personality is a Markdown file (§43.1.4), so configuring an agent's character is editing a file.

## 9.1.3 Routing with Bindings

Bindings map channels, accounts, and groups to agents.

```json5
{
  bindings: [
    { channel: "slack", agentId: "work" },
    { channel: "discord", guild: "123456789", agentId: "research" },
    { channel: "telegram", peer: "-1001234567890", agentId: "work" },
    // anything not matched goes to the default agent
  ],
}
```

### Matching precedence

Bindings match in a **seven-level cascade** (§14.5.3), most specific first:

```
peer          a specific conversation (this group, this DM)
peer.parent   a thread inheriting its parent channel's binding
guild+roles   Discord server plus roles
guild         Discord server
team          Slack workspace
account       a channel account
channel       the whole channel
default       nothing matched
```

So you can say "Slack goes to the work agent, **except** this one channel which goes to research" by adding a more specific `peer` binding — specificity wins.

### Verifying routing

```bash
openclaw sessions list
```

Session keys start with `agent:<id>:`, so you can see directly which agent handled what.

If a message went to the wrong agent, the usual cause is a binding less specific than you expected — check whether a `channel`-level binding is catching something you meant to route by `peer`.

## 9.1.4 Per-Agent Models, Skills, and Tools

### Models

```json5
{
  id: "cheap-worker",
  model: {
    primary: "deepseek/deepseek-chat",
    fallbacks: [],           // explicitly no fallback
  },
}
```

Useful for an agent dedicated to high-volume, low-stakes work.

### Tool policy

```json5
{
  id: "readonly",
  tools: {
    profile: "messaging",     // no exec, no browser
  },
}
```

**This is the strongest reason to run multiple agents.** An agent exposed to a public group chat should not have the same tool access as the one you talk to privately.

Recall that tool filtering has seven layers (§22.5.1) and **agent policy is one of them** — so an agent-level restriction can't be widened by a request.

### Skills

```json5
{
  id: "work",
  skills: {
    allow: ["gh-issues", "tmux"],
  },
}
```

Fewer skills means a smaller system prompt and sharper selection (§6.2.4).

### A worked separation

| Agent    | Channels                   | Model  | Tools            | Why                                            |
| -------- | -------------------------- | ------ | ---------------- | ---------------------------------------------- |
| `main`   | Personal DMs               | Opus   | Full             | Your primary assistant                         |
| `work`   | Slack, work Telegram group | Sonnet | `messaging` + gh | Cheaper, and no shell access in a work context |
| `public` | A public Discord server    | Haiku  | `messaging` only | **Untrusted input — minimal capability**       |

> **The `public` row is the important one.** An agent reachable by strangers should have the narrowest capability set you can give it, because prompt injection there isn't hypothetical — §44.4's position is that injection *will* succeed, and what saves you is that a manipulated agent can't do anything.

***

## Section Summary

1. **Agents get separate workspaces, credentials, models, skills, and tool policies** — including **separate auth profile pools and cooldown states**, so a work account and a personal one don't interfere.
2. **You don't need multiple agents just to be reachable from several apps** — all DMs already share one session. Multiple agents are for genuinely different personas.
3. **Personality is a Markdown file** in each agent's workspace — configuring character is editing `SOUL.md`.
4. **Bindings match in a seven-level cascade**, most specific first, so exceptions are expressed by adding a more specific binding. Wrong routing usually means a `channel`-level binding catching what you meant to route by `peer`.
5. **Per-agent tool policy is the strongest reason to run multiple agents** — and it's one of the seven filtering layers, so a request can't widen it.
6. **An agent reachable by strangers should have the narrowest capability set possible** — injection there isn't hypothetical, and what saves you is that a manipulated agent can't do anything.
