Skip to main content

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:
ActionDescription
sendSend a text message with optional media attachments
sendAttachmentSend a file attachment with optional caption
pollCreate a poll with question, options, and multiselect support
broadcastSend the same message to multiple targets across channels
setGroupIconChange a group chat’s icon/avatar
reactAdd 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:
  1. Explicit channel — If the agent specifies channel: "slack", use that
  2. Tool context inference — If responding to an inbound message, use the same channel
  3. Configured channels — Query the list of configured message channels from argent.json

Target Format Examples

ChannelTarget Format Examples
Telegramuser:123456, group:-100123, @username
Discorduser:123456789, channel:987654321
Slackuser: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 Teamsuser:abc, conversation:19:[email protected]

Media Handling

The outbound pipeline handles media through several mechanisms:
  1. URL resolution — HTTP/HTTPS URLs are downloaded and forwarded
  2. File paths — Local file paths are read and encoded
  3. Sandbox resolution — Paths within the agent sandbox are resolved safely
  4. Base64 encoding — Raw binary data is accepted as base64
  5. Size limits — Per-channel and per-account media size limits are enforced
  6. 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:
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 via AbortSignal.

Configuration

{
  "channels": {
    "telegram": {
      "botToken": "...",
      "enabled": true
    },
    "discord": {
      "botToken": "...",
      "enabled": true
    }
  },
  "tools": {
    "message": {
      "broadcast": {
        "enabled": false
      }
    }
  }
}