skip to content

Your OpenClaw bot, added to a busy community group, starts answering strangers; which settings decide who can trigger it, in what order, and what do you change?

level: seniorimportance: should knowfreq 8%

answer

  1. groups are their own layer
  2. policy, allowlists, then mentions
  3. groupAllowFrom names the senders
  4. a reply is not a key
  5. audit the inbound access

basics

~20 s

Group access is checked as groupPolicy first, then group allowlists (rooms via groups, senders via groupAllowFrom), then mention gating. Strangers get answers when the policy is open or senders are unrestricted; restrict groupAllowFrom and keep requireMention on.

solid answer

~40 s

Groups have their own layer, separate from `dmPolicy`: `groupPolicy` (`allowlist` by default, `open`, `disabled`) is checked first, then the group allowlists — room keys under `channels.<channel>.groups` (or Discord guilds, Slack channels) and sender IDs in `groupAllowFrom` — and only then `requireMention` or `/activation`. Strangers get answers when the channel's `groupPolicy` is `open`, a room is admitted with no sender restriction, or mention gating is off. The fix is `groupPolicy: "allowlist"` with `groupAllowFrom` naming trusted senders, `requireMention: true`, or `groupPolicy: "disabled"`. A reply to the bot does not bypass `groupAllowFrom`, DM pairing approvals do not reach groups, and `openclaw security audit` flags open rooms that can reach exec-enabled agents.

code

json · 11 lines
json
{
  "channels": {
    "whatsapp": {
      "groupPolicy": "allowlist",
      "groupAllowFrom": ["+15551234567", "+15557654321"],
      "groups": {
        "[email protected]": { "requireMention": true }
      }
    }
  }
}

go deeper

for a junior

Remember that groups are controlled separately from direct messages, by groupPolicy and group allowlists, not by dmPolicy.

for a middle

Walk the order: groupPolicy, then room and sender allowlists, then mention gating, and name the key for each step on WhatsApp or Telegram.

for a senior

Diagnose the leak from config, fix it with groupAllowFrom and mention gating, verify with openclaw security audit, and know replies and DM approvals grant nothing in groups.

for a principal

Treat a loose group policy as an incident: everyone who can trigger the agent shares its tools, so pair access fixes with a review of what the agent can do.

## The scenario Someone adds the household's OpenClaw bot to a large community group. Within an hour it is answering questions from people nobody on the install knows — and every answer runs on the operator's model budget, with whatever tools the agent holds. The fix starts with knowing which settings decide who can trigger the bot in a group, and in what order. ## The group layer is separate from DMs Direct-message access (`dmPolicy`, `allowFrom`, pairing approvals) does not govern groups. Groups have their own layer, evaluated in this order: 1. **`groupPolicy`** — `allowlist` (the default), `open` or `disabled`. `disabled` drops every group message on that channel; `open` lets groups bypass the allowlists, though mention gating still applies. 2. **Group allowlists** — which rooms are accepted and which senders may trigger the bot inside them: `channels.<channel>.groups` keys for WhatsApp, Telegram and iMessage, `groupAllowFrom` for senders on WhatsApp, Telegram, Signal, iMessage and Microsoft Teams, `channels.discord.guilds` and `channels.slack.channels` for those platforms. 3. **Mention gating** — `requireMention` (on by default) and the owner-only `/activation` mode decide whether an admitted message starts a turn. Two facts keep coming up in incident reviews: - **A reply is not a key.** Replying to a bot message counts as an implicit mention, but it does **not** bypass `groupAllowFrom`. - **DM approvals stay in DMs.** A sender approved by pairing code is not thereby allowed to trigger the bot in groups. ## Finding what let strangers in Read the channel's config with the order above in mind. The usual culprits: - `groupPolicy: "open"` on that channel or on the account the group arrived on; - a room admitted with no sender restriction — on Discord, for example, an allowlisted guild channel with no `users` or `roles` — so any member counts as allowed; - `requireMention: false` for that room (or for `"*"`), or an owner having sent `/activation always`, so every message becomes a request. The quickest second opinion is `openclaw security audit`. Its inbound-access checks ask whether strangers can trigger the bot, and findings such as `security.exposure.open_channels_with_exec` flag shared or public rooms that can reach exec-enabled agents. ## The fix | Goal | Setting | | --- | --- | | No group replies on this channel | `groupPolicy: "disabled"` | | Only named rooms | `groups` keyed by room ID, no `"*"` key | | Only trusted people can trigger | `groupPolicy: "allowlist"` plus `groupAllowFrom` | | Answer only when addressed | `requireMention: true` | For a household bot that wandered into a community group, the usual answer is to restrict senders with `groupAllowFrom` (or an `accessGroup:<name>` reference shared across channels) and keep `requireMention: true`. Config changes apply to new messages; a turn already admitted keeps the policy it was admitted under. Two related controls are worth knowing even though they do not decide who triggers the bot: - **`contextVisibility`** — allowlists decide who can trigger the agent, not what the model reads. By default (`"all"`) quoted text, thread history and forwarded content from non-allowlisted members still reach the model as context; `"allowlist"` or `"allowlist_quote"` filters that supplemental context. - **Per-group tool limits and sandboxing** shrink what a triggered turn can do; they are a different layer from access. ## After the fix: a short checklist 1. Confirm the change took effect by mentioning the bot from an account that is not on `groupAllowFrom`; nothing should happen. 2. Re-run `openclaw security audit` (`--deep` adds best-effort live Gateway probes) and clear every inbound-access finding for that channel. 3. Review what the bot already said in the group: answers may have exposed memory or workspace content to strangers, and that cannot be recalled by a config change. 4. Check the other channels and accounts for the same pattern; each account can carry its own `groupPolicy` and `groupAllowFrom`. 5. Decide whether this agent belongs in groups at all; a separate, low-privilege agent for community rooms is often the cleaner answer. ## Why this is treated as a breach OpenClaw supports one trust boundary per Gateway: an operator or a mutually trusting team. Everyone who can trigger a tool-enabled agent shares its delegated tool authority. A bot that answers a community group has, in effect, handed its tools and its operator's memory to strangers, which is why reviewers treat a loose group policy as an incident, not a tuning problem.

  • After locking a Telegram group to groupAllowFrom, the operator can no longer trigger the bot either; what is the likely mistake?
    The entry is probably an `@username`. Telegram sender allowlists match numeric user IDs only; usernames do not match at runtime and the Gateway logs a warning. Negative chat IDs are also wrong there — they belong under `channels.telegram.groups`. Re-run setup to resolve usernames to IDs or write the numeric ID.
  • Strangers can no longer trigger the bot, but their quoted messages still show up in what the model reads; is that a bypass?
    No. Allowlists govern trigger authorization, not context visibility. By default `contextVisibility` is `"all"`, so quoted text, thread history and forwarded content are kept as received. Set it to `"allowlist"` (or `"allowlist_quote"` to keep one explicit quoted reply) per channel or account to filter supplemental context to allowlisted senders.

  • Replying to the bot's message lets any member trigger it despite groupAllowFrom.
  • A pairing approval for direct messages also covers that person in groups.
  • Turning on requireMention is enough to keep strangers out of a group.
  • dmPolicy pairing protects groups too, so no group setting is needed.
  • Blocking a sender as a trigger also hides their messages from the model's context.