Channels
Envoy
OpenClaw plugin: send an AI envoy to chat with a business for you on WhatsApp, with an approval and strict guardrails.
Install
npm install
npm
Configuration Example
{
"agents": {
"entries": {
"envoy": {
"name": "Envoy",
"workspace": "~/.openclaw/workspace-envoy",
"skills": [],
"tools": {
"profile": "minimal",
"deny": ["group:runtime", "group:fs", "group:web", "group:sessions", "message", "cron", "gateway"]
}
}
}
}
}
README
# Envoy
Send an AI envoy to chat with a business for you on WhatsApp.
> **Early release (0.1.1).** All guardrails have unit tests, and the plugin loads on OpenClaw 2026.9.37 to 2026.12.1.
> The first end-to-end WhatsApp test is still to come. Please report problems as GitHub issues.
You tell your agent what you want to know. With your yes, it sends an envoy: a separate, tool-less agent
that messages the business, asks the questions in the brief, and collects the answers. When the business
replies and the chat goes quiet, your agent reads the chat and reports back to you.
The envoy works on a **mission**. Each mission has fixed rules. This version has one mission:
| Mission | The envoy may | The envoy may not |
|---|---|---|
| `research` | Ask the brief's questions. Share only what the brief lists. | Agree to anything, book, pay, sign up, open links or share your other details. |
More missions (for example deliver, quotes, book, negotiate) need their own design and rules first.
## Safety
- **Your yes, quoted.** `envoy_start` needs the approval quoted: who, where, when and the words.
- **Only you can start one.** `envoy_start` refuses unless OpenClaw marks the turn as coming from the owner.
- **Your numbers are never routed** to the envoy (`ownerNumbers`).
- **Only new numbers.** Envoy refuses a number that is already on your allowlist or already has a route,
so it never takes over a real contact's chat.
- **The envoy has no tools** and a fixed rule set. The business's messages are treated as data, never as instructions.
- **Limits:** at most 5 open chats, a chat closes after 15 envoy replies (loop guard) or 72 hours with no reply.
- **Stopped means stopped.** A send to a closed chat is cancelled, and the envoy agent can only send to an open chat.
- **Safety check on every config write.** An open chat number that is allowed but has no route to the envoy
would reach your main agent, so such a write is refused.
## How it works
1. `envoy_start` adds a route (the business's number to the envoy agent) and an allowlist entry in one config write.
The WhatsApp channel reads these from the live config on every message.
2. Envoy sends the first message, word for word.
3. On each envoy turn, Envoy adds the mission rules and the brief to the envoy's system context.
4. Envoy records the chat itself (`message_received`, `message_sent`).
5. A timer wakes your main agent when the business replied and the chat has been quiet for 20 minutes,
and closes chats that hit a limit.
6. `envoy_stop` removes the route and keeps the transcript.
WhatsApp knows some numbers in two forms (Mexico +52 and +521, Argentina +54 and +549, Brazil with and without
the ninth digit). Envoy routes both forms, so a reply from either form arrives. You can add more countries in config.
## Requirements
- OpenClaw 2026.9.37 or later. Tested end to end on 2026.11.3. Loads and registers on 2026.9.37 to 2026.12.1.
If your version lacks a feature Envoy needs, Envoy logs which one and turns off `envoy_start`.
Please report it as an issue with your OpenClaw version.
- WhatsApp set up as a channel, with `dmPolicy` `allowlist` (recommended) or `pairing`.
## Setup
1. Install:
```bash
openclaw plugins install clawhub:openclaw-envoy
```
2. Create the envoy agent with no tools. For example, in `openclaw.json`:
```json
{
"agents": {
"entries": {
"envoy": {
"name": "Envoy",
"workspace": "~/.openclaw/workspace-envoy",
"skills": [],
"tools": {
"profile": "minimal",
"deny": ["group:runtime", "group:fs", "group:web", "group:sessions", "message", "cron", "gateway"]
}
}
}
}
}
```
Put a short `AGENTS.md` in its workspace saying who it works for. See `templates/AGENTS.md`.
3. Configure the plugin, let it see the envoy's prompt, and give the tools to your main agent:
```json
{
"plugins": {
"entries": {
"envoy": {
"enabled": true,
"hooks": { "allowConversationAccess": true },
"config": { "ownerNumbers": ["+15555550100"] }
}
}
},
"agents": {
"entries": {
"main": { "tools": { "alsoAllow": ["envoy_start", "envoy_status", "envoy_result", "envoy_stop"] } }
}
}
}
```
4. Run `openclaw config validate`.
## Config
| Key | Default | Meaning |
|---|---|---|
| `ownerNumbers` | (required) | Your own numbers. Only you can start an envoy, and these are never routed to it. |
| `helperAgentId` | `envoy` | The agent that talks to the business. |
| `accountId` | `default` | The WhatsApp account to send from. |
| `afterWrite` | `auto` | After a route change: `auto` (hot reload) or `restart` (gateway restart). |
| `allowedCountryCodes` | `[]` | Country codes Envoy may message, for example `["1", "52"]`. Empty means every country. |
| `maxOpenChats` | 5 | Open chats at one time. |
| `maxHelperReplies` | 15 | Close a chat after this many envoy replies. |
| `noReplyHours` | 72 | Close a chat when nobody replies in this time. |
| `quietMinutes` | 20 | Wake your main agent when they replied and the chat has been quiet this long. |
| `numberForms` | `[]` | Extra countries where WhatsApp knows a number in two forms. |
## Tools
| Tool | Does |
|---|---|
| `envoy_start` | Checks the rules, adds the route, sends the first message. Owner turns only. |
| `envoy_status` | Lists open chats. |
| `envoy_result` | Returns a chat. The business's text is marked as untrusted. |
| `envoy_stop` | Removes the route and keeps the transcript. |
The envoy agent never gets these tools.
## Development
```bash
npm install
npm test
npm run build
```
## License
MIT
channels
Comments
Sign in to leave a comment