Skip to content

How to Run Multiple Isolated AI Agents on One Gateway

I’ve often run into the problem where one AI assistant tries to do too much. You want it to handle your work emails, but then you also want it to help with personal projects or manage a family group chat. Without isolation, the context gets messy, chat histories bleed into each other, and the AI loses its specific persona. It’s much better to have separate “brains” for different tasks.

In this guide, I’ll show you how to use OpenClaw to host multiple isolated agents on a single Gateway. This means each agent gets its own files, its own memory, and its own personality, all while sharing the same server infrastructure.

  • OpenClaw installed and running.
  • A configuration file (usually ~/.openclaw/openclaw.json).
  • One or more messaging accounts (like WhatsApp, Telegram, or Slack) to route.

The fastest way to get a second agent running is to use the built-in wizard. I recommend this because it handles the directory structure for you.

  1. Add a new agent: Run this command to create an agent named “work”:

    Terminal window
    openclaw agents add work
  2. Define your routing: Open your ~/.openclaw/openclaw.json and set up your bindings. Here is a simple setup that routes WhatsApp to a “chat” agent and Telegram to an “opus” agent:

    {
    agents: {
    list: [
    {
    id: "chat",
    name: "Everyday",
    workspace: "~/.openclaw/workspace-chat",
    model: "anthropic/claude-sonnet-4-5",
    },
    {
    id: "opus",
    name: "Deep Work",
    workspace: "~/.openclaw/workspace-opus",
    model: "anthropic/claude-opus-4-6",
    },
    ],
    },
    bindings: [
    { agentId: "chat", match: { channel: "whatsapp" } },
    { agentId: "opus", match: { channel: "telegram" } },
    ],
    }
  3. Verify your setup: Check that your agents and their bindings are recognized:

    Terminal window
    openclaw agents list --bindings

When a message hits your Gateway, OpenClaw needs to decide which agent should answer. It uses a deterministic “most-specific wins” logic. I find it helpful to think of it as a ladder—the more specific your rule, the higher it sits.

The order is:

  1. Peer match: Specific DM or Group ID.
  2. Guild/Team ID: Specific Discord server or Slack team.
  3. Account ID: A specific phone number or account instance.
  4. Channel match: Any message from a specific platform (e.g., all of WhatsApp).
  5. Default agent: If nothing else matches, it goes here.

If you want to use one WhatsApp account but route a specific friend to a more powerful model, you would place the peer match above the general channel match:

{
agents: {
list: [
{
id: "chat",
name: "Everyday",
workspace: "~/.openclaw/workspace-chat",
model: "anthropic/claude-sonnet-4-5",
},
{
id: "opus",
name: "Deep Work",
workspace: "~/.openclaw/workspace-opus",
model: "anthropic/claude-opus-4-6",
},
],
},
bindings: [
{
agentId: "opus",
match: { channel: "whatsapp", peer: { kind: "direct", id: "+15551234567" } },
},
{ agentId: "chat", match: { channel: "whatsapp" } },
],
}

Each agent is a “fully scoped brain.” This means it has its own workspace for files (AGENTS.md, SOUL.md) and its own state directory (agentDir) for authentication profiles and session history.

I highly recommend keeping these separate. If you reuse an agentDir across multiple agents, you will run into authentication and session collisions. If you need to share credentials between two agents, the correct way is to copy the auth-profiles.json from one agent’s directory to the other.

Starting with v2026.1.6, you can also sandbox agents individually. This is great if you want your personal agent to have full host access but want your “family bot” restricted to a Docker container:

{
agents: {
list: [
{
id: "personal",
workspace: "~/.openclaw/workspace-personal",
sandbox: { mode: "off" },
},
{
id: "family",
workspace: "~/.openclaw/workspace-family",
sandbox: {
mode: "all",
scope: "agent",
docker: {
setupCommand: "apt-get update && apt-get install -y git curl",
},
},
tools: {
allow: ["read"],
deny: ["exec", "write", "edit", "apply_patch"],
},
},
],
},
}
  • Auth/Session Collisions: This happens if you point two agents at the same agentDir. Always give each agent a unique path like ~/.openclaw/agents/<agentId>/agent.
  • Direct Chat Isolation: Direct chats collapse to the agent’s main session key. If you need true isolation between different people messaging the same WhatsApp number, you must assign each person to a unique agent.
  • Credentials not shared: Main agent credentials are not shared automatically. You must manually copy auth-profiles.json into the new agent’s agentDir if you want them to use the same accounts.

If you have questions about specific configurations, check out the AI Setup Assistant.

OpenClaw

OpenClaw Expert

Still stuck?

If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.