The Channel interface
A channel is a class implementing this interface:
send() method on the interface. Inside start(), the channel publishes inbound messages and subscribes to outbound ones; outbound delivery for email and Signal is routed through the shared outbound gateway, while simple channels (like CLI) write directly.
Implementation steps
Implement the Channel interface
Create a new directory under Register on the bus at the
src/channels/<name>/ and a class that implements Channel (from src/channels/channel.ts):channel layer — the hard security boundary limits a channel to publishing inbound.message and subscribing to outbound.message. It cannot invoke skills, read memory, or trigger agent tasks.Add a catalog descriptor
Add a Each credential is stored in the vault under
ChannelDescriptor to src/channels/catalog.ts so the registry knows about your channel and what credentials it needs:channel.<name>.<field> — here, channel.my-channel.api_token. The registry will not let the channel be enabled until every requiredSecretKeys entry resolves.Handle inbound messages
When your platform delivers a message, normalize it into an The
inbound.message event and publish it on the bus:channelTrust field declares your channel’s trust level. Choose based on the identity guarantees your platform provides:| Trust level | When to use |
|---|---|
high | Strong identity verification (local access, E2E encryption with phone verification) |
medium | Token-based or OAuth authentication |
low | Weak identity guarantees (email addresses can be spoofed) |
Handle outbound messages
In Filter by
start(), subscribe to outbound.message at the channel layer and deliver messages addressed to your channel:channelId so you only handle messages destined for your channel.What the dispatch layer handles for you
You don’t need to implement any of these in your adapter — they’re handled by the dispatch layer after yourinbound.message is published:
- Contact resolution — the dispatcher resolves the sender to a contact record
- Trust scoring — your
channelTrustvalue is combined with contact confidence and injection risk - Rate limiting — global and per-sender limits are enforced
- Prompt injection scanning — inbound text is checked against detection patterns
- PII redaction — outbound messages are redacted based on channel-specific policies
Testing
Write tests for your adapter covering:- Inbound message normalization (platform format → bus event)
- Outbound message delivery (bus event → platform API call)
- Authentication and connection handling
- Error recovery (platform API failures, connection drops)
How channels work
Channel routing, trust levels, and the dispatch pipeline in detail.
Architecture
How channel adapters fit into the five-layer bus architecture.