Intermediate7 min readAI Safety & Data Privacy

OpenClaw allowlists, pairing, and group mention security

Control who can reach OpenClaw, distinguish group activation from authorization, and test tool scope and revocation with an access record.

What you should be able to do

Identity first, scope second, model last. If strangers can DM a tool-enabled OpenClaw bot, you handed them a remote assistant with your permissions.

Saved only in this browser.
In this article

OpenClaw’s useful features are exactly why the security model matters. The Gateway can connect messaging channels to an agent that may run shell commands, read and write files, drive a browser, and send messages. A basic but high-impact failure path is an untrusted or compromised sender reaching an over-privileged agent; the controls below reduce that exposure alongside conventional host, dependency, credential, and network security.

OpenClaw’s own ordering is the right one (security docs):

  1. Identity first: who can talk to the bot (DM pairing / allowlists / explicit open).
  2. Scope next: where it can act (groups, tools, sandbox, device permissions).
  3. Model last: assume the model can be manipulated; limit blast radius.

This article assumes you already installed the gateway (personal gateway setup).

dmPolicy="open" and groupPolicy="open" are last-resort settings. Prefer pairing and allowlists unless you fully trust every participant who can reach the bot. Tool-enabled open DMs are a public remote-control surface.

Every approved sender can become a path into whatever the agent can read: mail, files, browser sessions, customer data in tools. Approve people the way you would approve SSH keys, sparingly, revocably, and with a named reason.

Trust model in one paragraph

OpenClaw documents a personal assistant trust model: one trusted operator boundary per gateway. It is not a hostile multi-tenant boundary. If mutually untrusted users can message one tool-enabled agent, they share that agent’s delegated authority. Split gateways (and ideally OS users/hosts) when trust boundaries differ.

Authenticated Gateway access is operator-level. sessionKey is a routing selector, not an authorisation token. Do not invent a false sense of per-user tenancy on a shared personal gateway.

DM access: pairing, allowlist, open, disabled

Channels implementing this access model expose the following policies; check the specific channel’s current defaults and exceptions:

PolicyBehaviour
pairingDefault. Unknown senders get a pairing code; ignored until approved. Codes expire (documented as 1 hour).
allowlistUnknown senders blocked; no pairing handshake.
openAnyone can DM; requires explicit allowlist opt-in including "*".
disabledInbound DMs ignored.

Approve deliberately:

openclaw pairing list <channel>
openclaw pairing approve <channel> <code>

Details: pairing.

Practical rule for personal use: keep pairing or strict allowlist. Approve only your own accounts and, at most, a tiny set of co-operators who share the trust boundary.

Two allowlist layers

1. DM allowlist (allowFrom / channel-specific equivalents)

Who may DM the bot. Current OpenClaw stores pending and approved sender rows in ~/.openclaw/state/openclaw.sqlite, keyed by channel and account. Older credential JSON files are legacy migration inputs, not the current authorization source (pairing state documentation). Treat the SQLite file as sensitive authorization state and back it up consistently with the gateway state.

2. Group allowlist

Which groups/channels/guilds the bot accepts at all; plus who may trigger it inside a group (groupPolicy="allowlist" + groupAllowFrom on supported channels).

Check order matters: group policy/allowlists first, then mention/reply activation. Replying to a bot message does not bypass groupAllowFrom.

Example shape (adapt stable sender IDs and agent naming to the current channel schema):

{
  channels: {
    whatsapp: {
      dmPolicy: 'allowlist',
      allowFrom: ['+15555550123'],
      groupPolicy: 'allowlist',
      groupAllowFrom: ['+15555550123'],
      groups: { '<approved-group-id>': { requireMention: true } },
    },
  },
  agents: {
    entries: { main: { default: true, groupChat: { mentionPatterns: ['@openclaw'] } } },
  },
}

Customise mention patterns so requireMention matches your bot names, not a generic string everyone types by accident.

Group mentions are a safety control

In busy groups, an always-listening agent will:

  • Burn tokens on noise
  • Act on prompt injection buried in jokes, pasted logs, or linked pages
  • Leak context across people who share a room but not a trust boundary

Require mention (or equivalent activation) unless the room is a dedicated agent channel with a locked membership list.

Even with mention gating, untrusted content the bot fetches (web pages, attachments, emails) can carry instructions. Prompt injection is not solved by system prompts. Hard controls are tool policy, approvals, sandboxing, and who can talk to the bot at all.

Prompt injection does not require public DMs. If only you can message the bot but the bot reads the open web or shared inboxes, adversarial text can still arrive inside tool results.

Session isolation for multi-person DMs

Default behaviour can route DMs into a main session for continuity. If more than one person can DM the bot, isolate sessions:

{ session: { dmScope: 'per-channel-peer' } }

Without isolation, one person’s context can bleed into another’s turn. That is both a privacy bug and a prompt-injection amplifier.

Network exposure

Before you celebrate remote chat:

  • Prefer gateway.bind: "loopback" for personal installs
  • Require gateway auth tokens for any non-loopback access
  • Treat Tailscale Serve/Funnel and reverse proxies as exposure events; walk the exposure runbook if you use one
  • Never publish the Control UI (:18789) or model ports to the public internet without auth

Run:

openclaw security audit
openclaw security audit --deep
openclaw security audit --fix   # narrow safe remediations only

Triage order from the docs: lock open DMs/groups with tools first, then public network exposure, then browser control remotes, then file permissions, then plugins.

Hardened baseline (starting point)

Use private bind, authenticated gateway access, narrow messaging tools and explicit sender/group authorization as the initial scope. Keep unnecessary filesystem, runtime, browser and elevated capabilities unavailable. Mention rules control activation; they do not grant permission or make fetched content trusted.

Current exec documentation names tools.exec.mode as the canonical persisted policy knob. deny blocks exec; allowlist permits listed commands without asking for misses; ask sends misses for approval. Effective host approvals and sandbox routing also matter. Inspect the resolved policy and test a denied command instead of relying on an obsolete security/ask configuration fragment. A full-permission host path is unsuitable merely because pairing succeeded.

An ordered group access sequence checks room and sender authorisation before mention activation and independent tool policy; an admitted sender’s malicious README still cannot grant private-file access or sending rights.
Group membership and sender policy precede mention activation. Admission does not make fetched content trusted or grant a tool permission, and session routing is not per-user tenant isolation. Open the full-size diagram.

Apply the same boundary to workplace channels

Check workspace, channel and sender permissions separately in the relevant channel documentation. A trusted operator in one workspace does not automatically authorize access to all its rooms or their history. Record the approved audience, data sources, retention and who can revoke access. Use separate gateways and credentials where people do not share a trust boundary.

Test the boundary with an invented incident

Suppose a permitted group member pastes a README that tells the agent to read a private directory and send its contents elsewhere. Mention gating may reduce unsolicited turns, but it does not make that README trusted. A successful control outcome is that the agent lacks the read/send capability or the enforced policy rejects the attempt. A polite model refusal alone does not establish that boundary.

Use an invented file and a destination you control in an isolated test. Retain which identity was admitted, which content reached the model, which tool was attempted and which enforcement layer stopped it. If the action succeeds, remove that capability before reconnecting real data. Do not test this with personal documents or a live external recipient.

Revocation and offboarding

Build a tiny runbook:

  1. Remove every applicable grant: configured sender/group allowlists, persisted pairing approvals, command-owner privileges and account-specific overrides. Use supported CLI/UI tools to verify canonical authorization state; do not edit SQLite rows directly. Removing one path does not revoke access through another.
  2. Rotate channel bot tokens if the person ever saw them.
  3. Review ~/.openclaw sessions for sensitive remnants.
  4. Re-run openclaw security audit.
  5. If they had node pairing, unpair the device.
  6. Retry access from the revoked identity and verify rejection. Investigate already-admitted turns separately; changing access for future messages is not proof that an in-flight task stopped.

Treat this like recovering an SSH key, not like unfollowing a bot.

Operator checklist

  • DM policy is pairing or strict allowlist
  • allowFrom contains only trusted identities
  • Groups require mention; group allowlists set
  • dmScope isolated if multiple DM senders exist
  • Gateway loopback (or authenticated remote only)
  • Audit findings resolved or explicitly scoped, with a denied-access observation retained
  • High-risk tools off until identity is locked
  • State dir permissions not world-readable
  • Offboarding steps documented for your channels

Revoke pairing and allowlist entries when a phone number, Slack user, or contractor engagement ends. Forgotten allowlist rows are standing invitations. Apply the justified retention and deletion policy to session history and any exported copies. Preserve evidence where a valid requirement remains; exporting a record does not resolve an expired retention basis.

Keep the access and revocation record with the configuration. Access controls decide who can start work; tool policy and periodic-turn controls limit what that work can do. Neither layer makes fetched content trustworthy.

Read next

Continue through the same learning path with the next practical articles.

Take it further

Hand-picked external courses that go deeper on this topic.

AWS Skill Builder

AWS Security: Securing Generative AI on AWS

AWS Training and Certification

A cloud-vendor-specific complement to the Macquarie specialization: AWS's own Generative AI Security Scoping Matrix, OWASP Top 10 for LLMs, and MITRE ATLAS, walked through governance, legal, and compliance controls for five different AI deployment scopes — from consumer apps to self-trained models. Not GDPR-specific, but a genuinely practical advanced pick for teams whose AI workloads actually run on AWS and need concrete data-governance and compliance controls, not just theory.

Advanced~2 hours · self-paced (9 modules)Verified 35 days ago
Coursera · Macquarie University

Cyber Security: Data, Privacy and AI Security

Macquarie University Cyber Security Hub faculty

An advanced pick for professionals responsible for both GDPR compliance and AI security: a three-course specialization from Macquarie University's Cyber Security Hub that goes from GDPR/CCPA fundamentals and privacy-by-design, through privacy impact assessments, to a dedicated third course on securing AI systems against adversarial attacks and model leakage. It genuinely bridges the two rather than treating them as separate topics.

Advanced~47 hours · self-paced (3-course specialization)Verified 35 days ago
EU Digital Skills & Jobs Platform · CyberSuite

Secure AI Adoption for SMEs: Cybersecurity and the EU AI Act

CyberSuite

The rare AI Act course written for the companies the Act actually reaches: SMEs adopting AI, not the labs building it. Hosted on the European Commission's own skills platform, it pairs the legal side — roles, obligations, risk classification — with the security side (prompt injection, data leakage, supplier due diligence) that most compliance courses skip. For an Estonian SME deploying AI, this is the practical starting point.

Advanced~15 hours · self-pacedVerified 35 days ago

See all courses for AI Safety & Data Privacy