iMessage (imsg)
Status: external CLI integration. Gateway spawnsimsg rpc (JSON-RPC over stdio).
What it is
- iMessage provider backed by
imsgon macOS. - Deterministic routing: replies always go back to iMessage.
- DMs share the agent’s main session; groups are isolated (
imessage:group:<chat_id>).
Requirements
- macOS with Messages signed in.
- Full Disk Access for Clawdbot +
imsg(Messages DB access). - Automation permission when sending.
imessage.cliPathcan point to any command that proxies stdin/stdout (for example, a wrapper script that SSHes to another Mac and runsimsg rpc).
Setup (fast path)
- Ensure Messages is signed in on this Mac.
- Configure iMessage and start the gateway.
Remote/SSH variant (optional)
If you want iMessage on another Mac, setimessage.cliPath to a wrapper that
execs ssh and runs imsg rpc on the remote host. Clawdbot only needs a
stdio stream; imsg still runs on the remote macOS host.
Example wrapper (save somewhere in your PATH and chmod +x):
- Remote Mac must have Messages signed in and
imsginstalled. - Full Disk Access + Automation prompts happen on the remote Mac.
- Use SSH keys (no password prompt) so the gateway can launch
imsg rpcunattended.
imessage.accounts with per-account config and optional name. See gateway/configuration for the shared pattern.
Access control (DMs + groups)
DMs:- Default:
imessage.dmPolicy = "pairing". - Unknown senders receive a pairing code; messages are ignored until approved (codes expire after 1 hour).
- Approve via:
clawdbot pairing list --provider imessageclawdbot pairing approve --provider imessage <CODE>
- Pairing is the default token exchange for iMessage DMs. Details: Pairing
imessage.groupPolicy = open | allowlist | disabled.imessage.groupAllowFromcontrols who can trigger in groups whenallowlistis set.- Mention gating uses
routing.groupChat.mentionPatterns(iMessage has no native mention metadata). - Multi-agent override:
routing.agents.<agentId>.mentionPatternstakes precedence.
How it works (behavior)
imsgstreams message events; the gateway normalizes them into the shared provider envelope.- Replies always route back to the same chat id or handle.
Media + limits
- Optional attachment ingestion via
imessage.includeAttachments. - Media cap via
imessage.mediaMaxMb.
Limits
- Outbound text is chunked to
imessage.textChunkLimit(default 4000). - Media uploads are capped by
imessage.mediaMaxMb(default 16).
Addressing / delivery targets
Preferchat_id for stable routing:
chat_id:123(preferred)chat_guid:...chat_identifier:...- direct handles:
imessage:+1555/sms:+1555/[email protected]
Configuration reference (iMessage)
Full configuration: Configuration Provider options:imessage.enabled: enable/disable provider startup.imessage.cliPath: path toimsg.imessage.dbPath: Messages DB path.imessage.service:imessage | sms | auto.imessage.region: SMS region.imessage.dmPolicy:pairing | allowlist | open | disabled(default: pairing).imessage.allowFrom: DM allowlist (handles orchat_id:*).openrequires"*".imessage.groupPolicy:open | allowlist | disabled(default: open).imessage.groupAllowFrom: group sender allowlist.imessage.groups: per-group defaults + allowlist (use"*"for global defaults).imessage.includeAttachments: ingest attachments into context.imessage.mediaMaxMb: inbound/outbound media cap (MB).imessage.textChunkLimit: outbound chunk size (chars).
routing.groupChat.mentionPatterns.messages.responsePrefix.