Agents: Sealed Boxes
Say you want one helper for family errands on your personal WhatsApp and another for client work on Slack. You would want them never to mix: no work notes turning up in family replies, no shared API keys. OpenClaw's agents are built for exactly that.
The rule
An agent is a sealed box: its own workspace, credentials and history.
Think of each agent as a box with three drawers.
- Workspace folder. Its personality and configuration files, plus its memory files. This is what the agent is and knows.
- State directory. Its auth profiles (the credentials it uses to reach model providers) and its model registry. This is what the agent can use.
- Session store. The full conversation history, kept apart from every other agent. This is what the agent has said.
Because auth profiles belong to one agent, credentials are never shared automatically. A personal agent and a work agent can run on the same Gateway without their sessions, memories or keys crossing over.
Sessions live inside an agent. A session is the conversation context for one agent and one chat source. By default, all direct messages to an agent share one session. If more than one person can message your agent, give each sender their own session; otherwise one person's context can leak into another person's reply.
Routing rules decide which agent gets a message, and the most specific rule wins. A rule for one particular sender (a peer) beats a rule for a whole channel, and a channel rule beats the default agent, which catches whatever is left.
The shortcut
For any "will X see Y?" question, find which drawer Y lives in, and whose box that drawer belongs to. A different box means no.
The rules
Your sister's WhatsApp goes to the personal agent (peer rule). All of Slack goes to the work agent (channel rule). Anything else goes to the personal agent (default).
The trap is thinking "same Gateway" means "shared everything". The Gateway is shared; the boxes are not.
Drills
Answer fast — trust the rule.
Where does an agent's conversation history live?
The work agent has an OpenAI key in its auth profile. Can the personal agent use it automatically?
A peer rule sends your sister's messages to the personal agent, and a channel rule sends all WhatsApp to the work agent. Your sister writes on WhatsApp. Who answers?
Three friends can all send direct messages to your agent. What should you change?
Remember
- An agent is a sealed box: workspace, state (credentials and models), and sessions.
- For "will X see Y?", find Y's drawer and whose box it is in.
- Routing: most specific wins (peer, then channel, then default); give each sender a session when several people chat.
