<?xml version="1.0" encoding="UTF-8"?>
<rfc ipr="trust200902" docName="draft-huang-acme-scalable-agent-enrollment-00" category="std" submissionType="IETF" version="3" xmlns:xi="http://www.w3.org/2001/XInclude">
  <front>
    <title abbrev="Scalable Agent Enrollment">
      Extending Certificate Enrollment Protocols for Scalable Agentic AI Identity
    </title>
    
    <seriesInfo name="Internet-Draft" value="draft-huang-acme-scalable-agent-enrollment-00"/>
    
    <author fullname="Ken Huang" initials="K." surname="Huang">
        <organization>DistributedApps.ai</organization>
        <address>
            <email>ken.huang@DistributedApps.ai</email>
        </address>
    </author>
    
    <author fullname="Jerry Huang" initials="J." surname="Huang">
        <organization>Kleiner Perkins</organization>
        <address>
            <email>huangjerry03@gmail.com</email>
        </address>
    </author>
    
    <date day="14" month="June" year="2025" />
    
    <area>Security</area>
    <workgroup>RATS</workgroup>

    <abstract>
      <t>
        Agentic AI systems require robust, verifiable identities to operate securely. While traditional certificate enrollment protocols like SCEP and EST can be extended to include remote attestation evidence, performing a full validation for every agent's certificate request presents significant scalability and privacy challenges. This document proposes two distinct, scalable models for integrating attestation into the enrollment lifecycle. The first model leverages Zero-Knowledge Proofs (ZKP) to provide private, efficient, and continuous attestation. The second model uses a one-time, high-assurance bootstrapping process to establish a trusted host environment, which is then authorized to endorse certificate requests for the agents it runs. Both models enable high-assurance identity for AI agents while addressing the performance bottlenecks of naive per-enrollment verification.
      </t>
    </abstract>
  </front>

  <middle>
    <section anchor="introduction" numbered="true" toc="default">
      <name>Introduction</name>
      <t>
        The need for strong, verifiable identity for Agentic AI is well-established. Our related work, "Capability Attestation Extensions for the Entity Attestation Token (EAT)" <xref target="I-D.huang-rats-agentic-eat-cap-attest"/>, defines *what* an agent should attest to. This document addresses *how* an agent can obtain a certificate reflecting that attestation in a scalable and privacy-preserving manner.
      </t>
      <t>
        The naive approach of sending full attestation evidence with every SCEP or EST enrollment request is computationally expensive for the verifying Registration Authority (RA) and can expose sensitive details about the agent's software stack. This document reframes the problem to prioritize scalability, proposing two advanced enrollment models designed for large-scale, dynamic agent deployments. These models allow enterprises to leverage the automation of SCEP <xref target="RFC8894"/> and EST <xref target="RFC7030"/> without creating a performance or management bottleneck.
      </t>
    </section>

    <section anchor="terminology" numbered="true" toc="default">
      <name>Terminology and Conventions</name>
      <t>
        The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14.
      </t>
      <dl>
        <dt>Attestation-Aware RA:</dt>
        <dd>A Registration Authority, acting as a SCEP or EST server, capable of functioning as a RATS Verifier.</dd>
        <dt>Capability Certificate:</dt>
        <dd>An X.509 certificate containing extensions encoding verifiable claims about the subject's authorized capabilities.</dd>
        <dt>Host Endorser:</dt>
        <dd>A software service running on a trusted host that is authorized to sign or endorse certificate requests on behalf of the agents it manages.</dd>
        <dt>Attestation Circuit:</dt>
        <dd>A logical representation of a validation policy, encoded for use in a Zero-Knowledge Proof system.</dd>
      </dl>
    </section>

    <section anchor="problem-statement" numbered="true" toc="default">
      <name>Problem Statement: The Scalability Challenge of Per-Enrollment Attestation</name>
      <t>
        A single enterprise or cloud environment may run thousands or even millions of ephemeral AI agents. A centralized RA performing a full attestation validation for every single enrollment request faces three major, prohibitive issues:
      </t>
      <ul>
        <li>
          <strong>Performance Bottleneck:</strong> Validating complex evidence (e.g., checking multiple software hashes, validating endorsement chains) for every request creates a centralized bottleneck that cripples the system's ability to scale for dynamic, short-lived agents.
        </li>
        <li>
          <strong>Privacy Leakage:</strong> Transmitting detailed evidence to a central RA reveals the exact software versions, configurations, and libraries used by every agent, which can be a significant and undesirable information leak.
        </li>
        <li>
          <strong>Management Overhead:</strong> The RA must be constantly updated with the "golden measurements" for every valid agent configuration, making the system brittle and difficult to manage in environments with rapid development cycles.
        </li>
      </ul>
      <t>To be viable, any solution MUST address these challenges.</t>
    </section>

    <section anchor="proposed-models" numbered="true" toc="default">
      <name>Proposed Scalable Enrollment Models</name>
      <t>
        We propose two distinct models that leverage SCEP's automation while providing high-assurance identity. An implementation MAY support one or both models.
      </t>
      
      <section anchor="model-zkp" numbered="true" toc="default">
        <name>Model 1: Auto-Enrollment with Zero-Knowledge Proof Attestation</name>
        <t>
          This model uses a Zero-Knowledge Proof (ZKP) to allow an agent to prove it meets all attestation requirements without revealing the evidence itself. This provides an optimal balance of strong security, privacy, and performance.
        </t>
        <section numbered="false" toc="default">
          <name>Core Concept</name>
          <t>
            The RA does not validate the raw evidence. Instead, it validates a small, mathematically-sound proof that the agent possesses valid evidence satisfying a pre-defined set of rules.
          </t>
        </section>
        <section numbered="false" toc="default">
          <name>Specification and Steps</name>
          <t><strong>Phase 1: One-Time Trusted Setup (per Agent Fleet)</strong></t>
          <t>This phase is performed once by the entity deploying a fleet of similar agents.</t>
          <ol>
            <li>
              <t><strong>Define the Attestation Circuit:</strong> A ZKP circuit is created. This circuit is the formal specification of the validation policy. It MUST encode rules such as:</t>
              <ul>
                <li>The private input is a valid Entity Attestation Token (EAT).</li>
                <li>The EAT is signed by a trusted Endorser Public Key.</li>
                <li>The EAT contains a specific, required software measurement hash.</li>
                <li>The EAT's claims are bound to a public input representing the CSR's public key hash.</li>
              </ul>
            </li>
            <li>
              <t><strong>Generate Keys:</strong> A trusted setup ceremony is performed on the circuit to generate a <strong>Proving Key</strong> and a <strong>Verifying Key</strong>.</t>
              <ul>
                <li>The <strong>Proving Key</strong> MUST be securely distributed to every AI agent in the fleet.</li>
                <li>The <strong>Verifying Key</strong> MUST be securely provisioned to the Attestation-Aware RA.</li>
              </ul>
            </li>
          </ol>
          <t><strong>Phase 2: Automated Agent Enrollment (per Agent)</strong></t>
          <t>This is the fast, scalable, per-agent workflow.</t>
          <ol>
            <li><t><strong>Agent Initialization:</strong> The agent starts, generates a new key pair, and creates a CSR.</t></li>
            <li><t><strong>Evidence Collection:</strong> The agent collects its full attestation evidence (e.g., its EAT). This evidence REMAINS LOCAL and is not transmitted.</t></li>
            <li><t><strong>Proof Generation:</strong> The agent uses its <strong>Proving Key</strong> to execute the ZKP circuit. It provides its private evidence as private inputs and the hash of its CSR's public key as a public input. The output is a compact <strong>ZK-Proof</strong>.</t></li>
            <li><t><strong>SCEP Request:</strong> The agent initiates a SCEP request. The payload is a `multipart/mixed` object containing the standard CSR, the generated ZK-Proof, and its public inputs.</t></li>
            <li><t><strong>RA Verification:</strong> The RA receives the request. It performs a single, rapid ZKP verification using its <strong>Verifying Key</strong>. This validates that the agent possesses the correct private evidence without ever seeing it.</t></li>
            <li><t><strong>Certificate Issuance:</strong> If the proof is valid, the RA approves the request, and the CA issues the certificate.</t></li>
          </ol>
        </section>
      </section>

      <section anchor="model-bootstrap" numbered="true" toc="default">
        <name>Model 2: Bootstrapped Trust via Host Endorsement</name>
        <t>
          This model amortizes the cost of attestation. A full, heavyweight attestation is performed only **once** to enroll the host environment (e.g., a VM or server). That trusted host is then empowered to issue lightweight endorsements for the agents it runs.
        </t>
        <section numbered="false" toc="default">
          <name>Core Concept</name>
          <t>
            Instead of each agent proving its own integrity from scratch, it asks its already-trusted host to vouch for it. The RA's job is simplified to checking the host's "signature."
          </t>
        </section>
        <section numbered="false" toc="default">
          <name>Specification and Steps</name>
          <t><strong>Phase 1: One-Time Host Environment Bootstrap</strong></t>
          <t>This is the high-assurance setup performed once per host machine.</t>
          <ol>
            <li><t><strong>Initial Host Attestation:</strong> The host environment performs a full remote attestation using its hardware root of trust (e.g., a TPM). It sends its detailed evidence to a dedicated, high-security **Bootstrap RA**.</t></li>
            <li>
              <t><strong>Host Certificate Issuance:</strong> The Bootstrap RA validates the host's integrity. If successful, it instructs the CA to issue a special **Host Identity Certificate**. This certificate MUST have two key properties:</t>
              <ul>
                <li>A reasonably long lifetime (e.g., 1 year).</li>
                <li>A specific Extended Key Usage (EKU) OID, `id-kp-agentEnroller`, authorizing it to endorse agent certificate requests.</li>
              </ul>
            </li>
            <li><t><strong>Device-Bound Key Storage:</strong> The private key corresponding to the Host Identity Certificate **MUST** be stored in the host's hardware-backed, non-exportable key store.</t></li>
          </ol>
          <t><strong>Phase 2: Automated Agent Enrollment (per Agent)</strong></t>
          <t>This is the highly scalable workflow that occurs on the trusted host.</t>
          <ol>
            <li><t><strong>Agent Initialization:</strong> An AI agent starts on the trusted host, generates a new key pair, and creates a CSR.</t></li>
            <li><t><strong>Request for Endorsement:</strong> The agent sends its CSR to a local **Host Endorser** service.</t></li>
            <li><t><strong>Host Endorsement:</strong> The Host Endorser service uses the device-bound private key from the Host Identity Certificate to create a detached signature (e.g., a PKCS#7 signature) over the agent's CSR.</t></li>
            <li><t><strong>SCEP Request:</strong> The agent initiates a SCEP request to the standard **Agent RA**. The request payload includes its own CSR, the detached signature from the Host Endorser, and the public Host Identity Certificate.</t></li>
            <li>
              <t><strong>RA Verification (Simplified):</strong> The Agent RA performs two simple, fast checks:</t>
              <ul>
                <li>Does the provided signature over the CSR successfully verify using the public key from the Host Identity Certificate?</li>
                <li>Does the Host Identity Certificate contain the required `id-kp-agentEnroller` EKU and is it still valid?</li>
              </ul>
            </li>
            <li><t><strong>Certificate Issuance:</strong> If both checks pass, the RA approves the request, and the CA issues a standard, short-lived certificate to the agent.</t></li>
          </ol>
        </section>
      </section>
    </section>

    <section anchor="security-considerations" numbered="true" toc="default">
      <name>Security Considerations</name>
        <t>The security of this system relies on several key factors:</t>
      <ul>
        <li>
          <strong>Model 1 (ZKP):</strong> The primary security dependency is the integrity of the trusted setup and the secrecy of the <strong>Proving Key</strong>. If a Proving Key is compromised, an adversary can generate valid proofs for a malicious agent. Proving Keys MUST be protected as highly sensitive secrets. The ZKP circuit itself MUST be audited to ensure it correctly and completely represents the security policy.
        </li>
        <li>
          <strong>Model 2 (Host Endorsement):</strong> The security of this model hinges on the integrity of the host environment *after* bootstrapping. A compromise of the host could lead to the compromise of the <strong>Host Endorser's private key</strong>, allowing an attacker to endorse malicious agent CSRs. This risk is mitigated by: 1) storing the key in hardware (TPM), 2) implementing continuous host-level monitoring, and 3) issuing very short-lived certificates to agents, forcing frequent re-endorsement and providing an opportunity to detect anomalies.
        </li>
        <li>
          <strong>General:</strong> In both models, it is critical to bind the identity being requested (the CSR's public key) to the proof or endorsement being provided. This is handled explicitly as a public input in the ZKP model and by signing the full CSR in the Host Endorsement model.
        </li>
      </ul>
    </section>
    
    <section anchor="privacy-considerations" numbered="true" toc="default">
      <name>Privacy Considerations</name>
        <t>
            The two models presented have different privacy characteristics.
        </t>
        <ul>
            <li>
                The ZKP-based model (Model 1) offers strong privacy guarantees. The RA learns only that an agent has satisfied a specific policy, without learning any of the underlying evidence (e.g., software versions, configurations). This is the recommended approach for multi-tenant or privacy-sensitive environments.
            </li>
            <li>
                The Host Endorsement model (Model 2) relies on the privacy of the host. While agents do not reveal their details to the central RA, the Host Endorser service has visibility into every agent enrollment it endorses. Implementers MUST ensure the host environment and the Endorser service are sufficiently hardened to protect this local information.
            </li>
        </ul>
    </section>

    <section anchor="iana-considerations" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <t>
        This document requests IANA to make the following allocations:
      </t>
      <ol>
        <li>An Object Identifier (OID) for the `id-kp-agentEnroller` Extended Key Usage from the "SMI Security for PKIX Key Purpose" registry. This OID is required for Model 2 (Host Endorsement).</li>
        <li>(Optional/Transitional) An OID for a SCEP CSR attribute to carry ZKP data, under the `pkcs-9-at` registry, for implementations that do not use a multipart message format. TBD.</li>
      </ol>
    </section>
  </middle>

  <back>
    <references>
      <name>Normative References</name>
      <reference anchor="RFC7030" target="https://www.rfc-editor.org/info/rfc7030">
        <front>
          <title>Enrollment over Secure Transport</title>
          <author initials="M." surname="Pritikin" fullname="Max Pritikin"/>
          <author initials="P." surname="Wouters" fullname="Paul Wouters"/>
          <author initials="D." surname="Richardson" fullname="Michael Richardson"/>
          <author initials="T." surname="Turner" fullname="Sean Turner"/>
          <author initials="S." surname="Boeyen" fullname="Steve Boeyen"/>
          <date year="2013" month="October"/>
        </front>
      </reference>
      <reference anchor="RFC8894" target="https://www.rfc-editor.org/info/rfc8894">
        <front>
          <title>Simple Certificate Enrolment Protocol</title>
          <author initials="P." surname="Gutmann" fullname="Peter Gutmann"/>
          <date year="2020" month="September"/>
        </front>
      </reference>
    </references>
    <references>
      <name>Informative References</name>
      <reference anchor="I-D.huang-rats-agentic-eat-cap-attest">
        <front>
          <title>Capability Attestation Extensions for the Entity Attestation Token (EAT) in Agentic AI Systems</title>
          <author initials="K." surname="Huang"/>
          <author initials="J." surname="Huang"/>
          <date month="June" year="2025"/>
        </front>
      </reference>
    </references>
  </back>
</rfc>