Who can talk to your bot?
DM pairing, node pairing, CLI flows, and where OpenClaw stores trust decisions
DM pairing, node pairing, CLI flows, and where OpenClaw stores trust decisions
In OpenClaw, pairing means an explicit approval step before trust is granted. There are two different pairing stories people mix up:
node role (and optional scope upgrades later). This is not the same as “someone messaged my bot.”Both exist because a self-hosted assistant is a security boundary: you want defaults that fail closed. Read Security for DM defaults, sandboxing, and exec policy alongside this page.
When a channel uses DM policy pairing, unknown senders get a pairing code and their traffic is not processed until you approve.
0O1I confusion). Codes expire after about one hour. The bot only sends the pairing message when a new request is created (roughly once per hour per sender).open vs pairing — dmPolicy: "open" is only truly public when the effective allowlist includes the wildcard "*". If you see open with concrete allowFrom entries, runtime still only admits those senders; pairing-store approvals do not widen access beyond that.openclaw pairing list telegram
openclaw pairing approve telegram <CODE>
Use --channel / --account when you run multiple accounts on one channel type; --json helps scripts. pairing approve can send a confirmation back with --notify when you want the user to see approval on-channel.
If commands.ownerAllowFrom is still empty when you approve a DM pairing code, OpenClaw also records the approved sender as the command owner (for example telegram:123456789). That owner can run privileged commands and act on dangerous operations later. Only the first approval does this—later pairing approvals add DM access but do not keep expanding the owner list.
If you paired before owner bootstrap existed, run openclaw doctor; it warns when no owner is configured and suggests a openclaw config set commands.ownerAllowFrom ... fix.
Approving a DM pairing code does not automatically authorize someone in group chats. Group delivery still follows groupAllowFrom, groups, or per-channel overrides. Plan both surfaces if your bot sits in DMs and large rooms.
When the same people should be trusted across several channels, define top-level accessGroups with type: "message.senders" and reference accessGroup:yourGroup from each channel allowlist. Details and JSON examples live in the upstream access-groups doc linked below.
Under ~/.openclaw/credentials/ you will find pairing and allowlist files (names vary by channel and account). Treat them as sensitive: they gate who can talk to your assistant. Non-default accounts use scoped filenames; the default account uses the channel-wide file.
Nodes connect to the Gateway with role: node. The Gateway creates a device pairing request you approve explicitly unless you have opted into a narrow auto-approve rule (see below).
openclaw devices list
openclaw devices approve <requestId>
openclaw devices reject <requestId>
If a device reconnects asking for broader scopes or a different role, OpenClaw keeps the old approval and opens a new pending upgrade request—compare devices list output before you approve.
With the device-pair plugin you can drive first-time pairing from Telegram: message /pair, copy the setup payload the bot sends, paste it into the mobile app’s Gateway settings, then use /pair pending in Telegram to review IDs and approve. Treat the setup payload like a password while it is valid—it encodes the WebSocket URL and a short-lived bootstrap token.
For tightly controlled networks you may configure gateway.nodes.pairing.autoApproveCidrs with explicit CIDRs so first-time node requests with no extra scopes auto-approve. Operator clients, browsers, Control UI, and WebChat still require manual approval; scope or key changes still require human review.
Under ~/.openclaw/devices/: pending.json (short-lived requests) and paired.json (approved devices and tokens). The pairing record is the durable contract for roles; stray token rows cannot silently widen access.
Legacy note: the older node.pair.* API (openclaw nodes pending|approve|...) is a separate gateway-owned store; WebSocket nodes still expect the device pairing flow above.
groupAllowFrom / group policies for that channel.devices list.--channel; multi-account Telegram/WhatsApp needs --account.Policy names, per-channel quirks, and bootstrap rules evolve. Use the project docs when you need verbatim JSON keys or the newest channel list:
openclaw pairing — every flag for list/approve.Pairing is one layer; combine it with exec approvals, sandboxing and DM policy, and safe remote access when you expose the Gateway beyond loopback.