CognenzaAI
EN
Configurations · Level intermediate

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.

By Cognenza editorial team · Updated · 2 min read · Sources cited

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

LineWhat it does
allowFromList of authorised numbers. Replace the example with yours
groups: { "*": ... }Applies the rule to all groups
requireMention: trueIn groups, only replies when mentioned
mentionPatternsWhich 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

Official sources are linked in their original language.

  1. Documentación oficial de OpenClaw (configuración) — OpenClaw Foundation
  2. 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.