How would you set OpenClaw's access policy for a bot serving a public community, and when would you refuse to share its Gateway?
answer
- one trust boundary per Gateway
- triggering means sharing the tools
- decide rooms by membership
- pairing does not scale
- public agent, separate Gateway
basics
~20 sDecide by what the agent can do: give a public bot minimal tools, mention-gated rooms and closed or allowlisted DMs. Because one Gateway is one trust boundary, run untrusted communities on a separate Gateway rather than beside private agents.
solid answer
~40 sI start from OpenClaw's trust model: one Gateway is one trust boundary, and everyone who can trigger a tool-enabled agent shares its tool authority. So a public community gets its own low-privilege agent, answering in rooms with `requireMention: true` and sender allowlists or `contextVisibility: "allowlist"` where strangers post, while DMs stay `disabled` or `allowlist` for moderators. `pairing` does not scale to a community, since every newcomer needs a human and pending requests cap at three per channel account; `open` with `"*"` is a deliberate last step for a bot stripped to what strangers may use. Owners stay in `commands.ownerAllowFrom`. If the community includes people I would not trust with the agent's tools or data, it gets a separate Gateway.
go deeper
Know that a bot open to strangers shares its tools with them, so public bots should be locked down more, not less.
Match each DM policy and group setting to a community posture, and explain why open needs the wildcard and pairing needs a human.
Combine access settings with tool limits, contextVisibility and the security audit, and keep command owners separate from chat access.
Own the boundary call: what the public agent may touch, whether it shares a Gateway with private data, and the spend an open community implies.
## The decision A team wants its OpenClaw assistant to serve a public community: a Discord server, a Telegram group anyone can join, maybe open DMs for questions. The access settings can express almost any posture. The real decision is **how open the bot should be given what the agent can do**, and whether a public bot belongs on the same Gateway as anything private at all. ## Start from the trust model OpenClaw supports **one trust boundary per Gateway**: a single operator or a mutually trusting team. It does not support one Gateway shared by mutually untrusted users. Two consequences shape every option below: - Everyone who can trigger a tool-enabled agent **shares that agent's delegated tool authority**. - Isolation features inside one Gateway — per-sender DM sessions, per-agent sandboxes, narrowed session visibility — reduce leakage between people who already trust each other. They do not make strangers safe neighbours of your private agent. So the first question is not "pairing or open?" but "what can this agent touch, and whose data shares its Gateway?" ## The options for direct messages | Posture | Settings | Fits | Cost | | --- | --- | --- | --- | | Closed | `dmPolicy: "disabled"` | Community help happens in rooms only | No private questions | | Curated | `dmPolicy: "allowlist"` plus `allowFrom` or an access group | Moderators, staff | List upkeep | | Approved | `dmPolicy: "pairing"` | Small, slow-growing communities | Operator approves every newcomer; 3 pending per channel account | | Public | `dmPolicy: "open"` with `allowFrom: ["*"]` | A deliberately public, low-privilege bot | Anyone spends your budget; the audit flags it | Pairing feels like the safe middle, but it does not scale to a community: each request needs a human, codes lapse after an hour, and the pending cap means newcomers are silently ignored when the queue is full. ## The options for rooms The docs' guidance is to **decide by membership, not by channel type**. A private room of people you trust is a normal place for `groupPolicy: "open"`. A room strangers can join or post in needs: - `requireMention: true`, so the bot answers only when addressed; - a sender allowlist (`groupAllowFrom`, Discord guild users or roles) when only some members should be able to trigger it; - `contextVisibility: "allowlist"` when strangers' quoted or forwarded text should not reach the model. Mention gating reduces noise and cost, but it is not access control: in an open room anyone who mentions the bot triggers it. ## What tips the decision 1. **Tools.** A public bot should hold only what a stranger may use. If the agent has shell, file, browser or automation tools, open access is the wrong answer; `openclaw security audit` raises checks such as `security.exposure.open_channels_with_exec` precisely for this combination. 2. **Data.** Memory, workspace files and other people's sessions sit behind the same Gateway. Session tools reach across the whole Gateway by default. 3. **Owners.** Keep administration separate from chat access: `commands.ownerAllowFrom` should name the operators, and nobody in the community should land there through a pairing approval. 4. **Budget.** Every admitted message is a model call. Open DMs and always-on rooms turn community size directly into spend. ## Questions to settle before launch A lead should be able to answer each of these in writing before the bot is announced: - **Who triggers it?** Name the DM policy, the `groupPolicy` per channel, and which rooms are mention-gated. - **What can it do?** List the tools the public agent holds, and confirm shell, file and automation tools are off or sandboxed. - **What can it read?** Decide whether strangers' quoted and forwarded text should reach the model (`contextVisibility`), and what memory and workspace the agent has. - **Who administers it?** Name the command owners and confirm no community member can become one. - **What does it cost?** Estimate model spend at the community's message volume, with and without mention gating. - **How is it reviewed?** Schedule `openclaw security audit` runs and decide who reads the findings. ## A defensible default For most teams the answer is a **separate public agent** — its own workspace, minimal tools and a sandbox (set up through multi-agent routing and the sandbox settings) — answering in mention-gated rooms, with DMs `disabled` or `allowlist` for moderators. If the community includes people the operators would not trust with the agent's tools or data, that agent belongs on **its own Gateway**, ideally on its own host or OS user. Open DMs are a last step taken on purpose, with the wildcard written in, after the agent has been stripped to what strangers may use.
- Does mention gating make groupPolicy open safe for a room strangers can join?No. `requireMention` decides when an admitted message triggers the agent, so it cuts noise and cost, but under `open` anyone who mentions the bot is admitted. For rooms strangers can post in, add a sender allowlist where only some members should trigger it, keep tools minimal, and consider `contextVisibility` to limit what their messages feed the model.
- Why keep commands.ownerAllowFrom separate from the community's chat access?Owners can run owner-only commands, change configuration and answer exec approval prompts; chat access only lets someone talk to the agent. Keeping owners in an explicit, short list means a community member admitted by pairing or allowlist never gains control of the install.
- Per-sender DM sessions make it safe to share one Gateway with strangers.
- Mention gating is enough access control for a room anyone can join.
- Pairing is the scalable choice for admitting a large community.
- A public bot can keep shell and file tools if DMs are on pairing.
- Open DMs work as soon as dmPolicy is set to open.