Configuration: OpenClaw on WhatsApp just for you
A copyable recipe so your OpenClaw assistant on WhatsApp only serves your number and, in groups, only replies when mentioned. With explanation and security audit.
What it’s for
When you connect OpenClaw to WhatsApp, anyone who has that number could try to message your assistant. This recipe, based on the official example, makes sure only your number can give it orders and that in groups it only replies when mentioned.
The recipe
File ~/.openclaw/openclaw.json:
{
channels: {
whatsapp: {
allowFrom: ["+15555550123"],
groups: { "*": { requireMention: true } },
},
},
messages: { groupChat: { mentionPatterns: ["@openclaw"] } },
}
Line by line
| Line | What it does |
|---|---|
allowFrom | List of authorised numbers. Replace the example with yours |
groups: { "*": ... } | Applies the rule to all groups |
requireMention: true | In groups, only replies when mentioned |
mentionPatterns | Which text counts as a mention (here, @openclaw) |
The format is JSON5: unlike strict JSON, it allows comments and trailing commas.
Check the security
openclaw security audit
According to the documentation, it reviews settings that drift from the safe configuration. Also, keep the Gateway listening only on your computer (the default) and don’t publish it on the internet without authentication.
Precautions
- A Gateway is one circle of trust: don’t share it with people you don’t fully trust.
- Even your authorised contacts shouldn’t send it links or files of doubtful origin: they can contain prompt injection.
Frequently asked questions
What happens if someone else messages the assistant?
With allowFrom, only numbers on the list are accepted. Without a list, the documentation says most channels reply to the stranger with a pairing code and don’t process their message.
And in groups?
With requireMention: true, the assistant only replies in a group when someone mentions it with one of the patterns you configure.
Can I add several numbers?
Yes, as a list: ["+44...", "+44..."]. Remember that all those people will be able to give orders to your assistant.
Keep reading
Sources
- Documentación oficial de OpenClaw (configuración) — OpenClaw Foundation
- Seguridad del Gateway — OpenClaw Foundation
Change log
- : First published, based on the official configuration example.
Educational content, prepared with the help of AI tools, with sources cited. It is not a substitute for professional advice. Tools change fast: if you spot something out of date, write to us at contacto@cognenza.com. How we work.