Configuration: OpenClaw on WhatsApp just for you
In 30 seconds
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.
In this guide · 7
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 ~/.:
{
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 |
require | In groups, only replies when mentioned |
mention | 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
OpenClaw: guide
A guide to OpenClaw, the open-source AI assistant that runs on your own computer and replies from your messaging apps: requirements, installation, safe configuration and limits.
AI agents: real risks
What changes when an AI doesn’t just answer but acts: files, commands, browser and messages. The risks documented by the projects themselves (prompt injection, permissions, keys) and a checklist.
Sources
- OpenClaw official documentation (configuration) — OpenClaw Foundation
- Gateway security — OpenClaw Foundation
Change log
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.