| Internet-Draft | Agent Protocol over MoQ | March 2026 |
| Liu & Krishnan | Expires 3 September 2026 | [Page] |
This document specifies a Agent-to-Agent communication framework enabling structured, low-latency, and semantically rich communication between autonomous agents over the Media over QUIC (MoQ) protocol. It leverages MoQ's efficient media transport capabilities while introducing a new application-layer framing mechanism to support control signaling, session management, and large data fragmentation. The design supports both intra-domain and inter-domain deployment, with an emphasis on interoperability, extensibility, and minimal overhead.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 2 September 2026.¶
Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
The multimodal capabilities of AI Agents, has created a need for a real-time communication framework that supports both media streaming and structured control signaling. Existing protocols such as HTTP/2, gRPC, either suffer from head-of-line blocking or lack native support for real-time media and bidirectional streaming.¶
Media over QUIC (MoQ) offers a compelling transport foundation with its low-latency, multiplexed, and connection-robust design. However, MoQ is originally optimized for media delivery and lacks native semantics for agent-to-agent control, session establishment, and structured data exchange.¶
This document proposes an application-layer protocol framework that operates over MoQ. It introduces:¶
The proposed framework is designed to be minimal, modular, and compatible with existing MoQ implementations. It does not modify MoQ's transport semantics but instead defines a new application-layer envelope that can be carried within MoQ Objects or Datagrams.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].¶
Agent Protocol over MoQ operates as an application-layer protocol on top of MoQ. The protocol stack is illustrated below:¶
+-------------------------------------------------------------+
| Agent to Agent Communication - Application Logic |
| (Agent Reasoning, Command Execution, Media Processing) |
+-------------------------------------------------------------+
|
v
+-------------------------------------------------------------+
| |
| Agent Protocol over MoQ Frame Layer (Header + Payload) |
| |
| +-------------------+ +-------------------------------+ |
| | Frame Header | | Frame Payload | |
| | - Magic Number | | - CMD (JSON) | |
| | - Version | | - DATA (Binary chunks) | |
| | - Message Type | | - STREAM (Media samples) | |
| | - Session ID | | - HEARTBEAT (Empty) | |
| | - Stream ID | | | |
| | - Flags | | | |
| | - Payload Length | | | |
| +-------------------+ +-------------------------------+ |
+-------------------------------------------------------------+
|
v
+-------------------------------------------------------------+
| Media Transport Layer (MoQ) |
| |
| Track Management | Group/Object | Datagram Support |
| Subscribe/Publish | Prioritization| Low-latency |
+-------------------------------------------------------------+
|
v
+-------------------------------------------------------------+
| Transport Layer (QUIC) |
| |
| UDP-based | 0-RTT Handshake | Stream Multiplexing |
| TLS 1.3 | Loss Recovery | Flow Control |
+-------------------------------------------------------------+
The stack consists of four main layers:¶
Agents establish a MoQ session (via WebTransport or native QUIC client) and use one or more Tracks for communication. Each agent-to-agent message is encapsulated in a binary frame before being sent as a MoQ Object or Datagram. The framing layer provides session management, fragmentation support, and extensibility through version and flag fields.¶
The Agent to Agent Communication frame is a binary structure designed for efficiency and extensibility. It consists of a fixed-length header and a variable-length payload.¶
| Field | Length (bytes) | Description | MoQ Mapping |
|---|---|---|---|
| Magic Number | 2 | Identifier: 0xA2A2 | Detects agent-to-agent traffic |
| Version | 1 | Protocol version (e.g., 0x01) | Forward compatibility |
| Msg Type | 1 | Message type: CMD(0x01), DATA(0x02), STREAM(0x03), HEARTBEAT(0x04) | Route to handler |
| Session ID | 8 | Unique session identifier (UUIDv7 or hash) | Correlate multi-turn dialogues |
| Stream ID | 4 | Identifier for fragmented streams | Reassemble large data |
| Flags | 1 | Bitmask: compressed(0x01), encrypted(0x02), fragmented(0x04) | Processing hints |
| Payload Len | 4 | Length of the following payload | Parse boundary |
The payload is interpreted based on the Msg Type and Flags:¶
Agent Protocol over MoQ uses JSON (JavaScript Object Notation) as the standard encoding format for structured message content:¶
JSON (JavaScript Object Notation) is used for all CMD and control messages:¶
Example CMD message in JSON:¶
{
"action": "session_init",
"session_id": "abc-123-def-456",
"auth_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"capabilities": {
"media_types": ["video/h264", "audio/opus"],
"max_fragment_size": 1400
}
}
Media streams and large data payloads use raw binary encoding:¶
Each message type has specific field requirements and processing rules:¶
CMD messages carry structured commands encoded in JSON. In addition to session management commands, CMD messages include specific actions for subscription management in pub/sub scenarios.¶
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
| action | String | Yes | Command identifier | "session_init", "session_ack", "subscribe_request", "unsubscribe_request", "track_ready" |
| session_id | String/UUID | Yes (for session cmds) | Session identifier | "abc-123-def-456" |
| auth_token | String | Yes (for session_init) | JWT with operation claim | "eyJhbGciOiJIUzI1NiIsIn..." |
| status | String | No | Response status | "approved", "denied", "error" |
| error_code | Integer | No | Error identifier | 401, 403, 500 |
| payload | Any | No | Command-specific data | {"key": "value"} |
For subscription-related actions such as "subscribe_request" and "unsubscribe_request", CMD messages include additional fields:¶
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
| track_name | String | Yes (for subscribe) | Name of the track to subscribe to | "agent2.session456.video" |
| quality_params | Object | No | Quality parameters for the subscription | {"resolution": "1080p", "fps": 30} |
| subscriber_id | String | Yes (for subscribe) | ID of the subscribing agent | "agent1" |
DATA messages carry raw binary chunks for large file transfers.¶
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| chunk_index | Integer | Yes | Position in sequence | 0-based, sequential |
| total_chunks | Integer | Yes (last chunk) | Total number of chunks | Must match in all chunks |
| checksum | String | No | Data integrity hash | SHA-256 hex encoded |
| metadata | Object | No | File/type information | {"filename": "file.txt"} |
STREAM messages carry media samples with optional timing information.¶
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
| timestamp | Integer | Yes | Sample timestamp (ms) | 1678901234567 |
| media_type | String | Yes | Media content type | "video/h264", "audio/opus" |
| sequence_number | Integer | Yes | Frame sequence | 12345 |
| key_frame | Boolean | No | Is key frame | true |
| bitrate | Integer | No | Current bitrate (bps) | 1000000 |
HEARTBEAT messages have empty payload and are used for liveness detection.¶
| Field | Value | Description |
|---|---|---|
| Payload Length | 0 | No payload data |
| Processing | Ack only | Recipient should acknowledge receipt |
Agent Protocol over MoQ frames are mapped to MoQ Objects and Datagrams based on their reliability and latency requirements:¶
This mapping ensures that the transport characteristics of MoQ align with the application requirements of agent-to-agent communication.¶
The MoQ pub/sub mechanism is integrated with Agent Protocol over MoQ through specific CMD message types that manage subscriptions at the application layer:¶
This approach provides application-layer control over the underlying MoQ pub/sub mechanism, allowing fine-grained access control and session management.¶
Agent Protocol over MoQ supports two communication modes:¶
Agents establish a session using a handshake that includes authorization verification. Once a session is established, agents can use subscription management commands to establish pub/sub relationships:¶
operation claim as defined in [I-D.liu-agent-operation-authorization].¶
The session terminates with a session_bye command or MoQ session closure.¶
For stateless interactions (e.g., heartbeat, fire-and-forget command), agents may send frames without session setup. The Session ID field is set to zero. Authorization for such interactions is typically pre-established or implicit.¶
Agent Protocol over MoQ defines three strategies based on payload size:¶
Sent as a single MoQ Datagram or Object. No application-layer fragmentation. Ideal for commands and heartbeats.¶
Application-layer fragmentation is required:¶
Reassembly is performed at the receiver using Stream ID and order of arrival.¶
Continuous media (audio/video) is sent as a sequence of agent protocol over MoQ STREAM frames. Each frame carries one media sample. Loss of a single frame does not block subsequent ones, leveraging MoQ's partial reliability.¶
Agent Protocol over MoQ is designed to operate in two modes:¶
Agent Protocol over MoQ does not define its own discovery mechanism but RECOMMENDS integration with MoQ's track discovery or external service directories.¶
Agent Protocol over MoQ inherits security from the underlying transport:¶
operation claim as defined in [I-D.liu-agent-operation-authorization].¶
Implementations MUST validate authorization tokens before processing any agent-to-agent communication. Session IDs MUST be cryptographically random to prevent session hijacking.¶
This document requests IANA to create new registries and register initial values for the Agent Protocol over MoQ.¶
IANA is requested to create a new registry for Agent Protocol over MoQ Magic Numbers under the "Media over QUIC (MoQ)" group. The registration procedure is Standards Action as defined in [RFC8126].¶
Initial registration:¶
| Value | Description | Reference |
|---|---|---|
| 0xA2A2 | Agent-to-Agent Communication Frame | [This document] |
IANA is requested to create a new registry for Agent Protocol over MoQ Versions. The registration procedure is Standards Action.¶
Initial registration:¶
| Value | Description | Reference |
|---|---|---|
| 0x01 | Agent Protocol over MoQ Version 1 | [This document] |
Values 0x00 and 0xFF are reserved. Values 0x02-0xFE are available for assignment.¶
IANA is requested to create a new registry for Agent Protocol over MoQ Message Types. The registration procedure is Specification Required as defined in [RFC8126].¶
Initial registrations:¶
| Value | Message Type | Description | Reference |
|---|---|---|---|
| 0x00 | Reserved | Reserved for future use | [This document] |
| 0x01 | CMD | Command message with structured payload | [This document] |
| 0x02 | DATA | Raw binary data chunk | [This document] |
| 0x03 | STREAM | Media stream sample | [This document] |
| 0x04 | HEARTBEAT | Liveness detection message | [This document] |
Values 0x05-0xFE are available for assignment. Value 0xFF is reserved.¶
IANA is requested to create a new registry for Agent Protocol over MoQ Frame Flags. The registration procedure is Specification Required. Each flag is represented by a bit position (0-7).¶
Initial registrations:¶
| Bit | Flag Name | Description | Reference |
|---|---|---|---|
| 0 | Compressed | Payload is compressed (0x01) | [This document] |
| 1 | Encrypted | Payload has application-layer encryption (0x02) | [This document] |
| 2 | Fragmented | Frame is part of a fragmented stream (0x04) | [This document] |
| 3-7 | Unassigned | Available for assignment | [This document] |
IANA is requested to register a new well-known URI in the "Well-Known URIs" registry as defined in [RFC8615].¶
The "/.well-known/a2a" endpoint facilitates agent discovery in inter-domain deployments. When accessed via HTTPS GET, the endpoint returns a JSON response containing the MoQ endpoint information for Agent Protocol over MoQ communication.¶
This appendix provides detailed examples of Agent Protocol over MoQ interactions based on a multimodal collaborative design scenario.¶
Agents:¶
Used for lightweight, fire-and-forget interactions like liveness checks or simple status updates.¶
Agent 1 sends a heartbeat to Agent 2 to maintain the MoQ track activity.¶
Header: - Magic Number: 0xA2A2 - Version: 0x01 - Msg Type: 0x04 (HEARTBEAT) - Session ID: 0 (Stateless) - Stream ID: 0 - Flags: 0x00 - Payload Len: 0 Payload: (Empty)
Used for complex dialogues requiring continuous media processing, such as real-time video analysis.¶
Step 1: Session Handshake with Authorization¶
Agent 1 (Smartphone) Agent 2 (Cloud)
| |
| CMD {action:"session_init", |
| session_id:"abc-123", |
| auth_token:"<JWT>"} |
|------------------------------------->|
| |
| CMD {action:"session_ack", |
| session_id:"abc-123", |
| status:"approved"} |
|<-------------------------------------|
Step 2: Media Streaming¶
Agent 1 captures video and sends it as STREAM frames within the established session.¶
Header: - Magic Number: 0xA2A2 - Version: 0x01 - Msg Type: 0x03 (STREAM) - Session ID: abc-123 - Flags: 0x00 - Payload Len: 1200 Payload: [Raw H.264/HEVC NAL Unit]
Step 1: Subscription Request¶
Agent 1 wants to subscribe to Agent 2's video feed. It sends a subscription request within the established session.¶
Agent 1 (Subscriber) Agent 2 (Publisher)
| |
| CMD {action:"subscribe_request", |
| session_id:"abc-123", |
| track_name:"agent2.video.h264", |
| subscriber_id:"agent1"} |
|------------------------------------------------>|
| |
| CMD {action:"track_ready", |
| session_id:"abc-123", |
| status:"approved", |
| track_url:"moq://track/agent2.video.h264"}|
|<------------------------------------------------|
Step 2: Media Streaming via MoQ pub/sub¶
After successful subscription negotiation via CMD messages, the actual media stream flows through the underlying MoQ pub/sub mechanism.¶
Used for transferring high-resolution assets or large model weights.¶
Agent 2 sends a 5MB design file back to Agent 1.¶
Fragmentation Strategy: The file is split into chunks of 1400 bytes.¶
Header: - Msg Type: 0x02 (DATA) - Session ID: abc-123 - Stream ID: 101 (File Transfer Stream) - Flags: 0x04 (Fragmented = 1) - Payload Len: 1400 Payload: [First 1400 bytes of the file]
Header: - Msg Type: 0x02 (DATA) - Session ID: abc-123 - Stream ID: 101 - Flags: 0x00 (Fragmented = 0) - Payload Len: 800 Payload: [Final 800 bytes of the file]
Agents are deployed in the same regional data center (e.g., Alibaba Cloud Hangzhou Region).¶
Agent 1 (on Smartphone) calls Agent 2 (on Cloud).¶
Agent 1 (Smartphone) .well-known/a2a Agent 2 (Cloud)
| | |
| GET https://cloud.example.com/.well-known/a2a |
|---------------------------------------------->|
| | |
| { "moq_endpoint": "quic://api.cloud.example.com:443" } |
|<----------------------------------------------|
| | |
| QUIC/MoQ Handshake (0-RTT) |
|---------------------------------------------->|
| | |
| Agent Protocol over MoQ Frame |
| (Session Init with Auth) |
|---------------------------------------------->|
| Type | Session ID | Msg Type | Typical Usage | MoQ Mapping |
|---|---|---|---|---|
| Session-Less | 0 | HEARTBEAT / CMD | Keep-alive, Simple Queries | MoQ Datagram (HEARTBEAT), MoQ Object (CMD) |
| Streaming | UUID | STREAM | Audio/Video/Sensor Stream | MoQ Object (Ordered Delivery), MoQ Datagram (Loss-Tolerant) |
| Bulk Data | UUID | DATA | Large Files, Images | MoQ Object (Reliable), MoQ Datagram (Small Data) |
| Control | UUID | CMD | Logic Execution, ACKs, Subscription Management | MoQ Object (Reliable) |