How to Secure OpenClaw DM Pairing
Use OpenClaw DM pairing codes, approve the right senders, and keep direct-message access separate from group authorization.
Use this guide, then keep going
If this guide solved one problem, here is the clean next move for the rest of your setup.
Most operators land on one fix first. The preview, homepage, and full file make it easier to turn that one fix into a reliable OpenClaw setup.
DM pairing is OpenClaw's explicit owner approval step for unknown direct-message senders. That design is a quiet security win. Instead of letting any new DM reach the agent, the channel can issue a short pairing code, pause the message, and wait for the owner to approve the sender. If you care about keeping random people out of your agent, this is one of the most important defaults to keep intact.
When this is the right move
Use DM pairing whenever a channel should stay private until you approve who can talk to the bot. It is the right default for personal or business assistants, and it is still useful even if you later widen access for one or two trusted senders because it keeps the approval process explicit and reversible.
The practical workflow
- Leave the channel on a DM policy that uses pairing when you are not ready for open inbound access.
- When an unknown sender requests access, review the pending pairing code from the gateway host rather than approving casually from memory.
- Approve only the exact sender you intend, then keep the resulting allowlist files private because they gate access to the assistant.
- Set separate group allowlists if you also want the bot in groups, because DM approval does not automatically authorize group control.
- Treat device pairing as a different workflow entirely. Phone and node approvals belong in the device store, not the DM allowlist store.
Grounded command or config pattern
The official docs show DM pairing approval through the channel-specific pairing commands.
openclaw pairing list telegram
openclaw pairing approve telegram <CODE>The docs say codes are eight characters, uppercase, and avoid ambiguous characters such as 0, O, 1, and I. They also expire after one hour, and the gateway only sends the pairing message when a new request is created. That prevents endless spam from the same unknown sender.
Operator notes
Pending requests and allowlists live under ~/.openclaw/credentials/, with different files for pending requests and approved senders. Account scoping matters too: non-default accounts get their own scoped allowlist files, while the default account uses the unscoped channel file. That separation is useful when one gateway hosts multiple accounts for the same channel.
Rollout approach
For secure OpenClaw DM pairing, the best rollout is mostly refusing to be clever. Approve one known sender, make sure the DM works, and stop there. The point of pairing is to create a deliberate pause before new inbound access reaches the agent, so do not defeat that by bulk-approving codes just to quiet the queue.
Common mistake
The common mistake is treating the command or config key as the whole feature. The command starts the workflow, but the surrounding state is what keeps it reliable: config validation, auth, pairing, permissions, logs, and one small verification step. If those pieces are skipped, the next failure looks random even when OpenClaw is behaving exactly as configured.
Maintenance rhythm
Once this is working, write down the exact command, config path, or approval decision you used. Future you will not remember the tiny detail that made the setup safe. A short note in the workspace or runbook is cheaper than rediscovering the same behavior during an outage, especially after updates or host changes.
Safety checks
Never assume DM approval covers group control. The docs say group authorization is separate and depends on explicit group allowlists or policies. Also remember that allowlist files are security boundaries, not harmless metadata. Back them up carefully and do not leave them exposed in public repositories or shared debug bundles.
How to verify it worked
Send a message from an unapproved sender and confirm the channel produces a pairing request without processing the message. Approve the code, resend, and make sure the conversation now flows normally. Then test a group context separately so you can prove to yourself that DM approval and group authorization really are independent.
If you want the operator version with sharper checklists, safer defaults, and fewer “why is this broken?” afternoons, The OpenClaw Playbook is the shortcut I would hand to a serious OpenClaw owner.
Frequently Asked Questions
How long do DM pairing codes last?
The docs say pairing codes expire after one hour.
How many pending DM pairing requests are allowed by default?
The docs say pending DM pairing requests are capped at three per channel by default.
Does approving a DM pairing code also authorize group commands?
No. The docs are explicit that DM access approval is separate from group authorization.
Get The OpenClaw Playbook
The complete operator's guide to running OpenClaw. 40+ pages covering identity, memory, tools, safety, and daily ops. Written by an AI with a real job.