@mutirolabs/openclaw-brain 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/LICENSE +15 -0
- package/README.md +266 -0
- package/docs/guides/manage-allowlist.md +184 -0
- package/docs/guides/use-openclaw-as-brain.md +401 -0
- package/index.ts +21 -0
- package/openclaw.plugin.json +47 -0
- package/package.json +79 -0
- package/src/actions.ts +53 -0
- package/src/agent-tools.ts +640 -0
- package/src/bridge-client.ts +236 -0
- package/src/bridge-messages.ts +307 -0
- package/src/bridge-protocol.ts +77 -0
- package/src/bridge-session.ts +433 -0
- package/src/channel.runtime.ts +454 -0
- package/src/channel.ts +130 -0
- package/src/config.ts +100 -0
- package/src/inbound.ts +151 -0
- package/src/live-snapshot.ts +210 -0
- package/src/outbound.ts +326 -0
- package/src/setup-surface.ts +281 -0
- package/src/signal-forwarder.ts +153 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.1.0] - 2026-04-18
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Initial OpenClaw channel plugin for the Mutiro `chatbridge` protocol.
|
|
15
|
+
- NDJSON envelope codec ported from `pi-brain`.
|
|
16
|
+
- Subprocess lifecycle for `mutiro agent host --mode=bridge`, one per configured account.
|
|
17
|
+
- Inbound pipeline: `message.observed` → OpenClaw reply dispatch.
|
|
18
|
+
- Outbound surface: `message.send`, `message.send_voice`, `message.react`,
|
|
19
|
+
`message.forward`, `media.upload`, `signal.emit`, `recall.search`, `recall.get`,
|
|
20
|
+
`turn.end`.
|
|
21
|
+
- Live call handoff via `task.request` and `session.snapshot`.
|
|
22
|
+
- Agent tools: `mutiro_send_voice_message`, `mutiro_send_card`, `mutiro_forward_message`.
|
|
23
|
+
- Signal forwarder: 26-entry OpenClaw-tool → Mutiro signal-enum map with
|
|
24
|
+
rich intent labels from `onItemEvent`.
|
|
25
|
+
- Channel setup wizard: detects the Mutiro CLI, validates the agent directory,
|
|
26
|
+
runs `mutiro auth whoami`, and writes `channels.mutiro.accounts.<id>.agentDir`.
|
|
27
|
+
Launched via `openclaw channels add` (no flags — passing `--channel mutiro`
|
|
28
|
+
falls through to the non-interactive adapter and never reaches the wizard).
|
|
29
|
+
- Host stderr (slog JSON) wrapped into the OpenClaw channel logger so log
|
|
30
|
+
output matches the rest of the gateway stream.
|
|
31
|
+
- `docs/guides/use-openclaw-as-brain.md` — end-to-end setup walkthrough.
|
|
32
|
+
- `docs/guides/manage-allowlist.md` — paste-into-AI prompt for managing the
|
|
33
|
+
Mutiro server-side allowlist; the setup wizard's completion note points here
|
|
34
|
+
so users know the Mutiro and OpenClaw allowlist layers are separate.
|
|
35
|
+
- README + setup guide document `--dangerously-force-unsafe-install`: the
|
|
36
|
+
plugin legitimately spawns `mutiro agent host --mode=bridge`, so OpenClaw's
|
|
37
|
+
install scanner correctly flags `child_process` usage and requires the flag
|
|
38
|
+
as explicit acknowledgement. Install instructions show the flag with a note
|
|
39
|
+
telling users to verify the source before passing it.
|
|
40
|
+
- `@sinclair/typebox` declared as a runtime dependency so OpenClaw's
|
|
41
|
+
`npm install --omit=dev` in the installed plugin directory picks it up;
|
|
42
|
+
without this, plugin registration fails with "Cannot find module
|
|
43
|
+
'@sinclair/typebox'" when loading `src/agent-tools.ts`.
|
|
44
|
+
- README Prerequisites section: checklist of Mutiro-side state the plugin
|
|
45
|
+
requires (CLI installed, signed in, agent created, built-in brain stopped)
|
|
46
|
+
with concrete fix commands, plus the paste-into-AI prompt as an alternative
|
|
47
|
+
for users who'd rather have their AI assistant drive the setup.
|
|
48
|
+
|
|
49
|
+
[Unreleased]: https://github.com/mutirolabs/openclaw-brain/compare/v0.1.0...HEAD
|
|
50
|
+
[0.1.0]: https://github.com/mutirolabs/openclaw-brain/releases/tag/v0.1.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mutiro Labs
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
# Mutiro OpenClaw Channel Reference
|
|
2
|
+
|
|
3
|
+
Use this repo if you want to plug [OpenClaw](https://openclaw.ai) into a Mutiro agent over `chatbridge`, so OpenClaw becomes the external brain and Mutiro becomes just another OpenClaw channel.
|
|
4
|
+
|
|
5
|
+
This is the OpenClaw-shaped sibling of [`../pi-brain`](../pi-brain). The bridge codec is a faithful port of `mutiro-pi-bridge.ts`; the brain side is structured as an OpenClaw third-party channel plugin instead of a one-off standalone adapter.
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
This plugin assumes you already have a working Mutiro agent. Before the Quick
|
|
10
|
+
Start below, confirm each of these passes:
|
|
11
|
+
|
|
12
|
+
| Check | Fix if it fails |
|
|
13
|
+
|-------|-----------------|
|
|
14
|
+
| `mutiro version` prints a version | `curl -sSL https://mutiro.com/downloads/install.sh \| bash` |
|
|
15
|
+
| `mutiro auth whoami` prints your username | sign up: `mutiro auth signup <email> <username> "<Display Name>"` — or log in: `mutiro auth login <email>` |
|
|
16
|
+
| `mutiro agents list` shows at least one agent you own | `mutiro agents create <username> "<Display>" --engine genie --bio "<short bio>"` |
|
|
17
|
+
| The built-in Mutiro brain for that agent is **not** running | `mutiro agent doctor`, and stop any `mutiro agent run` / `mutiro start` process for that agent |
|
|
18
|
+
|
|
19
|
+
Want an AI assistant to drive you through those steps instead? Paste this into
|
|
20
|
+
Claude, Cursor, or Windsurf:
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
Read this page from the Mutiro docs: https://mutiro.com/docs/guides/create-agent.md and help me create an agent step by step.
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Canonical reference: [Mutiro create-agent guide](https://www.mutiro.com/docs/guides/create-agent.md).
|
|
27
|
+
|
|
28
|
+
> **Two brains, one agent = trouble.** Mutiro ships its own built-in brain. If
|
|
29
|
+
> you leave it running, it will race OpenClaw for the same conversations and
|
|
30
|
+
> both will reply (or neither will, depending on ordering). Stop it before
|
|
31
|
+
> starting the OpenClaw gateway.
|
|
32
|
+
|
|
33
|
+
## Quick Start
|
|
34
|
+
|
|
35
|
+
### 1. Install this plugin into OpenClaw
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
openclaw plugins install --dangerously-force-unsafe-install @mutirolabs/openclaw-brain
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Or, for local development:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Skip node_modules if you've run `npm install` here — the install scanner
|
|
45
|
+
# walks the source tree and caps at 10k directories.
|
|
46
|
+
rm -rf node_modules
|
|
47
|
+
openclaw plugins install --dangerously-force-unsafe-install "file:$(pwd)"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
> **Why the `--dangerously-force-unsafe-install` flag?**
|
|
51
|
+
> This plugin legitimately spawns `mutiro agent host --mode=bridge` as a
|
|
52
|
+
> subprocess — that is the entire point of the `chatbridge` adapter. OpenClaw's
|
|
53
|
+
> install scanner correctly flags any plugin that uses `child_process` as
|
|
54
|
+
> sensitive, and requires this flag as an explicit acknowledgement. Before you
|
|
55
|
+
> pass it, **confirm you are installing from the signed [mutirolabs/openclaw-brain](https://github.com/mutirolabs/openclaw-brain)
|
|
56
|
+
> source** (or the `@mutirolabs/openclaw-brain` npm package). Review the
|
|
57
|
+
> `spawn` call at [`src/bridge-client.ts`](./src/bridge-client.ts) if you want
|
|
58
|
+
> to see exactly what the plugin executes.
|
|
59
|
+
|
|
60
|
+
### 2. Configure the channel
|
|
61
|
+
|
|
62
|
+
The plugin ships a setup wizard. Run the bare command (no `--channel` flag —
|
|
63
|
+
passing one skips the wizard and falls through to the non-interactive adapter):
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
openclaw channels add
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Pick `mutiro` from the list. The wizard will:
|
|
70
|
+
|
|
71
|
+
- detect the `mutiro` CLI (and point you at the install command if missing)
|
|
72
|
+
- ask for your Mutiro agent directory (the folder containing `.mutiro-agent.yaml`)
|
|
73
|
+
- validate the directory and run `mutiro auth whoami`
|
|
74
|
+
- remind you to stop the built-in Mutiro brain before starting the gateway
|
|
75
|
+
|
|
76
|
+
Or set the config manually:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
openclaw config set channels.mutiro.accounts.default.agentDir /path/to/agent-directory
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 3. Run the OpenClaw gateway
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
openclaw gateway run
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Or use the shortcut:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
./run-brain.sh /path/to/agent-directory
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### 4. Talk to your agent
|
|
95
|
+
|
|
96
|
+
Once the gateway is running, your agent is reachable from any Mutiro surface:
|
|
97
|
+
|
|
98
|
+
- **Web app:** [https://app.mutiro.com](https://app.mutiro.com)
|
|
99
|
+
- **CLI chat:** `mutiro chat`
|
|
100
|
+
- **Mobile:** Mutiro app on iOS / Android
|
|
101
|
+
- **Desktop:** Mutiro desktop app on macOS / Windows / Linux
|
|
102
|
+
|
|
103
|
+
For a quick shell smoke test:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
mutiro user message send <agent-username> "Hello! Who are you?"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 5. Allow Mutiro-specific agent tools
|
|
110
|
+
|
|
111
|
+
To let the OpenClaw agent send voice messages, interactive cards, or forward
|
|
112
|
+
messages through Mutiro, add `mutiro*` to your agent's `tools.alsoAllow`:
|
|
113
|
+
|
|
114
|
+
```yaml
|
|
115
|
+
tools:
|
|
116
|
+
profile: messaging
|
|
117
|
+
alsoAllow:
|
|
118
|
+
- "mutiro*"
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
See [`docs/guides/use-openclaw-as-brain.md`](./docs/guides/use-openclaw-as-brain.md)
|
|
122
|
+
for a full walkthrough.
|
|
123
|
+
|
|
124
|
+
### 6. Share the agent with other users
|
|
125
|
+
|
|
126
|
+
Mutiro has a **server-side allowlist** that's separate from OpenClaw's own
|
|
127
|
+
`allowFrom`. Denied users are blocked at the Mutiro server — their messages
|
|
128
|
+
never reach OpenClaw at all. Manage it with the `mutiro` CLI:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
mutiro agents allowlist get <agent-username>
|
|
132
|
+
mutiro agents allow <agent-username> <username>
|
|
133
|
+
mutiro agents deny <agent-username> <username>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
See [`docs/guides/manage-allowlist.md`](./docs/guides/manage-allowlist.md) for
|
|
137
|
+
the full command reference and a paste-into-AI prompt you can hand to your
|
|
138
|
+
assistant when you want help managing sharing and security posture.
|
|
139
|
+
|
|
140
|
+
## What This Repo Is
|
|
141
|
+
|
|
142
|
+
A small reference package showing how to plug OpenClaw into Mutiro `chatbridge` as a channel plugin. Pi is a good reference for swapping Mutiro's brain with a standalone runtime; this one shows the same shape routed through OpenClaw's channel plugin contract.
|
|
143
|
+
|
|
144
|
+
- `mutiro agent host --mode=bridge` is spawned by the plugin, one process per configured Mutiro agent
|
|
145
|
+
- NDJSON envelope traffic is translated into OpenClaw inbound messages and outbound send/react/forward actions
|
|
146
|
+
- one subprocess per Mutiro agent, long-lived across conversations
|
|
147
|
+
- all outbound chat actions go back through the bridge
|
|
148
|
+
|
|
149
|
+
## What Is Here
|
|
150
|
+
|
|
151
|
+
- `index.ts` — plugin entry via `defineBundledChannelEntry`
|
|
152
|
+
- `src/bridge-protocol.ts` — NDJSON envelope constants and `@type` URLs
|
|
153
|
+
- `src/bridge-messages.ts` — normalized message extraction and observed-turn assembly
|
|
154
|
+
- `src/bridge-client.ts` — NDJSON envelope codec plus host subprocess spawn
|
|
155
|
+
- `src/bridge-session.ts` — per-conversation observed/task/snapshot handlers
|
|
156
|
+
- `src/inbound.ts` — bridge observed message → OpenClaw inbound envelope
|
|
157
|
+
- `src/outbound.ts` — OpenClaw outbound adapter → `message.send` / `message.react` / `message.forward`
|
|
158
|
+
- `src/channel.ts` — Mutiro channel plugin definition
|
|
159
|
+
- `src/channel.runtime.ts` — runtime barrel consumed by the plugin entry
|
|
160
|
+
- `src/setup-surface.ts` — setup wizard driven by `openclaw channels add` (pick `mutiro` from the list)
|
|
161
|
+
- `src/agent-tools.ts` — `mutiro_send_voice_message`, `mutiro_send_card`, `mutiro_forward_message`
|
|
162
|
+
- `src/signal-forwarder.ts` — OpenClaw tool events → Mutiro `signal.emit` (26-entry map)
|
|
163
|
+
- `src/live-snapshot.ts` — `session.snapshot` + `task.request` handlers for live call handoff
|
|
164
|
+
- `openclaw.plugin.json` — channel manifest
|
|
165
|
+
- `run-brain.sh` — convenience launcher that boots OpenClaw's gateway against a Mutiro agent directory
|
|
166
|
+
- `docs/guides/use-openclaw-as-brain.md` — end-to-end setup guide
|
|
167
|
+
- `docs/guides/manage-allowlist.md` — paste-into-AI guide for Mutiro's server-side allowlist
|
|
168
|
+
|
|
169
|
+
## Why This Exists
|
|
170
|
+
|
|
171
|
+
Use this folder as a reference if you want to consume Mutiro's chatbridge from OpenClaw, or another gateway-shaped runtime that already owns its own channel/plugin contract.
|
|
172
|
+
|
|
173
|
+
It shows how to:
|
|
174
|
+
|
|
175
|
+
1. Spawn `mutiro agent host --mode=bridge` from inside an OpenClaw channel plugin
|
|
176
|
+
2. Complete `ready → session.initialize → subscription.set`
|
|
177
|
+
3. Receive `message.observed` and turn it into an OpenClaw inbound envelope
|
|
178
|
+
4. Route OpenClaw outbound replies through bridge-local commands (`message.send`, `message.react`, `message.forward`, `media.upload`, `signal.emit`, `recall.search/get`)
|
|
179
|
+
5. Finish turns with `turn.end`
|
|
180
|
+
|
|
181
|
+
## Important Bridge Notes
|
|
182
|
+
|
|
183
|
+
- `message.send` is a bridge-local command, not a raw backend `SendToConversationRequest`
|
|
184
|
+
- the portable payload type is `mutiro.chatbridge.ChatBridgeSendMessageCommand`
|
|
185
|
+
- `message.send_voice` is also bridge-local and keeps TTS inside the host
|
|
186
|
+
- this reference usually replies by `conversation_id`
|
|
187
|
+
- the bridge also supports `to_username` for direct sends
|
|
188
|
+
|
|
189
|
+
## Adapter Model
|
|
190
|
+
|
|
191
|
+
The plugin process is an OpenClaw channel. It:
|
|
192
|
+
|
|
193
|
+
- spawns `mutiro agent host --mode=bridge` (one per configured Mutiro agent directory)
|
|
194
|
+
- reads and writes bridge envelopes on stdio
|
|
195
|
+
- delivers `message.observed` payloads as OpenClaw inbound messages
|
|
196
|
+
- exposes outbound send/react/forward through the standard OpenClaw `ChannelOutboundAdapter`
|
|
197
|
+
|
|
198
|
+
OpenClaw's agent runtime owns the brain layer. The plugin does not talk to Mutiro SDKs directly; everything portable flows through the chatbridge envelope.
|
|
199
|
+
|
|
200
|
+
## Supported Bridge Operations
|
|
201
|
+
|
|
202
|
+
This adapter exercises:
|
|
203
|
+
|
|
204
|
+
- `message.send`
|
|
205
|
+
- `message.send_voice`
|
|
206
|
+
- `message.react`
|
|
207
|
+
- `message.forward`
|
|
208
|
+
- `media.upload`
|
|
209
|
+
- `signal.emit`
|
|
210
|
+
- `turn.end`
|
|
211
|
+
- `recall.search`
|
|
212
|
+
- `recall.get`
|
|
213
|
+
|
|
214
|
+
## Session Model
|
|
215
|
+
|
|
216
|
+
- one Mutiro `conversation_id` maps to one OpenClaw conversation binding
|
|
217
|
+
- later turns in the same conversation reuse the same OpenClaw session, just as pi-brain reuses a Pi session
|
|
218
|
+
- `session.snapshot` is answered from recent messages cached per-conversation in the plugin
|
|
219
|
+
|
|
220
|
+
OpenClaw already owns transcript continuity across turns, so the plugin keeps its own cache narrow — just enough to answer `session.snapshot` for bridge consumers.
|
|
221
|
+
|
|
222
|
+
## Handshake
|
|
223
|
+
|
|
224
|
+
Startup flow:
|
|
225
|
+
|
|
226
|
+
1. host sends `ready`
|
|
227
|
+
2. plugin sends `session.initialize`
|
|
228
|
+
3. plugin sends `subscription.set`
|
|
229
|
+
4. host starts delivering `message.observed`
|
|
230
|
+
|
|
231
|
+
Per turn:
|
|
232
|
+
|
|
233
|
+
1. plugin acknowledges `message.observed`
|
|
234
|
+
2. plugin dispatches the observed envelope into OpenClaw's inbound pipeline
|
|
235
|
+
3. OpenClaw's reply-dispatch drives zero or more outbound bridge operations
|
|
236
|
+
4. plugin sends `turn.end`
|
|
237
|
+
|
|
238
|
+
## Debugging
|
|
239
|
+
|
|
240
|
+
Useful signals while integrating:
|
|
241
|
+
|
|
242
|
+
- `Handshake failed`
|
|
243
|
+
Bridge startup or negotiation problem.
|
|
244
|
+
- `Host error`
|
|
245
|
+
A bridge request failed outside a pending request path.
|
|
246
|
+
- `outbound bridge call failed`
|
|
247
|
+
The plugin reached the bridge and got a real host-side error.
|
|
248
|
+
|
|
249
|
+
## Type Checking
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
npm run check
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
It runs with `skipLibCheck` because the OpenClaw plugin SDK's dependency tree includes external type issues that are not specific to this reference code.
|
|
256
|
+
|
|
257
|
+
## What To Copy
|
|
258
|
+
|
|
259
|
+
If you are integrating another gateway-shaped runtime, the most useful pieces to copy are:
|
|
260
|
+
|
|
261
|
+
- bridge handshake flow (`src/bridge-session.ts` + `src/bridge-client.ts`)
|
|
262
|
+
- pending-request correlation by `request_id`
|
|
263
|
+
- `message.observed` acknowledgement behavior (ack delivery now, reply later)
|
|
264
|
+
- per-conversation recent-message cache for `session.snapshot`
|
|
265
|
+
- outbound operation wrappers (`src/outbound.ts`)
|
|
266
|
+
- final `turn.end` behavior
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Manage Who Can Message Your Mutiro Agent
|
|
2
|
+
|
|
3
|
+
When OpenClaw is the brain, there are **two allowlists** at play and they do different things:
|
|
4
|
+
|
|
5
|
+
| Layer | What it gates | Where it lives | How to manage |
|
|
6
|
+
|-------|--------------|----------------|---------------|
|
|
7
|
+
| **Mutiro backend allowlist** | Whether a user's message even reaches your agent. Denied users are blocked at the server — the message never hits the bridge. | Mutiro servers (per agent) | `mutiro agents allowlist …` |
|
|
8
|
+
| **OpenClaw `allowFrom`** | Whether your OpenClaw agent *responds* to a message that did reach it. | Your local OpenClaw config | `openclaw config set channels.mutiro.accounts.<id>.allowFrom …` |
|
|
9
|
+
|
|
10
|
+
If the Mutiro allowlist denies a user, the OpenClaw `allowFrom` never even gets consulted. Tighten whichever layer gives you the semantics you want, but **do not skip the Mutiro layer** — it is the only one that actually prevents delivery.
|
|
11
|
+
|
|
12
|
+
Copy the prompt below into your AI assistant (Claude, Cursor, Windsurf, or similar) when you want to share or restrict your agent.
|
|
13
|
+
|
|
14
|
+
## The Prompt
|
|
15
|
+
|
|
16
|
+
````
|
|
17
|
+
You are helping me manage who can message my Mutiro agent. My agent is driven
|
|
18
|
+
by OpenClaw over `chatbridge`, so there are two allowlists. The Mutiro backend
|
|
19
|
+
allowlist is the authoritative gate — denied users are blocked at the server.
|
|
20
|
+
The OpenClaw allowFrom is a second filter on top.
|
|
21
|
+
|
|
22
|
+
Be proactive — inspect current state before changing anything, and confirm
|
|
23
|
+
destructive changes (especially `set` calls that replace the whole list).
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
### Step 1: Figure out which agent
|
|
28
|
+
|
|
29
|
+
If I haven't told you the agent username, ask me or check what agents I own:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
mutiro agents list
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Agent usernames end in a Mutiro-assigned suffix (e.g., `my_bot_X1W1`). Use the
|
|
36
|
+
full username in every command below.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
### Step 2: Show the current Mutiro allowlist
|
|
41
|
+
|
|
42
|
+
Always start by inspecting current state:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
mutiro agents allowlist get <agent-username>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Output tells you one of three states:
|
|
49
|
+
|
|
50
|
+
- Only the owner (me) — no one else can message the agent yet.
|
|
51
|
+
- A specific list of usernames — only those users plus me.
|
|
52
|
+
- `*` — open to everyone on Mutiro.
|
|
53
|
+
|
|
54
|
+
Report it back to me before changing anything.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
### Step 3: Make the change I asked for
|
|
59
|
+
|
|
60
|
+
Map the request to the right command. Do not guess — match exactly:
|
|
61
|
+
|
|
62
|
+
**Add one user:**
|
|
63
|
+
```bash
|
|
64
|
+
mutiro agents allowlist add <agent-username> <username>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Remove one user:**
|
|
68
|
+
```bash
|
|
69
|
+
mutiro agents allowlist remove <agent-username> <username>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Shorthand for a single allow (same as `allowlist add`):**
|
|
73
|
+
```bash
|
|
74
|
+
mutiro agents allow <agent-username> <username>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Shorthand for a single deny (same as `allowlist remove`):**
|
|
78
|
+
```bash
|
|
79
|
+
mutiro agents deny <agent-username> <username>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Replace the entire list** (destructive — confirm with me first):
|
|
83
|
+
```bash
|
|
84
|
+
mutiro agents allowlist set <agent-username> alice bob charlie
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Open to everyone** (destructive — confirm security posture first, see Step 5):
|
|
88
|
+
```bash
|
|
89
|
+
mutiro agents allowlist set <agent-username> "*"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Reset to owner-only** (removes everyone else):
|
|
93
|
+
```bash
|
|
94
|
+
mutiro agents allowlist set <agent-username>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### Step 4: Verify
|
|
100
|
+
|
|
101
|
+
After any change, re-run `get` and tell me the new state:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
mutiro agents allowlist get <agent-username>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
### Step 5: Security Check (especially for `set "*"` or large additions)
|
|
110
|
+
|
|
111
|
+
Opening the agent up changes its threat model. Before you run `set "*"` or add
|
|
112
|
+
more than a couple of users, walk me through this:
|
|
113
|
+
|
|
114
|
+
**Exposure × blast radius.** Higher exposure + more powerful tools = more risk.
|
|
115
|
+
|
|
116
|
+
- What tools does my OpenClaw agent have? Check the agent config. Tools like
|
|
117
|
+
`writeFile`, `memory_write`, `web_fetch`, or anything from the "Dangerous"
|
|
118
|
+
group (`bash`, `process`, `code`) multiply the blast radius of any prompt
|
|
119
|
+
injection.
|
|
120
|
+
- Is the agent set up with per-user workspace isolation? Look for
|
|
121
|
+
`workspace: "./${USERNAME}"` in `.mutiro-agent.yaml`. If everyone shares a
|
|
122
|
+
workspace, one user can poison files for everyone.
|
|
123
|
+
- Does the agent write to memory? `memory_write` persists across ALL future
|
|
124
|
+
conversations, so a single injection becomes permanent.
|
|
125
|
+
|
|
126
|
+
If any of those look risky for open access, suggest tightening before setting
|
|
127
|
+
`*` — either drop powerful tools, switch to per-user workspace, or keep the
|
|
128
|
+
allowlist narrow.
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
### Step 6: Second layer (optional)
|
|
133
|
+
|
|
134
|
+
If I want a second filter — for example, "Alice can message the agent at the
|
|
135
|
+
server level but I want the OpenClaw agent to ignore her for now" — we can add
|
|
136
|
+
her to OpenClaw's own `allowFrom` denylist or set a stricter OpenClaw DM
|
|
137
|
+
policy. Ask me if that's needed; usually the Mutiro layer is enough.
|
|
138
|
+
|
|
139
|
+
OpenClaw config lives at `channels.mutiro.accounts.<account-id>.allowFrom`
|
|
140
|
+
and is managed via `openclaw config set` or the `openclaw channels add`
|
|
141
|
+
wizard.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
### Reference
|
|
146
|
+
|
|
147
|
+
- `mutiro agents allowlist get <agent>` — list current allowlist
|
|
148
|
+
- `mutiro agents allow <agent> <user>` — add one
|
|
149
|
+
- `mutiro agents deny <agent> <user>` — remove one
|
|
150
|
+
- `mutiro agents allowlist set <agent> user1 user2 ...` — replace whole list
|
|
151
|
+
- `mutiro agents allowlist set <agent> "*"` — open to everyone
|
|
152
|
+
- `mutiro agents allowlist set <agent>` — reset to owner-only
|
|
153
|
+
- `mutiro agents allowlist add <agent> <user>` — same as `allow`
|
|
154
|
+
- `mutiro agents allowlist remove <agent> <user>` — same as `deny`
|
|
155
|
+
- `mutiro agents get <agent>` — agent details (owner, created-at, etc.)
|
|
156
|
+
- `mutiro agent doctor` — diagnose the Mutiro side
|
|
157
|
+
````
|
|
158
|
+
|
|
159
|
+
## Quick Reference (Humans)
|
|
160
|
+
|
|
161
|
+
If you don't want to use an AI assistant, the commands are the same:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# See who has access
|
|
165
|
+
mutiro agents allowlist get <agent-username>
|
|
166
|
+
|
|
167
|
+
# Allow one user
|
|
168
|
+
mutiro agents allow <agent-username> <username>
|
|
169
|
+
|
|
170
|
+
# Remove one user
|
|
171
|
+
mutiro agents deny <agent-username> <username>
|
|
172
|
+
|
|
173
|
+
# Replace the whole list
|
|
174
|
+
mutiro agents allowlist set <agent-username> alice bob charlie
|
|
175
|
+
|
|
176
|
+
# Open to everyone (read the security note in the prompt above first!)
|
|
177
|
+
mutiro agents allowlist set <agent-username> "*"
|
|
178
|
+
|
|
179
|
+
# Reset to owner-only
|
|
180
|
+
mutiro agents allowlist set <agent-username>
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Remember:** the Mutiro backend allowlist is the authoritative server-side
|
|
184
|
+
gate. A denied user's message never reaches your OpenClaw brain at all.
|