<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<rfc xmlns:xi="http://www.w3.org/2001/XInclude"
     category="info"
     ipr="trust200902"
     submissionType="IETF"
     docName="draft-pioli-agent-discovery-00"
     xml:lang="en">
  <front>
    <title>Agent Registration and Discovery Protocol (ARDP)</title>
    <author fullname="Roberto Pioli" surname="Pioli" initials="R.">
      <organization>Independent</organization>
      <address>
        <email>roberto.pioli@gmail.com</email>
      </address>
    </author>
    <date year="2026" month="February"/>
    <abstract>
      <t>This document specifies the Agent Registration and Discovery Protocol (ARDP), a lightweight protocol for registering, discovering,
      and reaching autonomous software agents in distributed and federated environments. ARDP provides stable agent identities, dynamic endpoint
      resolution, capability advertisement (including protocol selection among MCP, A2A, HTTP, and gRPC), minimal presence signaling, and a
      security-first discovery control plane. ARDP is transport-agnostic and complementary to existing agent interaction protocols.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>Autonomous and semi-autonomous software agents introduce challenges in discoverability, reachability, and interoperability. Agents may
      be ephemeral, mobile across execution environments, and implemented by heterogeneous vendors.</t>
      <t>ARDP addresses stable addressing of agents whose runtime location changes, authorized discovery by identity and declared capabilities,
      capability-driven selection among interaction protocols (e.g., MCP, A2A, HTTP, gRPC), and minimal, privacy-aware presence signaling.</t>
    </section>

    <section title="Design Goals">
      <t>Stable Identity; Dynamic Reachability; Minimalism (control plane only); Security by Default; Federation-Friendly; Extensibility.</t>
    </section>

    <section title="Terminology">
      <t>The key words <bcp14>MUST</bcp14>, <bcp14>MUST NOT</bcp14>, <bcp14>REQUIRED</bcp14>, <bcp14>SHALL</bcp14>,
      <bcp14>SHALL NOT</bcp14>, <bcp14>SHOULD</bcp14>, <bcp14>SHOULD NOT</bcp14>, <bcp14>RECOMMENDED</bcp14>,
      <bcp14>NOT RECOMMENDED</bcp14>, <bcp14>MAY</bcp14>, and <bcp14>OPTIONAL</bcp14> are to be interpreted as described in RFC 2119 and RFC 8174.</t>
      <t><list style="symbols">
        <t>Agent: Autonomous software entity capable of initiating and receiving interactions.</t>
        <t>Agent Identifier (AID): Stable, namespaced identifier of the form <tt>agent:&lt;local-id&gt;@&lt;authority&gt;</tt>.</t>
        <t>Registrar: Service that accepts agent registrations and maintains bindings.</t>
        <t>Resolver: Service that resolves an AID to active endpoints.</t>
        <t>Endpoint: Network location and protocol tuple through which an agent can be reached.</t>
        <t>Capability: Declarative description of supported protocols and interaction modes.</t>
      </list></t>
    </section>

    <section title="Architecture Overview">
      <t>ARDP defines a logical control plane composed of registrars and resolvers. Agents register their presence and capabilities with a registrar.
      Authorized clients query resolvers to obtain endpoint and capability information.</t>
    </section>

    <section title="Agent Identity">
      <t>Each agent <bcp14>SHALL</bcp14> have a unique AID. The authority component denotes the administrative authority responsible for the identity.</t>
      <t>Agents <bcp14>MUST</bcp14> prove control of an AID during registration using cryptographic credentials bound to that identity.</t>

      <section title="AID Syntax">
        <t>An ARDP Agent Identifier (AID) <bcp14>MUST</bcp14> follow this grammar (ABNF per RFC 5234):</t>
        <figure>
          <artwork><![CDATA[
aid              = "agent:" local-id "@" authority
local-id         = 1*( ALPHA / DIGIT / "_" / "-" / "." / "/" )
authority        = dns-name / internal-name / opaque-authority
dns-name         = 1*( ALPHA / DIGIT / "-" / "." )  ; see IDNA2008 notes
internal-name    = 1*( ALPHA / DIGIT / "-" / "." )
opaque-authority = "tenant-" 1*( ALPHA / DIGIT / "-" )
]]></artwork>
        </figure>
        <t>Note: When internationalized domain names are used, implementers should follow the IDNA2008 RFC series.</t>
      </section>

      <section title="Canonical Form">
        <t>The canonical AID string is:</t>
        <t><list style="numbers">
          <t>The literal prefix <tt>agent:</tt> in lowercase.</t>
          <t>The authority normalized to lowercase (including IDNA2008 normalization where applicable); internal-name is lowercased as-is.</t>
          <t><tt>local-id</tt> is case-sensitive and <bcp14>MUST</bcp14> be preserved as sent.</t>
          <t>AIDs <bcp14>MUST</bcp14> be compared using the canonical form.</t>
        </list></t>
      </section>
    </section>

    <section title="Registration Model">
      <section title="REGISTER">
        <t>A REGISTER request includes: AID; one or more endpoints; capability document (versioned); TTL; and cryptographic proof.</t>
        <t>Registrations are soft-state and <bcp14>MUST</bcp14> be refreshed before expiration.</t>
      </section>

      <section title="DEREGISTER">
        <t>An agent <bcp14>MAY</bcp14> explicitly remove its registration.</t>
      </section>

      <section title="Registration Semantics">
        <t>Registration is idempotent on (<tt>aid</tt>, <tt>binding_id</tt>). If a client sends the same (<tt>aid</tt>, <tt>binding_id</tt>), the server
        <bcp14>MUST</bcp14> treat it as a refresh.</t>
        <t>If a client sends the same <tt>aid</tt> with a different <tt>binding_id</tt>, the server <bcp14>MUST</bcp14> return a conflict error unless the
        client has <tt>registry:override</tt> scope.</t>
      </section>

      <section title="TTL and Refresh">
        <t>The server <bcp14>MUST</bcp14> be authoritative for <tt>expires_at</tt> and <bcp14>SHOULD</bcp14> return it in responses.</t>
        <t>Clients <bcp14>SHOULD</bcp14> refresh at &lt;= 0.5 * ttl with random jitter.</t>
        <t>The server <bcp14>MUST</bcp14> define and enforce TTL bounds and advertise them in a metadata resource (recommended: <tt>/.well-known/ardp/meta</tt>).</t>
      </section>

      <section title="Meta Resource (Minimal)">
        <t>This section defines a minimal metadata resource for deployments using HTTPS bindings.</t>
        <t>Path: <tt>/.well-known/ardp/meta</tt></t>
        <t>The response includes TTL bounds and supported auth profiles:</t>
        <figure>
          <artwork><![CDATA[
{
  "ttl_min": 30,
  "ttl_max": 3600,
  "auth_profiles": ["jws-proof-of-control"],
  "supported_protocols": ["MCP","A2A","HTTP","gRPC"]
}
]]></artwork>
        </figure>
      </section>
    </section>

    <section title="Discovery and Resolution">
      <section title="RESOLVE">
        <t>RESOLVE maps an AID to active endpoints and capabilities. Access <bcp14>MUST</bcp14> be authorized.</t>
      </section>

      <section title="QUERY">
        <t>QUERY allows authorized discovery by capability or namespace. Results <bcp14>SHOULD</bcp14> be minimized to prevent metadata leakage.</t>
      </section>

      <section title="Privacy Defaults and Redaction">
        <t>By default, QUERY returns only <tt>aid</tt> and <tt>status</tt>. Clients <bcp14>MAY</bcp14> request full details via a <tt>detail=full</tt> parameter.</t>
        <t>If redaction applies, the server <bcp14>MUST</bcp14> omit restricted fields and include <tt>"redacted": true</tt> in the response.</t>
      </section>
    </section>

    <section title="Capabilities">
      <t>Capability documents <bcp14>MAY</bcp14> include supported protocols (MCP, A2A, HTTP, gRPC), transport bindings, authentication mechanisms,
      modalities, rate or cost hints, and protocol-specific metadata. Capabilities are declarative and do not imply authorization.</t>

      <section title="Capability Bindings">
        <t>Capabilities <bcp14>MUST</bcp14> include protocol-specific bindings when a protocol is declared.</t>
      </section>
    </section>

    <section title="Presence and Health">
      <t>Presence is limited to: <tt>online</tt>, <tt>offline</tt>, <tt>degraded</tt>.</t>
    </section>

    <section title="Security Considerations">
      <t>Threats include identity spoofing, registration poisoning, unauthorized discovery, replay and downgrade attacks, and registrar compromise.</t>
      <t>Mitigations include cryptographic identity proof, signed registrations, strict authorization, rate limiting, and audit logging.</t>

      <section title="Proof of Control (Mandatory Profile)">
        <t>Clients <bcp14>MUST</bcp14> present a JWS-signed proof for register and refresh.</t>
        <t>The signed payload is the canonical JSON of the registration body plus a server-provided nonce and an <tt>issued_at</tt> timestamp (RFC 3339).</t>
        <t>Servers <bcp14>MUST</bcp14> verify the JWS using a JWKS key set (RFC 7517). Replay windows <bcp14>MUST</bcp14> be enforced.</t>
      </section>

      <section title="Authorization Scopes">
        <t>Operations require scopes such as: <tt>registry:register</tt>, <tt>registry:refresh</tt>, <tt>registry:resolve</tt>, <tt>registry:query</tt>, and <tt>registry:deregister</tt>.</t>
      </section>
    </section>

    <section title="Federation">
      <t>Registrars <bcp14>MAY</bcp14> federate across domains via explicit trust relationships and policy agreements.</t>

      <section title="Federation Profile (Minimum)">
        <t>Federation is allowed only between explicit trust anchors.</t>
        <t>Responses from remote registrars <bcp14>MUST</bcp14> include provenance fields: <tt>origin_authority</tt>, <tt>origin_registrar_id</tt>, <tt>origin_signature</tt>.</t>
        <t>Caches <bcp14>MUST</bcp14> honor remote TTL and mark records as federated.</t>
      </section>
    </section>

    <section title="Relationship to Existing Protocols">
      <t>ARDP complements, and does not replace, agent interaction protocols such as MCP and A2A.</t>
    </section>

    <section title="Wire Format Sketch (Non-Normative)">
      <t>JSON over HTTPS is shown as an example binding. Alternative encodings (e.g., CBOR, gRPC) are possible.</t>

      <section title="Error Model">
        <t>Servers <bcp14>MUST</bcp14> return errors with: <tt>code</tt> (stable error code), <tt>message</tt> (human-readable), and <tt>correlation_id</tt> (for tracing).</t>
        <t>Required codes: <tt>invalid_aid</tt>, <tt>unauthorized</tt>, <tt>forbidden</tt>, <tt>conflict</tt>, <tt>not_found</tt>, <tt>expired</tt>.</t>
      </section>
    </section>

    <section title="IANA Considerations">
      <section title="Well-Known URI">
        <t>IANA is requested to register the following URI suffix per RFC 8615 in the "Well-Known URIs" registry:</t>
        <t>URI suffix: <tt>ardp</tt></t>
        <t>Change controller: IETF</t>
        <t>Specification document(s): This document</t>
      </section>

      <section title="Agent Identifier Namespace">
        <t>The <tt>agent:</tt> prefix is used as an internal identifier namespace and is not registered as a URI scheme in this version.</t>
      </section>
    </section>

    <section title="Capability Schema v0">
      <t>A minimal JSON schema for capability documents is provided as a companion artifact in the GitHub mirror.</t>
    </section>

    <section title="Open Issues">
      <t>Capability schema evolution; Privacy-preserving discovery; Federation bootstrapping.</t>
    </section>
  </middle>

  <back>
    <references>
      <reference anchor="RFC2119">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author surname="Bradner" initials="S."/>
          <date year="1997"/>
        </front>
      </reference>
      <reference anchor="RFC8174">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author surname="Leiba" initials="B."/>
          <date year="2017"/>
        </front>
      </reference>
      <reference anchor="RFC3339">
        <front>
          <title>Date and Time on the Internet: Timestamps</title>
          <author surname="Klyne" initials="G."/>
          <author surname="Newman" initials="C."/>
          <date year="2002"/>
        </front>
      </reference>
      <reference anchor="RFC5234">
        <front>
          <title>Augmented BNF for Syntax Specifications: ABNF</title>
          <author surname="Crocker" initials="D."/>
          <author surname="Overell" initials="P."/>
          <date year="2008"/>
        </front>
      </reference>
      <reference anchor="RFC5890">
        <front>
          <title>Internationalized Domain Names for Applications (IDNA): Definitions and Document Framework</title>
          <author surname="Klensin" initials="J."/>
          <date year="2010"/>
        </front>
      </reference>
      <reference anchor="RFC7515">
        <front>
          <title>JSON Web Signature (JWS)</title>
          <author surname="Jones" initials="M."/>
          <author surname="Bradley" initials="J."/>
          <author surname="Sakimura" initials="N."/>
          <date year="2015"/>
        </front>
      </reference>
      <reference anchor="RFC7517">
        <front>
          <title>JSON Web Key (JWK)</title>
          <author surname="Jones" initials="M."/>
          <author surname="Bradley" initials="J."/>
          <author surname="Sakimura" initials="N."/>
          <date year="2015"/>
        </front>
      </reference>
      <reference anchor="RFC8615">
        <front>
          <title>Well-Known Uniform Resource Identifiers (URIs)</title>
          <author surname="Nottingham" initials="M."/>
          <date year="2019"/>
        </front>
      </reference>
    </references>
  </back>
</rfc>
