<?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.43 (Ruby 3.3.14) -->


<!DOCTYPE rfc  [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">

]>


<rfc ipr="trust200902" docName="draft-correa-oauth-aat-flow-labels-02" category="std" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true">
  <front>
    <title abbrev="AAT Flow Labels">Flow Labels for Attenuating Agent Tokens</title>

    <author initials="C. A. C." surname="Bezerra" fullname="Cleiton Augusto Correa Bezerra">
      <organization></organization>
      <address>
        <email>augusto.cleiton@gmail.com</email>
      </address>
    </author>

    <date year="2026" month="December" day="03"/>

    <area>Security</area>
    <workgroup>Web Authorization Protocol</workgroup>
    <keyword>agents</keyword> <keyword>delegation</keyword> <keyword>prompt injection</keyword> <keyword>information flow</keyword> <keyword>taint</keyword>

    <abstract>


<?line 34?>

<t>An agent that reads content an attacker wrote (a mail, a web page, a tool's
output) and then acts (sends, writes, pays) can be steered by that content.
Delegation tokens bound how much authority an agent holds; they say nothing
about what the agent has read. This document defines flow labels for
Attenuating Agent Tokens: per-tool marks that say a tool brings untrusted
content in (<spanx style="verb">taints</spanx>) or acts on the world (<spanx style="verb">clean_only</spanx>), and a narrower set of
argument constraints that still apply once the chain is tainted
(<spanx style="verb">when_tainted</spanx>). It specifies how an enforcement point records taint along a
delegation chain, how it decides a call from a tainted chain, how labels
attenuate across delegation, and what the decision records. Conformance
vectors are provided.</t>



    </abstract>



  </front>

  <middle>


<?line 48?>

<section anchor="introduction"><name>Introduction</name>

<t>The attacks on AI agents seen in practice share one shape: the agent reads
something an attacker controls, and then performs an action with authority the
attacker lacks. Filtering the content ("prompt injection detection") is a
contest the defender cannot win reliably, because the model's interpretation
of text is the attack surface. This document places the control on the action
instead, outside the model, and keys it to a fact the enforcement point can
observe without interpreting text: whether a holder in the delegation chain
has received the output of a tool marked as bringing untrusted content in.</t>

<t><xref target="AAT"></xref> gives each delegation step a signed, attenuating grant of tools and
argument constraints. This document adds a third dimension to "who holds the
token" and "what the token allows": what the holder has read. It reuses the
AAT constraint vocabulary and its attenuation discipline, and carries the
labels in an <spanx style="verb">authorization_details</spanx> entry <xref target="RFC9396"></xref>. A token that carries
these labels also marks the extension critical (<xref target="the-flow-entry"/>), so an
enforcement point that does not implement this document refuses the token
rather than verifying it as a plain AAT and acting on a call the labels would
have refused.</t>

<section anchor="conventions"><name>Conventions</name>

<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>" 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>

<?line -18?>

<dl>
  <dt>Holder:</dt>
  <dd>
    <t>The key a delegation token is bound to, identified by its JWK thumbprint URI <xref target="RFC7638"></xref>.</t>
  </dd>
  <dt>Chain:</dt>
  <dd>
    <t>The verified sequence of tokens from the root to the presented leaf.</t>
  </dd>
  <dt>Lineage:</dt>
  <dd>
    <t>The holders of every token in the chain.</t>
  </dd>
  <dt>Enforcement point:</dt>
  <dd>
    <t>The component that verifies a presentation and decides a tool call before the call reaches the tool.</t>
  </dd>
  <dt>Tainted:</dt>
  <dd>
    <t>A holder is tainted once the enforcement point has delivered to it, or to any chain it belongs to, the output of a tool labelled <spanx style="verb">taints</spanx>.</t>
  </dd>
</dl>

</section>
</section>
<section anchor="the-flow-entry"><name>The Flow Entry</name>

<t>A token carries flow labels in one <spanx style="verb">authorization_details</spanx> entry of type
<spanx style="verb">agent_flow</spanx>:</t>

<figure><sourcecode type="json"><![CDATA[
{
  "type": "agent_flow",
  "tools": {
    "get_emails_content": { "taints": true },
    "send_email": {
      "clean_only": true,
      "when_tainted": {
        "account_name": {
          "constraint_type": "one_of", "values": ["work"] },
        "recipients": {
          "constraint_type": "subset",
          "allowed": ["boss@corp.test"] },
        "subject":      { "constraint_type": "wildcard" },
        "body":         { "constraint_type": "wildcard" }
      }
    }
  }
}
]]></sourcecode></figure>

<dl>
  <dt><spanx style="verb">taints</spanx> (boolean, default false):</dt>
  <dd>
    <t>Output of this tool is untrusted content. When it is delivered, every holder in the lineage becomes tainted.</t>
  </dd>
  <dt><spanx style="verb">clean_only</spanx> (boolean, default false):</dt>
  <dd>
    <t>This tool acts on the world. A call from a chain whose lineage contains a tainted holder <bcp14>MUST</bcp14> be refused unless it satisfies <spanx style="verb">when_tainted</spanx> as specified in <xref target="decision"/>.</t>
  </dd>
  <dt><spanx style="verb">when_tainted</spanx> (object, default empty):</dt>
  <dd>
    <t>Argument name to an AAT constraint. It <bcp14>MUST NOT</bcp14> be present unless <spanx style="verb">clean_only</spanx> is true.</t>
  </dd>
</dl>

<t>A token <bcp14>MUST NOT</bcp14> carry more than one <spanx style="verb">agent_flow</spanx> entry. Unknown members <bcp14>MUST</bcp14>
cause the token to be rejected. Constraint nesting is bounded as in <xref target="AAT"></xref>.</t>

<t>A token that carries an <spanx style="verb">agent_flow</spanx> entry <bcp14>MUST</bcp14> also carry, in its JWS
protected header <xref target="RFC7515"></xref>, the Header Parameter <spanx style="verb">agent_flow</spanx> with the value
<spanx style="verb">true</spanx>, and <bcp14>MUST</bcp14> list the string "agent_flow" in the <spanx style="verb">crit</spanx> Header Parameter. An
enforcement point that does not implement this document therefore <bcp14>MUST</bcp14> reject
the token (<xref target="RFC7515"></xref>, Section 4.1.11), rather than verify it as a plain AAT
and act on a call the labels would have refused.</t>

<t>The constraints inside <spanx style="verb">when_tainted</spanx> use the AAT constraint vocabulary
unchanged. To pin a single value, use <spanx style="verb">one_of</spanx> with one member; this document
defines no new constraint.</t>

</section>
<section anchor="recording-taint"><name>Recording Taint</name>

<t>When the enforcement point delivers the output of a call to a tool labelled
<spanx style="verb">taints</spanx> in any link of the chain, it <bcp14>MUST</bcp14> record every holder of the lineage
as tainted, together with an identifier of the evidence (for example the
decision receipt of that call, <xref target="RECEIPTS"></xref>). It <bcp14>MUST</bcp14> record taint before the
output is returned, so that no later call can be decided on a state that
predates the content.</t>

<t>Taint <bcp14>MUST</bcp14> survive restarts of the enforcement point: a restart that cleared
taint would let an injected agent clear its own by crashing its client. An
implementation can rebuild the state from its decision records.</t>

<t>Taint is removed only by an authenticated human decision, which <bcp14>MUST</bcp14> itself be
recorded with the holder and the reason. Delegating to a fresh holder does not
remove it: a token derived from a tainted holder carries the tainted holder in
its lineage.</t>

</section>
<section anchor="decision"><name>Deciding a Call</name>

<t>After the AAT verification of the presentation succeeds, the enforcement point
determines the effective labels for the called tool. <spanx style="verb">taints</spanx> and <spanx style="verb">clean_only</spanx>
hold if any link of the chain sets them for the tool.</t>

<t>If <spanx style="verb">clean_only</spanx> holds and any holder of the lineage is tainted, the call is
permitted only if, for every link whose entry sets <spanx style="verb">clean_only</spanx> for the tool:</t>

<t><list style="numbers" type="1">
  <t>that link's <spanx style="verb">when_tainted</spanx> is non-empty; and</t>
  <t>every argument the call carries, other than those whose value is <spanx style="verb">null</spanx> or
an empty array, is named in that link's <spanx style="verb">when_tainted</spanx> and satisfies its
constraint.</t>
</list></t>

<t>Otherwise the call <bcp14>MUST</bcp14> be refused. The check runs on every such link, not
only the leaf: a link that does not mention the tool cannot let a later link
widen what an earlier one allowed.</t>

<t>The values in <spanx style="verb">when_tainted</spanx> are fixed by the issuer. An issuer <bcp14>SHOULD NOT</bcp14>
intend a rule such as "reply to the sender": the sender can be the attacker.</t>

</section>
<section anchor="attenuation"><name>Attenuation</name>

<t>A derived token's flow entry <bcp14>MUST NOT</bcp14> grant more than its parent's for any
tool. Verifiers <bcp14>MUST</bcp14> reject a chain in which, for some tool, a child:</t>

<t><list style="symbols">
  <t>drops <spanx style="verb">taints</spanx> or <spanx style="verb">clean_only</spanx> that its parent sets;</t>
  <t>sets a non-empty <spanx style="verb">when_tainted</spanx> while its parent sets <spanx style="verb">clean_only</spanx> with an empty <spanx style="verb">when_tainted</spanx>;</t>
  <t>names, in <spanx style="verb">when_tainted</spanx>, an argument its parent's non-empty <spanx style="verb">when_tainted</spanx> does not name; or</t>
  <t>carries a <spanx style="verb">when_tainted</spanx> constraint that is not subsumed by the parent's constraint for that argument, under the AAT subsumption rules.</t>
</list></t>

<t>A child <bcp14>MAY</bcp14> drop <spanx style="verb">when_tainted</spanx> (refusing the tool outright once tainted), and
<bcp14>MAY</bcp14> narrow any of its constraints.</t>

</section>
<section anchor="recording-the-decision"><name>Recording the Decision</name>

<t>A decision to permit a call from a tainted chain <bcp14>SHOULD</bcp14> record the evidence
identifier of the taint (<spanx style="verb">tainted_by</spanx>). A decision to refuse <bcp14>SHOULD</bcp14> record
which rule refused it. Implementations using <xref target="RECEIPTS"></xref> place these in the
receipt parameters.</t>

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

<t>The labels are only as good as the issuer's choice of which tools bring
content in. A file read can carry an injection as well as a web page.</t>

<t>Taint is coarse by design. It approximates "the agent read untrusted content"
by "the enforcement point delivered a <spanx style="verb">taints</spanx> output to this chain", which it
can observe without interpreting text. Per-value provenance would be finer but
depends on the model's cooperation, which is what the attacker controls.</t>

<t>Content that reaches the agent by any path outside the enforcement point does
not taint it. Deployments <bcp14>SHOULD</bcp14> route every tool through one enforcement
point, or share taint state between enforcement points; several enforcement
points with separate state each see only part of the sequence, and a read
through one can drive an action through another.</t>

<t>Persistent memory is a path that crosses sessions. A tool that writes to a
memory store later read by other sessions, other projects or other agents
<bcp14>SHOULD</bcp14> be labelled <spanx style="verb">clean_only</spanx>, and the tool that reads it back <bcp14>SHOULD</bcp14> be
labelled <spanx style="verb">taints</spanx>. Otherwise an injected agent can write an instruction to
memory while tainted, and a later, untainted session reads it back as its own
context and acts on it: taint is laundered through storage. The same holds for
any tool whose output reaches another holder outside the delegation chain
(shared files, tickets, queues). Where the memory store keeps its own records
of provenance, a write from a tainted chain <bcp14>SHOULD</bcp14> carry the <spanx style="verb">tainted_by</spanx>
evidence, so that a reader can tell what an untrusted read produced. A store
that raises the weight of an entry each time it is used <bcp14>SHOULD NOT</bcp14> let a tainted
chain raise it: an attacker's entry would otherwise reinforce itself.</t>

<t>An agent that can run commands as the user of the enforcement point can read
its keys and state. Run the enforcement point as a separate principal.</t>

</section>
<section anchor="privacy-considerations"><name>Privacy Considerations</name>

<t>Taint records identify holders and the calls that tainted them. They need not
contain the content read; a digest of the arguments is enough to bind a record
to a call.</t>

</section>
<section anchor="iana-considerations"><name>IANA Considerations</name>

<t>IANA is requested to register the following Header Parameter in the "JSON Web
Signature and Encryption Header Parameters" registry <xref target="RFC7515"></xref>:</t>

<t><list style="symbols">
  <t>Header Parameter Name: "agent_flow"</t>
  <t>Header Parameter Usage Location(s): JWS</t>
  <t>Change Controller: IETF</t>
  <t>Specification Document(s): this document</t>
</list></t>

<t><xref target="RFC9396"></xref> establishes no registry for <spanx style="verb">authorization_details</spanx> types, so the
<spanx style="verb">agent_flow</spanx> type defined here has no registry to go to; it is identified by
this document. <xref target="AAT"></xref> has the same open point for its own type.</t>

</section>


  </middle>

  <back>


<references title='References' anchor="sec-combined-references">

    <references title='Normative References' anchor="sec-normative-references">



<reference anchor="RFC9396">
  <front>
    <title>OAuth 2.0 Rich Authorization Requests</title>
    <author fullname="T. Lodderstedt" initials="T." surname="Lodderstedt"/>
    <author fullname="J. Richer" initials="J." surname="Richer"/>
    <author fullname="B. Campbell" initials="B." surname="Campbell"/>
    <date month="May" year="2023"/>
    <abstract>
      <t>This document specifies a new parameter authorization_details that is used to carry fine-grained authorization data in OAuth messages.</t>
    </abstract>
  </front>
  <seriesInfo name="RFC" value="9396"/>
  <seriesInfo name="DOI" value="10.17487/RFC9396"/>
</reference>
<reference anchor="RFC7638">
  <front>
    <title>JSON Web Key (JWK) Thumbprint</title>
    <author fullname="M. Jones" initials="M." surname="Jones"/>
    <author fullname="N. Sakimura" initials="N." surname="Sakimura"/>
    <date month="September" year="2015"/>
    <abstract>
      <t>This specification defines a method for computing a hash value over a JSON Web Key (JWK). It defines which fields in a JWK are used in the hash computation, the method of creating a canonical form for those fields, and how to convert the resulting Unicode string into a byte sequence to be hashed. The resulting hash value can be used for identifying or selecting the key represented by the JWK that is the subject of the thumbprint.</t>
    </abstract>
  </front>
  <seriesInfo name="RFC" value="7638"/>
  <seriesInfo name="DOI" value="10.17487/RFC7638"/>
</reference>
<reference anchor="RFC7515">
  <front>
    <title>JSON Web Signature (JWS)</title>
    <author fullname="M. Jones" initials="M." surname="Jones"/>
    <author fullname="J. Bradley" initials="J." surname="Bradley"/>
    <author fullname="N. Sakimura" initials="N." surname="Sakimura"/>
    <date month="May" year="2015"/>
    <abstract>
      <t>JSON Web Signature (JWS) represents content secured with digital signatures or Message Authentication Codes (MACs) using JSON-based data structures. Cryptographic algorithms and identifiers for use with this specification are described in the separate JSON Web Algorithms (JWA) specification and an IANA registry defined by that specification. Related encryption capabilities are described in the separate JSON Web Encryption (JWE) specification.</t>
    </abstract>
  </front>
  <seriesInfo name="RFC" value="7515"/>
  <seriesInfo name="DOI" value="10.17487/RFC7515"/>
</reference>

<reference anchor="AAT" target="https://datatracker.ietf.org/doc/draft-niyikiza-oauth-attenuating-agent-tokens/">
  <front>
    <title>Attenuating Authorization Tokens for Agentic Delegation Chains</title>
    <author initials="N." surname="Niyikiza" fullname="N. Niyikiza">
      <organization></organization>
    </author>
    <date year="n.d."/>
  </front>
</reference>


<reference anchor="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"/>
    <abstract>
      <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
    </abstract>
  </front>
  <seriesInfo name="BCP" value="14"/>
  <seriesInfo name="RFC" value="2119"/>
  <seriesInfo name="DOI" value="10.17487/RFC2119"/>
</reference>
<reference anchor="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"/>
    <abstract>
      <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
    </abstract>
  </front>
  <seriesInfo name="BCP" value="14"/>
  <seriesInfo name="RFC" value="8174"/>
  <seriesInfo name="DOI" value="10.17487/RFC8174"/>
</reference>



    </references>

    <references title='Informative References' anchor="sec-informative-references">

<reference anchor="RECEIPTS" target="https://datatracker.ietf.org/doc/draft-sahu-agent-action-receipts/">
  <front>
    <title>Agent Action Receipts</title>
    <author initials="S." surname="Sahu" fullname="S. Sahu">
      <organization></organization>
    </author>
    <date year="n.d."/>
  </front>
</reference>


    </references>

</references>


<?line 248?>

<section anchor="conformance-vectors"><name>Conformance Vectors</name>

<t>A suite of cases (<spanx style="verb">flow-labels-vectors-01.json</spanx>) gives, for one tool, the
labels each link sets (root first; <spanx style="verb">null</spanx> where a link does not mention the
tool), whether the lineage is tainted, a call, and the expected verdict. It
covers closed-world argument checks, absent values, checks on every link,
each attenuation rule, and malformed entries.</t>

</section>
<section anchor="implementation-status"><name>Implementation Status</name>

<t>CleiMesh (open source, MIT or Apache-2.0) implements these rules over AAT
chains, records decisions as <xref target="RECEIPTS"></xref> receipts, and agrees with all 20
conformance vectors. Its current encoding places the labels in its own
<spanx style="verb">authorization_details</spanx> entry alongside sandbox grants; moving them to
<spanx style="verb">agent_flow</spanx> is planned.</t>

</section>


  </back>


</rfc>

