Agent Exchange Protocol v1.0 (Draft r11) · Notes: role boundaries, data, operations, standards (informative)
Part of the specification that begins in aep-core.md, whose front matter says which document holds which section. Section numbers are those of the whole specification.
17. Role boundaries (informative; the hosted Runtime is runtime.v1)
Network operators (Directory, Index, Gateway), Surfaces and personal agents share no database, queue, secret store or synchronous RPC; they connect only through Envelopes.
| Network operator | Surface | Personal agent | |
|---|---|---|---|
| Runs | Directory, Index, Gateway (which hosts rooms as their router, never as their controller), federation, metadata policy | Source adapters, listing and freshness, provider credentials, quote/hold/confirm/execute, claims, executed/settled attestations |
Reasoning, memory, negotiation, approvals, commands, room control |
| Never holds | Provider credentials, raw provider responses, the plaintext of a sealed body, execution state | Copies of Directory or Context | Provider access |
| Authority over | Routing, delivered |
Execution results on the Provider's behalf | The Owner's intent |
Reputation views (credit, passport, feed) are product projections built from attestations. Search ranking is an Index implementation detail.
Surface-to-network integration is the three operations applied to Record types (shown for exchange.v1; without it, integration is registration, discovery and payload delivery).
| Contract | Operation | Records |
|---|---|---|
| Registration | send → Directory |
agent_card (surface), delegation (claim) |
| Publication | send (public) |
listing v+1 |
| Discovery | query |
listing (signed) |
| Proposal, quote | send |
proposal, command{quote}, attestation |
| Execution | send |
command, approval delegation, attestation{executed, settled} |
| Error, replay | sync, send |
attestation{rejected}, outbox replay |
A personal-agent product participates as Native (implements the protocol client), Connector (translates its API/MCP/plugin surface), or Hosted (a Runtime, often operated by a third party, holds the Agent's keys and connects on its behalf; a product API such as an operator's /agent/v1 is a Runtime's, layered on this protocol and not part of its wire surface).
A Runtime changes what the protocol guarantees for the Agents it hosts, and owes its users that disclosure. A self-certifying ID proves control of a key and the continuity of that control, nothing more: whoever holds the key is the Actor, and for a hosted Agent that is the operator, so every statement the protocol makes about such an Agent (who signed, who could read, what was delegated, what was approved with a key the operator holds) is a statement about the operator's custody.
The Runtime holds their keys and sees their plaintext, so its compromise breaks sender authenticity (it can sign as them), confidentiality (it reads what they read) and, where it also holds Owner keys, delegation and approval soundness.
What survives such a compromise: the Gateway's mailboxes never had keys; Agents on other operators are untouched; every signature made is attributable to a hosted device key, which the Owner revokes with a backdated effective_at once the compromise is known (§11.5); and the Actor ID is portable, since export is the Actor's signed Records and control moves by a handover rotation in which no private key leaves its custodian (§12.5). One leak is graver than the rest: a next key signs its own rotation (§4.1), so a copy of an Agent's next key can fork that Agent at any later time, whatever the Runtime has rotated since, and only the Agent's recovery key settles a fork. That is why the recovery key is kept outside the Runtime, with the Owner (§20.1).
A Runtime is one Core device per hosted Agent for mailbox purposes (one kid, one cursor); the access credentials it issues to its users are its own business and never a protocol object.
Before sealing, a careful product scans outbound bodies for credentials and personal data and holds anything flagged for the person's approval, since a Gateway never sees plaintext and cannot; that is a product duty, not a protocol rule. The network asks for nothing beyond agent_card, Envelope, Record and a mailbox sync.
Failures: when an operator is down a Surface stores Records in an outbox and replays them with the same (id, v). When a Surface is down the Index projects its listings as stale and everything else keeps running. Provider failures surface as execution_failed with provider_code.
19. Data boundaries and retention (informative)
Above L0, plaintext stays with the participating agents and network operators handle ciphertext and minimal metadata only; at L0 a body is not sealed and the Gateways on its path can read it (§18.2). Privacy rules, logging policy and regulatory compliance belong to operators and products, not to this protocol.
| Network operator | Surface | Personal agent |
|---|---|---|
| IDs and public key state | Provider catalog, credentials | Memory, preferences, contacts |
Public listings and Cards |
Source adapter state, freshness | Message plaintext, conversation context |
| Ciphertext, attachment references | Encrypted execution results, write-ahead log | Payment vault |
delivered attestations, context metadata |
Claim records | Decrypted agreement details |
agreement commitments, published attestations |
Three kinds of deletion: server deletion (Gateway), projection deletion (Index and the like), and cryptographic erasure (discarding keys). Nothing in the protocol recalls content another agent has already decrypted or records held by an external PSP. read attestations are opt-in; consent to indexing, contact or sharing is a delegation over a disclose scope and is withdrawn by revocation.
22. Operations and efficiency (informative)
Efficiency rules are normative in §9, §10, §11.3 and §12; this section holds operational semantics, a latency target and the Gateway cost model.
22.1 Operational semantics
- Async-first, at-least-once, idempotent commands. Provider latency never blocks Gateway acceptance.
- Search results are full signed Records; the Index adds only a score. Offline recipients are redelivered within TTL.
- Long executions are split into
processedandexecuted. Causal order (parent,v,supersedes) replaces global order.
22.2 Latency target
For the booking fast path (hold → confirm), protocol latency excluding Provider time targets about 600 ms: query 150, Card check 5, send → accepted 50, sync 50, decrypt and verify 2, write-ahead and reply 100, confirm round trip 200. It is a target, not a measurement, until the reference implementation publishes its benchmark conditions and numbers. Operational metrics and dashboards belong to operator documentation.
22.3 Gateway cost model
A Gateway is designed to be cheaper to run than an email server and far cheaper than a chat server (a design goal; no benchmark backs the comparison yet): it reads no content above L0, holds no Actor private keys and no Provider credentials (only its own signing, TLS and lease keys), and about others' traffic signs only delivered, rejected and routable. It does hold state: mailboxes, cursors, dedup indexes, leases, quotas, an outbox and audit metadata. The microsecond figures below are per-operation microbenchmarks; in a running Gateway the costs that matter are network round trips, database transactions, object storage and connection counts. Per message it does the following.
| Work | Cost | Why it is cheap |
|---|---|---|
| Header verification | One Ed25519 verify per Envelope, one per signed mailbox request (a session lookup instead where the Relay Session is offered) | About 50 µs; the Gateway signs nothing itself |
| Policy | exp, size, quota, ACL, key status; metadata only |
No decryption, no content inspection |
| Mailbox append | One ciphertext block (default ≤ 256 KiB) | Append-only; values are never changed |
| Mailbox poll | One verify and one remembered rid per signed sync or ack, an empty sync included: the Gateway keeps the rid until the request's exp (§10.4), so where no session is offered every poll is a write |
One short row, deleted after exp; this cost grows with how often an Agent polls, not with what it receives |
| Delivery evidence | One signature per sender per ack, covering every Envelope of that sender in the acked range | Per-message evidence without doubling the traffic |
| Groups | One room log plus per-member cursors at the room's Gateway, whatever the size; the wraps, not the ciphertext, scale with membership (§10.5) | Ciphertext is not replicated |
| Federation | TLS to the URL each Gateway's Card names (§16.1); Envelopes forwarded unchanged with the sender's sig; Card re-resolution only on failure |
No per-message signing by the Gateway |
There are three real costs. Idle sessions: every always-on Agent holds an open connection at tens of KB each; this is the dominant resource, and intermittently running Agents cost nothing while away. Unacked storage: ciphertext is kept until every leased device acks or exp passes (default 7 days), so the bound is explicit. Unsolicited ciphertext: the evidence behind invite gating lives inside the encrypted Record, so a Gateway cannot pre-filter it; it can only apply per-sender quotas and rate limits, and the recipient drops the rest after decryption. A recipient MAY hand its Gateway a sender allow-list as metadata policy to filter earlier, at the price of revealing its contact graph to that Gateway. Index is the one expensive component (search and ranking) and can be run separately; Directory is a cache of signed Cards and replicates like a CDN.
22.4 Operational requirements
An operable Gateway enforces per-tenant and per-mailbox storage quotas, rate limits per sender and per Home Gateway, bounds on the Records that Actors it does not host may publish to it (revocations, grants that wait for a Card, public Records), a maximum TTL and body size, an attachment egress policy, retry with backoff and a dead-letter queue for its outbox, and tenant isolation with encryption at rest. It keeps its signing key apart from its TLS key, and it exposes revocation lag, cursor age, queue depth, dedup hit rate, expired and signature-failure counts, and session counts. It keeps protocol identity apart from its own customer accounts: an Actor ID is never a tenant or billing identity, and tenant ids live only in the Gateway's control plane. A production Gateway must provide all of this; the reference implementation demonstrates Core behavior and the test vectors only, in memory, and does not run it.
22.5 Scale
Load arrives in three shapes, messages, users and information, and each hits a different part of the network. The table names the bottleneck, what the protocol fixes about it, and what is left to the operator.
| Bottleneck | Where | What the protocol fixes | What the operator does |
|---|---|---|---|
| Receipt amplification | Every message returns a delivered, doubling cross-Gateway traffic |
One delivered per sender per ack with claims.envelopes[] (§10.1) |
— |
| A hot recipient | Millions of senders into one mailbox, such as a large Surface | One mailbox lives at one Home Gateway (§18.2); spreading one Actor across Gateways is a federation.v1 matter; per-sender quotas and policy.rate_limit (§9.2) |
Shard mailboxes by Actor ID inside the Gateway; one mailbox lives on one shard |
| Idle sessions | One connection per always-on Agent | Intermittent Agents poll instead of holding a session; QUIC multiplexes | Connection caps per tenant |
| Dedup indexes | One row per Envelope | Rows live only until exp + 300 s (§12.2) |
Partitioned deletion |
| Card resolution | Every receive may resolve a Card | Cards are signed, so they cache like static files: a copy is kept until its exp, a sender revalidates one older than a day before it seals to it (§11.4), the content digest says whether two copies are the same Card, and a conditional resolve costs a 304 when nothing in the answer changed (§9, §10.4); an equal v alone is never a hit |
A cache or CDN in front of the Directory |
| Revocation freshness | An executor refreshes before an irreversible or financial execution; everyone else refreshes with the Card | GET /v1/revocations?since= as a cacheable delta; Gateways gossip revocations; a session MAY carry revocation notices for keys the client has used |
— |
| Index | The one expensive component | limit ≤ 100, a fixed filter set, results cacheable by filter digest, signed queries when rate-limited (§9.3) |
Shard by region and type; run it apart from the Gateway |
| A large room | One Gateway hosts the room | 32 wraps, then epoch keys, then MLS; mirrors at L3 (§10.5) | — |
| Gateway-to-Gateway outbox | A request per message | send arrays of up to 100 (§10.4); persistent sessions at L3; backoff and dead-letter |
Queue depth and lag as the first metrics |
| Signature CPU | One verify per Envelope | About 20,000 verifies per second per core; batch verification is available | Horizontal |
| Artifacts | Large bodies | Never on the Gateway path; object storage with size caps and expiring URLs (§7) | Egress policy |
Nothing above changes a wire object. The protocol fixes the knobs that must agree between parties, receipt batching, cache validators, the room thresholds and the batch size; everything else is deployment.
Appendix B. Standards mapping
Informative, except for its first paragraph. The normative references of this document, the standards an implementation MUST follow where the body invokes them, are: RFC 7493 (I-JSON, the wire form, §5), RFC 8785 (JCS, under every signature and digest, §5, §6.2), RFC 8032 (Ed25519, §11.2), RFC 9180 (HPKE, sealed.v1, §11.2), RFC 9457 (Problem Details, §8), RFC 9110 (the HTTP semantics the binding of §10.4 relies on: status codes, conditional requests, Retry-After), RFC 8615 (the well-known path, §10.4), RFC 4648 (base64url, §6.2), FIPS 180-4 (SHA-256, §11.2), RFC 3339 (timestamps, §6.2), RFC 9562 (UUIDv7 where used, §4.3) and RFC 2119 with RFC 8174 (keywords). Everything else in this appendix is what was borrowed, from where, and how much of it.
| Component | Standard | Adopted scope |
|---|---|---|
| Actor ID | did:key encoding (multibase base58btc, multicodec) | Byte format only; the full DID stack is not adopted |
| Key rotation | KERI pre-rotation concept | next_key_hash commitment; the separate recovery key (recovery_key_hash) that settles a fork is this spec's own addition (§4.1) |
| Handle resolution | A name under .agent, resolved at the Gateway that holds its scope (/v1/handles/{handle}); which Gateway holds which scope comes from the signed Gateway list, never from the DNS. .agent is a label of this protocol's own namespace (compare .alt, which RFC 9476 reserves for names that are not DNS names) |
Bidirectional verification, name/scope split (§4.2) |
| Delegation | UCAN; Macaroons and Biscuit as attenuation precedents | Attenuation, audience, expiry, proof chain, revocation semantics; a lossless delegation ↔ UCAN mapping is promised with the bindings (§15.2) |
| Canonicalization | JCS (RFC 8785) | MTI |
| Signatures | Ed25519 (RFC 8032) | MTI; further suites by bindings |
| Sealed encryption | HPKE (RFC 9180) | MTI |
| Group encryption | MLS (RFC 9420) | Optional mls.v1 |
| Conversational sessions | Double Ratchet | Not adopted; HPKE sealed Envelopes instead (B.1) |
| Wire encoding | I-JSON (RFC 7493) on the wire, JCS (RFC 8785) under every signature and digest | v1 is JSON only (§5); a CBOR binding, if ever defined, is a separate document with its own signature input |
| Errors | RFC 9457 Problem Details | Synchronous response body |
| HTTP request auth | Signed JSON request object (§10.4), the same primitive as Records | RFC 9421 HTTP Message Signatures was considered and not adopted for Core: it signs HTTP components (method, path, headers) through a signature base an implementer must build exactly, while the mailbox requests are small JSON objects already covered by the Record primitive; the request vectors (vectors/requests_attestations.json) pin the input bytes. RFC 9421 remains a candidate for a separate binding, never a second path in Core |
| Owner authentication | WebAuthn / passkeys | Product-level login and keystore unlock only; a passkey is not an Owner key in v1 because WebAuthn signs its own message format (§11.1) |
| Attestation | W3C Verifiable Credentials data model | Field-compatible (issuer, subject, validFrom, validUntil, evidence); a VC mapping is promised with the bindings |
| Resource projection | schema.org | listing.schema |
| Gateway trust | WebPKI TLS + .well-known signing key |
Federated scope |
| Gateway discovery | Signed lists (same approach as EIP-1459 DNS lists) | /.well-known/aep/gateways |
| Key transparency | Key Transparency (IETF KEYTRANS direction) | Directory SHOULD |
| IDs, time, keywords | ULID (canonical text form) or UUIDv7 (RFC 9562), RFC 3339, RFC 2119/8174 | Throughout (§4.3) |
| Agent interop | A2A, MCP | Adapters |
| Payment authorization | User-signed mandate style payment protocols | Approval mandate Extension |
Several IETF drafts anchor agent identity and discovery in DNS: AID (a _agent.<domain> TXT record naming an endpoint and a protocol token), DNS-AID (SVCB records for the agents of a domain, draft-mozleywilliams-dnsop-dnsaid), Groundmark (agent signing keys published in DNS, requests signed with RFC 9421, DNSSEC required), ApertoID (_apertoid TXT records on the DKIM pattern, with a policy record on the DMARC pattern) and AIMS (draft-klrc-aiagent-auth, an authentication framework composing SPIFFE, WIMSE and OAuth 2.0). Web Bot Auth, an IETF working group whose protocol draft is written at Cloudflare and Google, signs HTTP requests from automated clients with RFC 9421 against a .well-known key directory, and Cloudflare verifies such signatures at its edge; it is the obvious base for an RFC 9421 binding of §10.4. This spec keeps keys in signed Cards and does not use the DNS at all, not even for handles (§4.2), so it composes with all of them: an AID record MAY name the Gateway with protocol token aep, and a Groundmark or ApertoID key MAY be the same key as a Card's signing key. SD-Card, which encodes Agent Cards as SD-JWT with selective disclosure, is a candidate optional encoding for restricted-visibility Cards (§9.2).
Also adopted without changing a Core object: CAIP-19 asset identifiers in the currency field (§6), and as payment rails, Stripe PaymentIntents with manual capture and x402 stablecoin payments (§14.5).
B.1 Design choices
The Envelope header and the Relay Session are home-grown. JWS, JWE and DIDComm were passed over for HPKE multi-recipient sealing on one signed JSON object; the Relay Session's frames belong to its own document (§10.2), and mappings to those formats live in the §10.6 bindings.
Why HPKE is the default: Double Ratchet needs a first key agreement with an offline peer, for which a server holds prekeys, and a session state per peer that changes with every message and must be neither lost nor rolled back. It does handle messages that arrive late or out of order, by keeping the keys it skipped, so ordering is not the reason. The reason is the state: this protocol assumes agents may be stateless, lets delivery lag for days, and allows multiple recipients and several devices behind one Actor. HPKE sealed Envelopes need no state between messages and serve many recipients. The cost is no post-compromise security and no forward secrecy within a key's lifetime: a recipient's encryption private key, once stolen, opens every Envelope sealed to it that the thief has captured, and only retiring the key (§11.5) bounds that window, which is why encryption keys SHOULD rotate within 7 days and the previous key is kept only for the Envelope TTL.
Appendix C. Comparison with similar projects (informative)
Kept beside this document as docs/aep-landscape.md: the comparison table (public projects as of November 2026), its conclusions (C.1) and its sources (C.2). It is dated commentary that moves faster than the protocol does, and nothing in it is needed to build anything; a reference to Appendix C, C.1 or C.2 anywhere in this package means that file.
Appendix D. credentials.v1 Profile (sketch, informative)
Core fixes only the shape of an attestation (§7); claims is a free map, so two readers can read the same verified differently. A credentials.v1 Profile, separate from Core, fixes the shape. Its claims are credential_type, schema_digest, subject, holder, audience, purpose and status_ref, with validity in the Record's iat and exp. A credential is used by presentation: a payload of application/aep.presentation+json holding credential_refs[] (pinned), holder, audience, purpose, the verifier's challenge and presented_at, signed by the holder's key, so a copied credential is useless without the holder's key and a nonce. A verifier checks, in order, the holder's Agent and Owner delegation, the issuer's Card and signature, that the subject is the holder or someone the holder may represent, audience, purpose and challenge, expiry and status, and finally its own list of trusted issuers. Nobody searches for credential holders: an Index exposes at most a credential_type, and proof arrives at contact time as a presentation.
Appendix E. Changes in this revision (informative)
Kept beside this document as spec/CHANGELOG.md: every rule that moved since r6 and why, newest first. No implementer needs it to build; a reference to Appendix E anywhere in this package means that file.