Pairing 是 OpenClaw 的显式访问审批步骤,用于两个场景:
- DM 配对:谁可以与 bot 对话
- 节点配对:哪些设备/节点可以加入 Gateway 网络
DM 配对
当频道配置 dmPolicy: "pairing" 时,未知发送者收到短码,消息不被处理直到审批。
配对码特性:
- 8 字符,大写,无歧义字符(
0O1I) - 1 小时后过期
- 每个频道最多 3 个待处理请求
审批发送者:
openclaw pairing list telegram
openclaw pairing approve telegram <CODE>首次审批 DM 配对码时,会自动将该发送者设为 commands.ownerAllowFrom(命令 owner)。
支持的频道:discord、feishu、googlechat、imessage、irc、line、matrix、mattermost、msteams、nextcloud-talk、nostr、signal、slack、synology-chat、telegram、twitch、whatsapp、zalo 等
可复用发送者组
{
accessGroups: {
operators: {
type: "message.senders",
members: {
discord: ["discord:123456789012345678"],
telegram: ["987654321"],
whatsapp: ["+15551234567"],
},
},
},
channels: {
telegram: { dmPolicy: "allowlist", allowFrom: ["accessGroup:operators"] },
},
}状态存储
存储在 ~/.openclaw/credentials/:
- 待处理请求:
<channel>-pairing.json - 已审批白名单:
<channel>-allowFrom.json(默认账号)或<channel>-<accountId>-allowFrom.json
注意:DM 配对审批不自动允许该发送者在群组中触发 bot。
节点设备配对(iOS/Android/macOS)
节点以 role: node 连接 Gateway,需要审批。
通过 Telegram 配对(推荐):
- 在 Telegram 发送
/pair - bot 回复设置码
- 在 OpenClaw iOS 应用 → 设置 → Gateway 扫码或粘贴
- 在 Telegram 发送
/pair pending查看,然后审批
审批节点:
openclaw devices list
openclaw devices approve <requestId>
openclaw devices reject <requestId>可信 CIDR 自动审批(可选):
{
gateway: {
nodes: {
pairing: {
autoApproveCidrs: ["192.168.1.0/24"],
},
},
},
}仅适用于无请求 scope 的 role: node 首次配对请求。
相关链接
- channel-access-groups — 可复用发送者组
- channel-routing — 消息路由机制