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 the message 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:
| Action | Description |
|---|
send | Send a text message with optional media attachments |
sendAttachment | Send a file attachment with optional caption |
poll | Create a poll with question, options, and multiselect support |
broadcast | Send the same message to multiple targets across channels |
setGroupIcon | Change a group chat’s icon/avatar |
react | Add a reaction to a specific message |
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.
{
action: "send",
channel: "telegram",
to: "user:123456",
message: "Here's the report you requested.",
media: "/path/to/report.pdf"
}
Broadcast Action
Broadcast must be explicitly enabled in config (tools.message.broadcast.enabled: true).
{
action: "broadcast",
targets: ["user:alice", "user:bob", "channel:general"],
channel: "all",
message: "Weekly standup reminder"
}
Poll Action
Creates interactive polls (supported on Discord, Telegram, Slack):
{
action: "poll",
channel: "discord",
to: "channel:general",
pollQuestion: "When should we schedule the demo?",
pollOption: ["Monday 2pm", "Tuesday 10am", "Wednesday 3pm"],
pollMulti: true,
pollDurationHours: 24
}
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
| Channel | Target Format Examples |
|---|
| Telegram | user:123456, group:-100123, @username |
| Discord | user:123456789, channel:987654321 |
| Slack | user:U01ABC, channel:C01DEF, #general |
| WhatsApp | +15551234567, group:[email protected] |
| iMessage | +15551234567, [email protected] |
| Signal | +15551234567, group:abc123 |
| Matrix | @user:server.org, !roomid:server.org |
| MS Teams | user:abc, conversation:19:[email protected] |
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 a send action:
Parse
Parse and validate tool parameters
Resolve channel
Resolve channel from hint, context, or config
Resolve target
Contact lookup, group resolution
Enforce policy
Enforce cross-context policy
Hydrate media
Download URLs, resolve paths, encode base64
Apply directives
Apply reply directives from message text
Resolve session
Resolve outbound session route
Ensure session
Ensure session entry exists for continuity
Execute send
Execute send via channel adapter or gateway relay
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 via AbortSignal.
Configuration
{
"channels": {
"telegram": {
"botToken": "...",
"enabled": true
},
"discord": {
"botToken": "...",
"enabled": true
}
},
"tools": {
"message": {
"broadcast": {
"enabled": false
}
}
}
}