A family shares one OpenClaw assistant over direct messages and one member's private details surface in another's chat — why, and what do you change?
answer
- one brain by default
- the DM scope key
- main versus per-channel-peer
- one person, two apps
- what isolation leaves shared
basics
~10 sOpenClaw's session.dmScope defaults to main, so every direct message joins one shared session and each sender's turns carry the others' context. Setting session.dmScope to per-channel-peer gives each sender on each channel an isolated session.
solid answer
~40 sNothing broke: with `session.dmScope` unset, OpenClaw 2026.9.9 uses `main`, and every direct message from every person and channel joins the agent's one main session, `agent:<agentId>:main`. That is the personal-agent default, built for continuity across one owner's devices, so a second person's replies are shaped by the first person's context. The fix is `session.dmScope: "per-channel-peer"`, which keys each DM session by channel and sender. `per-account-channel-peer` adds the channel account when you run several accounts on one channel, and `per-peer` keys by sender without the channel. When one person writes from two apps, `session.identityLinks` maps their ids to one canonical peer. Group chats already get a session per group. `openclaw security audit` warns when several DM senders share the main session. Isolation splits transcripts, not the agent's workspace files.
code
json · 8 lines{
"session": {
"dmScope": "per-channel-peer",
"identityLinks": {
"alice": ["telegram:123456789", "discord:987654321012345678"]
}
}
}go deeper
Recall that OpenClaw's session.dmScope defaults to main, so all direct messages share one session, and that per-channel-peer gives each sender a separate conversation.
Explain the session key each dmScope value produces, when per-account-channel-peer is needed, and that identityLinks only matters once DMs are isolated. Name openclaw security audit as the check.
Show the follow-through: reset the main session that already holds mixed history, and say what dmScope leaves shared, namely the agent's workspace files and, by default, its session tools' view of other sessions.
Frame dmScope as a messaging-context boundary inside one trusted Gateway, not tenancy. A household whose members must be protected from each other needs separate Gateways, which means a second install and its own channel accounts.
## Why the details crossed over OpenClaw routes every inbound message to a **session**, a conversation bucket keyed by where the message came from. For direct messages the key is decided by `session.dmScope`. When it is unset, OpenClaw 2026.9.9 uses `main`: every direct message, from every sender and every channel, lands in the agent's **main session** (`agent:<agentId>:main`). This is deliberate. OpenClaw is a personal agent first, and the main session gives one owner the same conversation on their phone, laptop and the web app. In a household the same default means one shared conversation. When the parent asks about a medical appointment and a teenager later asks for help with homework, the model sees both exchanges in one transcript. A later reply to the teenager can draw on the appointment details, because to the model it is one continuing conversation. No message was misrouted; the routing did exactly what the default says. Release 2026.8.1 restored this one shared cross-channel DM session for fresh installs, and onboarding leaves `session.dmScope` unset unless you set it, so a family install starts in this state. ## The `session.dmScope` values | Value | Session key shape | Use it when | |---|---|---| | `main` (default) | `agent:<agentId>:main` | One person talks to the agent | | `per-channel-peer` | `agent:<agentId>:<channel>:direct:<peerId>` | Several people message it; the recommended isolating value | | `per-account-channel-peer` | `agent:<agentId>:<channel>:<accountId>:direct:<peerId>` | One channel runs several accounts | | `per-peer` | `agent:<agentId>:direct:<peerId>` | You want one session per sender id regardless of channel | Group chats, rooms and channels are a separate axis: under the default `session.groupScope: "per-group"` each group already has its own session, so the leak comes from direct messages. ## Fixing the household install 1. Set `session.dmScope` to `per-channel-peer` in `openclaw.json`. Once the Gateway has picked up the change, each family member's new DMs get their own session. 2. If one member writes from two apps and should keep one conversation, add `session.identityLinks`, mapping a canonical name to provider-prefixed ids such as `telegram:123456789`. Links are consulted only when DMs are isolated; under `main` everything already shares one session. 3. Clear what is already mixed. The main session still holds the shared history, and heartbeats and background work keep reporting to it; reset it once, for example with `/reset` in the Control UI's Home conversation. 4. Run `openclaw security audit`; it recommends DM isolation when it sees multiple senders sharing the main session. 5. Check the result with `openclaw sessions --json`: each member should now appear under their own direct session key. ## Checking the result A quick way to confirm the change took effect is to compare session keys before and after: - Before the change, every family member's messages show up under one key, `agent:<agentId>:main`. - After it, each member appears under a key that names the channel and their sender id, for example `agent:main:telegram:direct:123456789`. - `/status` in each member's chat reports that conversation's own context usage, so a fresh session for a new sender starts small instead of carrying the household's history. - If a member still sees the shared history, check that the config was saved where the Gateway reads it and that the member is not writing from an identity linked to someone else. ## What DM isolation does not cover - **Who may message the agent.** That is decided by the channel's DM policy and allowlists, a separate layer; isolating sessions does not admit or block anyone. - **The workspace.** Sessions belong to an agent, and the agent's workspace, including the memory files it writes, is shared by all of its sessions. A fact written there in one member's chat can surface in another's. - **The agent's own session tools.** In 2026.9.9 an unset `tools.sessions.visibility` means `all`, so an unsandboxed agent can list, read and search other sessions on the Gateway. Narrowing it is part of the isolation decision. - **Untrusted users.** DM scope is a messaging-context boundary inside one trusted Gateway, not a host-admin boundary. People who must be protected from each other need separate Gateways. A side effect worth knowing: once any DM isolation is configured, cross-conversation memory recall defaults off unless you turn it on explicitly.
- Why did adding `session.identityLinks` change nothing on a default OpenClaw config?Identity links are consulted only when DMs are isolated. Under the default `session.dmScope: "main"` every direct message already joins the one main session, so there is nothing to merge. Once you switch to `per-channel-peer` or another isolating value, a link maps a person's provider-prefixed ids, such as `telegram:123456789` and `discord:987654321012345678`, to one canonical peer so their apps share one session.
- When do you need `per-account-channel-peer` rather than `per-channel-peer`?When one channel runs several accounts, for example two Telegram bot accounts on one Gateway. `per-channel-peer` keys a session by channel and sender only, so the same sender reaching both accounts would land in one session. `per-account-channel-peer` adds the account id to the key and keeps those conversations apart.
- What happens to the isolated sessions if you later set `session.dmScope` back to `main`?New direct messages join the main session again, and the old peer-keyed DM rows stay in the store. `openclaw sessions cleanup --dry-run --fix-dm-scope` previews them, and applying the same flag retires those rows while keeping their transcripts as deleted archives.
The default main session is one family notebook the assistant rereads before every reply, so whatever anyone wrote shapes everyone's answers. per-channel-peer gives each person a notebook of their own, but the assistant still keeps one shared shelf of workspace files that every notebook can draw on.
- OpenClaw gives each sender a private DM session by default.
- Setting dmPolicy to pairing keeps one sender's conversation out of another's session.
- Group chats share the main session with direct messages by default.
- per-channel-peer also gives each person separate workspace and memory files.
- With DM isolation on, one Gateway is safe for people who do not trust each other.
Assumes OpenClaw 2026.9.9, where an unset session.dmScope means main; release 2026.8.1 restored the single shared cross-channel DM session for fresh installs.