Initial Peer Discovery
This document is non-normative. AITP does not define how Agent A first learns Agent B's hostname or AID. The protocol begins at the Agent Manifest (RFC-AITP-0003); everything before that is operational (RFC-AITP-0003 §12: a directory service "MAY be built on top of Manifests by the ecosystem").
This document lists the patterns we have seen work, and a single recommendation: whatever you choose, the Manifest is the trust root once found. Initial discovery may be untrusted; the cryptographic verification starts the moment a Manifest is fetched.
What "discovery" means here
Two distinct questions are often conflated:
- Bootstrap discovery — how does A learn that "Agent B" exists at
https://b.example.com? - Peer authentication — how does A know the entity at
https://b.example.com/.well-known/aitp-manifestis the agent A intended to talk to?
AITP only answers (2) — through the Manifest signature, the embedded aid, and the proof-of-possession over a publish-time challenge. (1) is left to deployment. The patterns below are how implementations have addressed (1).
Pattern 1: Out-of-band configuration (recommended starting point)
The simplest, most secure pattern for closed deployments.
peers:
worker-7:
manifest_url: https://worker-7.agents.example.com/.well-known/aitp-manifest
expected_aid: aid:pubkey:ed25519:O2onvM62pC1io6jQKm8Nc2UyFXcd4kOmOsBIoYtZ2ik
coordinator-1:
manifest_url: https://coordinator.agents.example.com/.well-known/aitp-manifest
expected_aid: aid:pubkey:ed25519:A6EHv_POEL4dcN0Y50vAmWfk1jCbpQ1fHdyGZBJVMbgTrust posture. An operator-curated allowlist. The expected_aid field is a deployment convention, not a protocol field; it is optional but recommended — it lets A reject a Manifest that has been served from the right hostname but with the wrong key (key-substitution under a compromised host).
AID forms. The example uses the algorithm-tagged form (aid:pubkey:ed25519:… or aid:pubkey:p256:…), which new AIDs SHOULD use. The legacy untagged form aid:pubkey:<43 chars> (the v0.1 grammar) remains valid indefinitely and means Ed25519; it is "canonically equivalent to aid:pubkey:ed25519:<same-identifier> for trust decisions" but not byte-equal, so compare expected_aid by key and algorithm rather than as a raw string (RFC-AITP-0001 §5.3).
When to use. Small ecosystems, regulated environments, anything where peers are explicitly partnered.
Trade-offs. Doesn't scale; every new peer requires configuration on every existing peer.
Pattern 2: DNS SRV record
The standard internet-protocol pattern. An organization publishes:
_aitp._tcp.example.com. 3600 IN SRV 10 5 443 worker-7.agents.example.com.A then fetches https://worker-7.agents.example.com/.well-known/aitp-manifest. (The _aitp._tcp label is a deployment convention; AITP does not register it.)
Trust posture. DNS resolution itself is not authenticated unless DNSSEC is in use. The Manifest's signature and PoP are the actual trust anchors — DNS just gets you to a hostname. An attacker who can spoof DNS still cannot forge a valid Manifest signature without the agent's private key. TLS-certificate validation is mandatory and pinning is RECOMMENDED for production (RFC-AITP-0003 §11.2).
When to use. Public agent ecosystems where organizations publish their own agents; cross-organization interop.
Trade-offs. Requires DNS access. SRV records have spotty client-library support. Scales linearly.
Pattern 3: Service registry / catalog
A directory service maintained by the ecosystem (or by an organization for its own agents). A queries the registry for "agents offering capability X" and gets back a list of (aid, manifest_url) pairs.
Trust posture. The registry is not part of the trust path. A treats every registry entry as untrusted until it has fetched and verified the corresponding Manifest. A compromised registry can introduce or hide agents but cannot impersonate one.
When to use. Larger ecosystems, capability-based routing, marketplaces.
Trade-offs. The registry itself is operational complexity. It needs its own auth and consistency story.
An existing implementation. The aitp-control-plane repository ships an API-only registry of this kind (with audit, revocation-list and webhook services) that sits outside the trust path; see its registry API.
What does not change across patterns
In all three patterns, the moment A has a candidate manifest_url, the AITP normative flow takes over. Perform every step, in order, and stop at the first failure. Steps 3–8 are RFC-AITP-0003 §5 steps 1–6; error codes are from RFC-AITP-0003 §10, plus the structural-rejection codes (MANIFEST_INVALID, UNKNOWN_FIELD) in registries/error-codes.md.
- Fetch the Manifest over HTTPS, validating the TLS certificate. Plain HTTP MUST be rejected. A non-2xx response, unreachable host, DNS or TLS failure means the Manifest could not be retrieved ⇒
MANIFEST_NOT_FOUND(retryable; RFC-AITP-0003 §4.1). - Unwrap. The well-known endpoint returns
{"manifest": {…}}; that wrapper is "the HTTP/transport envelope only". Verify the inner object (RFC-AITP-0003 §6.1). - Version check —
manifest.versionMUST be"aitp/0.3"(or a later version this implementation supports) ⇒ elseMANIFEST_VERSION_UNKNOWN. - Structural check — the Manifest MUST validate against
aitp-manifest.schema.json⇒ elseMANIFEST_INVALID. Then the member-set check: any member outside the §3 fields and outsideextensions⇒UNKNOWN_FIELD; unknown keys insideextensionsare ignored. Both run before any cryptography. - Expiry check —
manifest.expires_atMUST be in the future ⇒ elseMANIFEST_EXPIRED. - Proof-of-possession — verify
proof_of_possession.signatureagainst the public key inmanifest.aid⇒ elseMANIFEST_POP_FAILED. The signing input issha256(base64url_decode(challenge))— the decoded raw bytes, not the ASCII string (RFC-AITP-0001 §5.4.2). Getting this wrong is the "Manifest PoP Bypass" threat of RFC-AITP-0009 §1.11. - Manifest signature — verify
manifest.signatureagainst the same key over the canonical inner body withoutsignature⇒ elseMANIFEST_SIGNATURE_INVALID. - Identity-type / trust-anchor compatibility — screen the published Manifest against the fetching peer's own identity, before initiating the handshake. If the fetcher's identity is
oidc, the Manifest'saccepted_trust_anchorsMUST contain an issuer in the fetcher's owntrust_anchors⇒ elseINCOMPATIBLE_TRUST_ANCHORS. If the fetcher's identity ispinned_key(or any non-OIDC type), the Manifest'saccepted_identity_types(default["oidc"]when absent) MUST include the fetcher's type ⇒ elseINCOMPATIBLE_IDENTITY_TYPE. The two codes are distinct and not interchangeable.
Manifest verification does NOT include identity-proof verification. The Manifest carries identity_hint — static metadata declaring which identity provider the agent uses — not a verifiable JWT. Fresh identity proof is exchanged inline during the Mutual Handshake (RFC-AITP-0004 §5.1 step 6).
If any step fails, the candidate is rejected — regardless of how it was discovered. Cryptographic verification is the trust boundary.
A recommendation
Pick one discovery pattern per deployment and stick with it. Mixing patterns inside a single agent ecosystem leads to inconsistent operational posture (some peers have AID pinning, others don't; some go through DNSSEC, others don't). Consistency at the deployment layer makes incident response tractable.
For new deployments without an existing directory, start with Pattern 1 (out-of-band configuration). Move to Pattern 2 or 3 only when the operational cost of Pattern 1 exceeds the implementation cost of the alternative.
See also
- RFC-AITP-0003 Agent Manifest — what discovery hands you off to.
- RFC-AITP-0007 Key Resolution — Manifest caching and refresh.
- RFC-AITP-0009 Security — RFC-AITP-0009 §1.3 (Manifest tampering), RFC-AITP-0009 §1.4 (Manifest replay across agents), RFC-AITP-0009 §1.11 (Manifest PoP bypass).
- ecosystem.md — implementations, SDKs and the control-plane registry.