OpenClaw Matrix access control
Bot-to-bot rooms and the mentions mode, why bot-authored means another configured account, context visibility for supplemental room context, DM and room policies with allowlists, silencing DMs while rooms keep working, pairing with reused codes and reminders, and slash commands prefixed by the bot's mention
Matrix has no bot flag, no server-side allowlists and clients that tab-complete a mention in front of every command, and OpenClaw's access rules reflect all three. Here are the bot-to-bot settings, the context visibility control, the DM and room policies, pairing, and the mention-prefixed command path.
Bot-to-bot rooms
- Messages from other configured OpenClaw Matrix accounts are ignored by default, and the allow-bots setting opts into inter-agent traffic: true accepts messages from other configured bot accounts in allowed rooms and DMs, mentions accepts them in rooms only when they visibly mention this bot while DMs stay allowed, and a per-room allow-bots value overrides the account-level setting.
- Accepted configured-bot messages use the shared bot loop protection, configured under the channel defaults and overridden per account or per room.
- OpenClaw still ignores messages from the same Matrix user ID to avoid self-reply loops, and because Matrix has no native bot flag, bot-authored means sent by another configured Matrix account on this OpenClaw gateway.
- The docs' advice for shared rooms is strict room allowlists and mention requirements whenever bot-to-bot traffic is enabled.
This affects supplemental context visibility only, not whether the inbound message itself can trigger a reply.
Context visibility and policies
Matrix supports the shared context visibility control for supplemental room context such as fetched reply text, thread roots and pending history: all, the default, keeps supplemental context as received, allowlist filters it to senders allowed by the active room and user allowlist checks, and allowlist-quote behaves like allowlist while keeping one explicit quoted reply; this affects only what supplemental context is visible, never whether the inbound message can trigger a reply, which still comes from the group policy, the room map, the group sender list and the DM settings. The policy example sets the DM policy to allowlist with an admin sender and thread replies off, an allowlist group policy with the same admin as group sender, and a room entry with a mention requirement; to silence DMs entirely while rooms keep working you disable the DM block and keep the room policy and its sender list. Pairing for Matrix DMs uses the pairing list and approve commands, and when an unapproved user keeps messaging before approval OpenClaw reuses the same pending code and may send a reminder after a short cooldown instead of minting a new one.
Slash commands in rooms
- Slash commands such as new, reset, model, agents, session, acp and approve work directly in DMs.
- In rooms OpenClaw also recognises a command prefixed with the bot's own Matrix mention, so a mention followed by the new command triggers the command path without a custom mention regex, which keeps the bot responsive to the mention-then-command posts that Element and similar clients emit when a user tab-completes the bot before typing.
- Authorisation still applies: command senders must satisfy the same DM or room allowlist and owner policies as plain messages.
OpenClaw on Matrix is the channel post these rules belong to, and OpenClaw Matrix accounts and homeservers the multi-account and homeserver model the allow-bots definition depends on.
Defining a bot on a platform without one
Because Matrix cannot tell a bot from a person, OpenClaw draws the line at its own configuration: another account on the same gateway is a bot, everyone else is a user, and the loop guard sits behind that line. OpenClaw bot loop protection explains the guard, and OpenClaw Slack access control the same policy layers on Slack, where the platform does mark bots.
On Diali
Matrix is on Diali’s connectable list, alongside WhatsApp, Telegram, Discord, Slack, Mattermost, SMS and voice: the homeserver account and the room allowlist are yours, the Gateway is ours. Hosted OpenClaw on Diali is the assistant and Diali security describes the boundary that applies to each connected channel.
- Other configured accounts are bots; the same ID is never answered.
- Context visibility filters what is seen, not what triggers.
- A mention plus a command is still a command.
Stop reading about it, build one
Set up an agent, pick a channel, and have it working inside the app you already keep open.
