<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude"
     ipr="trust200902"
     docName="draft-rust-trp-00"
     category="std"
     submissionType="IETF"
     consensus="true"
     tocInclude="true"
     sortRefs="true"
     symRefs="true"
     version="3">

  <front>
    <title abbrev="TRP">Transparency Record Protocol for AI Governance</title>

    <seriesInfo name="Internet-Draft" value="draft-rust-trp-00"/>

    <author fullname="Pierre Rust" initials="P." surname="Rust">
      <organization>Clearpath Intelligence</organization>
      <address>
        <email>pierre.rust@clearpathintel.com</email>
      </address>
    </author>

    <date year="2025" month="December"/>

    <area>Applications and Real-Time</area>
    <workgroup>Internet Engineering Task Force</workgroup>

    <keyword>AI</keyword>
    <keyword>transparency</keyword>
    <keyword>governance</keyword>
    <keyword>audit</keyword>

    <abstract>
      <t>
        This document specifies the Transparency Record Protocol (TRP), an
        application-layer protocol for propagating AI transparency metadata
        across distributed systems. TRP enables organizations to maintain
        cryptographic chain of custody for AI-generated content, enforce
        governance policies at network boundaries, and provide verifiable
        audit trails for regulatory compliance.
      </t>
    </abstract>
  </front>

  <middle>
    <section anchor="introduction">
      <name>Introduction</name>
      <t>
        The rapid deployment of AI systems across critical infrastructure
        requires standardized mechanisms for transparency and accountability.
        Current approaches rely on application-specific logging that cannot
        be verified across organizational boundaries.
      </t>
      <t>
        The Transparency Record Protocol (TRP) addresses this gap by providing:
      </t>
      <ul>
        <li>Cryptographically signed audit trails for AI decisions</li>
        <li>Zero-trust identity verification using X.509 PKI</li>
        <li>Network-boundary policy enforcement via inspection headers</li>
        <li>Extensible metadata for quality metrics and governance frameworks</li>
      </ul>
      <t>
        TRP is designed to integrate with existing HTTP infrastructure
        through custom headers, requiring no changes to application payloads.
      </t>
    </section>

    <section anchor="conventions">
      <name>Conventions and Definitions</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 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and
        only when, they appear in all capitals, as shown here.
      </t>

      <section anchor="terms">
        <name>Terminology</name>
        <dl>
          <dt>TRP Record</dt>
          <dd>A JSON document containing transparency metadata for
            a single request-response cycle or streaming session.</dd>
          <dt>Entity</dt>
          <dd>A service, system, or organization identified by a
            Decentralized Identifier (DID) and authenticated via X.509
            certificate chain.</dd>
          <dt>Processing Step</dt>
          <dd>A single hop in the request processing chain,
            recorded with timestamp and cryptographic signature.</dd>
          <dt>Composite Confidence</dt>
          <dd>A cumulative trust score that decays as
            a record propagates across organizational boundaries.</dd>
        </dl>
      </section>
    </section>

    <section anchor="overview">
      <name>Protocol Overview</name>
      <t>
        TRP operates as an overlay protocol on HTTP/1.1 and HTTP/2. Each
        HTTP request carrying TRP metadata includes:
      </t>
      <ol>
        <li>A compressed context header containing the full TRP record</li>
        <li>An uncompressed inspection header for fast firewall decisions</li>
        <li>A signature header containing the most recent cryptographic signature</li>
      </ol>
      <t>
        Upon receiving a TRP-enabled request, a compliant service:
      </t>
      <ol>
        <li>Validates the signature chain</li>
        <li>Verifies entity identity against allow-lists</li>
        <li>Checks security clearance compatibility</li>
        <li>Enforces governance requirements</li>
        <li>Appends its own processing step and signature</li>
        <li>Forwards the updated record</li>
      </ol>
    </section>

    <section anchor="headers">
      <name>Header Transport</name>
      <t>TRP-compliant HTTP messages MUST include the following headers:</t>

      <section anchor="context-header">
        <name>X-Transparency-Context</name>
        <t>Contains the Base64-encoded, zstd-compressed JSON TRP record.</t>
        <artwork><![CDATA[
X-Transparency-Context: <base64-zstd-json>
        ]]></artwork>
      </section>

      <section anchor="protocol-header">
        <name>X-Transparency-Protocol</name>
        <t>Indicates the TRP version.</t>
        <artwork><![CDATA[
X-Transparency-Protocol: TRP/1.1
        ]]></artwork>
      </section>

      <section anchor="signature-header">
        <name>X-Transparency-Signature</name>
        <t>Contains the Ed25519 signature of the current record state.</t>
        <artwork><![CDATA[
X-Transparency-Signature: <base64-signature>
        ]]></artwork>
      </section>

      <section anchor="inspection-header">
        <name>X-Transparency-Inspection</name>
        <t>Contains an uncompressed JSON summary for inline firewall evaluation.</t>
        <artwork><![CDATA[
X-Transparency-Inspection: {"record_id":"...","security_level":"SECRET"}
        ]]></artwork>
      </section>
    </section>

    <section anchor="record-structure">
      <name>Record Structure</name>
      <t>The TRP record is a JSON object with the following top-level fields:</t>

      <section anchor="record-header">
        <name>Record Header</name>
        <dl>
          <dt>protocol</dt>
          <dd>REQUIRED. String. Must be "TRP/1.1".</dd>
          <dt>id</dt>
          <dd>REQUIRED. String. UUID v4 identifying this record.</dd>
          <dt>correlation_id</dt>
          <dd>OPTIONAL. String. UUID linking related records.</dd>
          <dt>started_at</dt>
          <dd>REQUIRED. String. ISO 8601 timestamp.</dd>
          <dt>validity</dt>
          <dd>OPTIONAL. Object containing freshness constraints.</dd>
        </dl>
      </section>

      <section anchor="entity-context">
        <name>Entity Context</name>
        <t>The entity_context object identifies the originating service:</t>
        <dl>
          <dt>organization</dt>
          <dd>REQUIRED. String. DID of the organization.</dd>
          <dt>service_id</dt>
          <dd>REQUIRED. String. Unique service identifier.</dd>
          <dt>certificate_chain</dt>
          <dd>REQUIRED. Array of Base64-encoded X.509 certificates.</dd>
        </dl>
      </section>

      <section anchor="security-context">
        <name>Security Context</name>
        <t>The security_context object defines access control:</t>
        <dl>
          <dt>domain</dt>
          <dd>REQUIRED. String. Security domain identifier.</dd>
          <dt>level</dt>
          <dd>REQUIRED. String. Classification level.</dd>
          <dt>previous_level</dt>
          <dd>OPTIONAL. String. Prior classification.</dd>
          <dt>update_reason</dt>
          <dd>OPTIONAL. String. Reason for level change.</dd>
        </dl>
      </section>

      <section anchor="governance-context">
        <name>Governance Context</name>
        <t>The governance_context object identifies compliance frameworks:</t>
        <dl>
          <dt>frameworks_applied</dt>
          <dd>REQUIRED. Array of framework identifiers.</dd>
          <dt>policy_version</dt>
          <dd>REQUIRED. String. Policy version.</dd>
          <dt>compliance_assertions</dt>
          <dd>OPTIONAL. Array of compliance claims.</dd>
        </dl>
      </section>
    </section>

    <section anchor="signature-chain">
      <name>Signature Chain</name>
      <t>
        TRP uses a cumulative signature chain to ensure tamper evidence.
        Each processing step appends a signature covering:
      </t>
      <ol>
        <li>The hash of all previous content (SHA-256)</li>
        <li>The current processing step data</li>
        <li>A timestamp</li>
      </ol>
      <t>
        The signature algorithm MUST be Ed25519 as specified in
        <xref target="RFC8032"/>.
      </t>
      <t>
        Signature verification MUST validate the entire chain from origin
        to the current step. Any invalid signature indicates tampering.
      </t>
    </section>

    <section anchor="policy-enforcement">
      <name>Policy Enforcement</name>
      <t>TRP-compliant firewalls SHOULD implement the following checks:</t>
      
      <section anchor="integrity-check">
        <name>Integrity Verification</name>
        <t>Validate all signatures in the chain.</t>
      </section>

      <section anchor="freshness-check">
        <name>Freshness Verification</name>
        <t>Check that validity.expires_at has not passed.</t>
      </section>

      <section anchor="identity-check">
        <name>Identity Verification</name>
        <t>Verify entity_context.organization is in the allow-list.</t>
      </section>

      <section anchor="clearance-check">
        <name>Clearance Verification</name>
        <t>Verify security_context.level does not exceed local clearance.</t>
      </section>

      <section anchor="governance-check">
        <name>Governance Verification</name>
        <t>Verify required frameworks are present in governance_context.</t>
      </section>

      <section anchor="egress-check">
        <name>Egress Verification</name>
        <t>Verify destination is in egress_context.authorized_recipients.</t>
      </section>
    </section>

    <section anchor="security">
      <name>Security Considerations</name>

      <section anchor="crypto-strength">
        <name>Cryptographic Strength</name>
        <t>
          TRP relies on Ed25519 signatures and SHA-256 hashes. These
          algorithms are considered secure as of this writing.
        </t>
      </section>

      <section anchor="replay-attacks">
        <name>Replay Attacks</name>
        <t>
          The validity.expires_at field provides replay protection.
          Receivers SHOULD reject records with expired timestamps.
        </t>
      </section>

      <section anchor="key-management">
        <name>Key Management</name>
        <t>
          Entity private keys MUST be stored in hardware security modules
          (HSMs) or equivalent secure enclaves in production deployments.
        </t>
      </section>

      <section anchor="dos">
        <name>Denial of Service</name>
        <t>
          Large TRP records may be used for DoS attacks. Implementations
          SHOULD enforce maximum record sizes (RECOMMENDED: 64KB compressed).
        </t>
      </section>
    </section>

    <section anchor="iana">
      <name>IANA Considerations</name>
      <t>This document requests registration of the following HTTP headers:</t>
      <ul>
        <li>X-Transparency-Context</li>
        <li>X-Transparency-Protocol</li>
        <li>X-Transparency-Signature</li>
        <li>X-Transparency-Inspection</li>
        <li>X-Transparency-Rejection</li>
        <li>X-Transparency-Rejection-Reason</li>
        <li>X-Transparency-Rejection-Policy</li>
        <li>X-Transparency-Rejection-Details</li>
      </ul>
    </section>
  </middle>

  <back>
    <references>
      <name>References</name>

      <references>
        <name>Normative References</name>

        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
        </reference>

        <reference anchor="RFC8032" target="https://www.rfc-editor.org/info/rfc8032">
          <front>
            <title>Edwards-Curve Digital Signature Algorithm (EdDSA)</title>
            <author fullname="S. Josefsson" initials="S." surname="Josefsson"/>
            <author fullname="I. Liusvaara" initials="I." surname="Liusvaara"/>
            <date month="January" year="2017"/>
          </front>
          <seriesInfo name="RFC" value="8032"/>
        </reference>

        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
        </reference>
      </references>

      <references>
        <name>Informative References</name>

        <reference anchor="NIST-AI-RMF">
          <front>
            <title>AI Risk Management Framework</title>
            <author>
              <organization>National Institute of Standards and Technology</organization>
            </author>
            <date month="January" year="2023"/>
          </front>
        </reference>

        <reference anchor="EU-AI-ACT">
          <front>
            <title>Regulation on Artificial Intelligence</title>
            <author>
              <organization>European Parliament</organization>
            </author>
            <date year="2024"/>
          </front>
        </reference>
      </references>
    </references>

    <section anchor="abnf">
      <name>ABNF Grammar</name>
      <t>The following ABNF grammar defines the TRP header format:</t>
      <artwork><![CDATA[
TRP-Context-Header   = "X-Transparency-Context" ":" SP Base64-Value
TRP-Protocol-Header  = "X-Transparency-Protocol" ":" SP "TRP/" Version
TRP-Signature-Header = "X-Transparency-Signature" ":" SP Base64-Value
TRP-Inspection-Header = "X-Transparency-Inspection" ":" SP JSON-Object

Version      = 1*DIGIT "." 1*DIGIT
Base64-Value = 1*( ALPHA / DIGIT / "+" / "/" / "=" )
JSON-Object  = "{" *( JSON-Member ) "}"

Security-Level = "PUBLIC" / "INTERNAL" / "CONFIDENTIAL" /
                 "RESTRICTED"

DID                = "did:" Method ":" Method-Specific-ID
Method             = 1*ALPHA
Method-Specific-ID = 1*( ALPHA / DIGIT / "." / "-" / "_" / ":" )
      ]]></artwork>
    </section>

    <section anchor="examples">
      <name>Example Records</name>
      
      <section anchor="minimal-example">
        <name>Minimal Valid Record</name>
        <artwork type="json"><![CDATA[
{
  "protocol": "TRP/1.1",
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "started_at": "2025-12-17T14:30:00Z",
  "entity_context": {
    "organization": "did:web:example.gov",
    "service_id": "gateway",
    "certificate_chain": ["MIIB..."]
  },
  "security_context": {
    "domain": "COMMERCIAL",
    "level": "PUBLIC"
  },
  "signatures": []
}
        ]]></artwork>
      </section>
    </section>

    <section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>
        The author would like to thank the AI governance and security
        communities for their input on this specification.
      </t>
    </section>
  </back>
</rfc>
