1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Agent-to-agent messaging for Claude Code.
//!
//! Two Claude Code agents converse by each running a **channel server** — an MCP
//! server declaring the `claude/channel` capability, which pushes
//! `notifications/claude/channel` events straight into a live session and
//! exposes a `reply` tool for the outbound half. A small **bus** routes messages
//! between them and buffers for agents that are offline.
//!
//! ## Trust
//!
//! An agent's identity is its **Ed25519 public key** ([`identity`]); names are
//! local petnames. Every message is signed, and the channel server verifies the
//! signature and checks the sender against an allowlist *before* pushing —
//! so an unverified message never reaches the model.
//!
//! Authority comes from the server's `instructions` string, which lands in
//! Claude's system prompt. The peer's text is untrusted data that parameterises
//! an action; it never authorises one. An ungated channel is a prompt-injection
//! vector.
//!
//! ## Pieces (each behind a feature)
//!
//! - [`identity`] — keys, signing, verification, the peer allowlist.
//! - [`bus`] — the broker: per-recipient queues with `POST /send`, `GET /recv`.
/// Unix milliseconds.