Overview
Outbound Messaging is ArgentOS’s multi-channel delivery pipeline. It enables agents to proactively send messages, attachments, polls, and rich content to any configured communication channel — Telegram, Discord, Slack, WhatsApp, iMessage, Signal, Matrix, MS Teams, Mattermost, and more. Unlike inbound message handling (where channels push messages to the agent), outbound messaging is agent-initiated. The agent decides to send a message using themessage tool, and the outbound pipeline handles channel resolution, target routing, session tracking, media handling, and cross-context policy enforcement.
Architecture
Message Actions
The system supports several action types:Send Action
The primary action. Supports text messages with markdown formatting, media attachments via URL/file path/base64, reply threading, buttons and cards (channel-dependent), and multiple media in a single message.Broadcast Action
Poll Action
Creates interactive polls (supported on Discord, Telegram, Slack):Channel Resolution
When an agent sends a message, the system resolves the target channel:- Explicit channel — If the agent specifies
channel: "slack", use that - Tool context inference — If responding to an inbound message, use the same channel
- Configured channels — Query the list of configured message channels from
argent.json
Target Format Examples
Media Handling
The outbound pipeline handles media through several mechanisms:- URL resolution — HTTP/HTTPS URLs are downloaded and forwarded
- File paths — Local file paths are read and encoded
- Sandbox resolution — Paths within the agent sandbox are resolved safely
- Base64 encoding — Raw binary data is accepted as base64
- Size limits — Per-channel and per-account media size limits are enforced
- Content type inference — MIME types are detected from file extensions
Data URLs (
data:...) are explicitly rejected to prevent agents from embedding large binary payloads in tool call parameters.Delivery Pipeline
The full delivery flow for asend action:
1
Parse
Parse and validate tool parameters
2
Resolve channel
Resolve channel from hint, context, or config
3
Resolve target
Contact lookup, group resolution
4
Enforce policy
Enforce cross-context policy
5
Hydrate media
Download URLs, resolve paths, encode base64
6
Apply directives
Apply reply directives from message text
7
Resolve session
Resolve outbound session route
8
Ensure session
Ensure session entry exists for continuity
9
Execute send
Execute send via channel adapter or gateway relay
10
Return result
Return structured result to agent
Abort Support
All outbound operations support abort signals for cancellation. If an agent run is aborted (user presses stop, timeout), in-flight message sends are cancelled cleanly viaAbortSignal.
