Skip to content

A resource must retain person tokens to issue a step-up or per-call resource token #90

Closed as not planned

Description

@dickhardt

A resource cannot populate a REQUIRED claim of a resource token it is explicitly permitted — and under R3, routinely expected — to issue.

The conflict

  1. Every resource token needs a person token behind it. §Person Token: "A resource MUST have verified a person token before it issues a resource token, and MUST challenge with requirement=person-token when it has not."

  2. Three of its claims come from that person token. §Resource Token Structure makes ps, sub, and person_token_jti all REQUIRED, and defines each as copied from the person token the resource verified — person_token_jti being "the jti of that person token, binding this resource token to it."

  3. But a resource MAY challenge a request that carries an auth token. §Resource Token: "A resource MAY return requirement=auth-token with a new resource token to a request that already includes an auth token — for example, when the request requires a higher level of authorization than the current token provides. Agents MUST be prepared for this step-up authorization at any time."

R3 turns (3) from an occasional step-up into the normal path. §Resource Enforcement: an r3_per_call match means "build a per-call proposal and return AAuth-Requirement with a resource token referencing it." That challenge happens at call time, on a request that by definition carries an auth token — the agent needed one to reach enforcement at all.

At that moment the agent is presenting an auth token. §Auth Token Structure gives it ps and sub, but no person_token_jti — the claim is not in the auth token's required or optional list. The resource has two of the three values it needs and no defined way to obtain the third.

Three readings, all consistent with the current text

  • The resource retains a record of every person token it verifies, keyed so it can recover the jti later. This makes "MUST have verified" mean "at any point in the past", and hands every resource a storage requirement the specification never states.
  • The resource challenges requirement=person-token again before it can challenge for the step-up. This makes "MUST have verified" mean "on this request", and costs an extra round trip on every per-call invocation.
  • The auth token's ps/sub are meant to suffice for a step-up, and person_token_jti is conditional in a way §Resource Token Structure does not say.

The first is the only reading that keeps per-call usable for unattended work. §Operation Access Annotations describes per-call as how "an agent planning unattended work identifies the operations that will block on a person"; if every per-call invocation additionally forces a person-token round trip, the extra latency lands on exactly the operations that are already the expensive ones. The reference implementation takes this reading: it keeps a record per (ps, sub, agent key, mission) with a TTL equal to the person token's own exp, and recovers the jti from it when building a per-call or step-up resource token.

This is #87 arriving at the other party

#87 is the same unstated-persistence problem on the PS side: §Resource Token Verification step 6 requires a PS to "look up the person token identified by person_token_jti among those it issued", which silently makes every PS stateful about issued tokens.

This issue is the resource-side mirror. One person token now implies retained state at both ends of its life — the PS that issued it and the resource that verified it — and the document states neither. That symmetry suggests the fix belongs in one place covering both parties, rather than two separate paragraphs in two separate sections: what each party retains, for how long, and keyed by what.

Knock-on for mission stripping

person_token_jti exists so the PS can detect mission stripping. §Resource Token Verification: "Binding the resource token to one person token by jti is what makes mission stripping detectable. A resource cannot drop mission_s256 and present the result as an unscoped request, because the PS resolves the person token it actually issued and compares."

Under the retention reading, a resource replays a jti from its own record rather than from a token in hand. The PS's check still passes and the property still holds — but only because the resource kept the record honestly, pairing the jti with the mission_s256 that person token actually carried. A resource that retained a jti while losing track of which mission it belonged to could pair a mission-bearing jti with a stripped resource token and the PS's comparison would catch it, which is the desired outcome; a resource that kept several records and picked the wrong one produces a spurious rejection. Whatever text resolves this should say that the retained record is the whole tuple, not the jti alone.

Activity

  1. dickhardt commented on Aug 11, 2026

    @dickhardt
    OwnerAuthor

    Proposed resolution (from the document author)

    The claim names the jti of whatever credential the resource verified on the request that produced the resource token — not specifically a person token. Rename it accordingly.

    Today person_token_jti hardcodes one credential type into a claim whose job is more general: to name the credential the resource had in hand, so the recipient can resolve it and compare. On a first authorization that credential is a person token. On a step-up or an R3 per-call challenge it is an auth token. The claim should say "the thing I verified", and the resource should always have one, because -11 already requires it.

    This dissolves the issue rather than answering the three readings — the question "how does the resource recover a jti it no longer holds" stops arising, because it names the jti of the credential in its hand.

    Why an auth token works as the carrier

    §Auth Token Structure carries ps, sub, mission_s256, and tenant — all four of the claims §Resource Token Verification step 6 compares.

    §Person Token Structure carries sub, mission_s256, and tenant, but not ps; its iss is the PS. So for this particular check an auth token is a strictly richer carrier than a person token, stating ps explicitly where a person token only implies it through its issuer. Generalizing the claim is not a widening that has to be defended — the case being added is the better-specified of the two.

    The anti-stripping property is preserved

    The mechanism is unchanged: the recipient resolves a token it issued under the named jti and compares the same four claims. What made the property work was never that the credential was a person token; it was that the recipient could resolve the token authoritatively rather than take the resource's word for the claims.

    (iss, jti) identifies a token within an issuer's namespace — the rule -10 established for revocation ("A jti is unique only within the namespace of the issuer that minted it... Recipients maintaining revocation state MUST key it by (iss, jti)"). Here the recipient is the issuer, so the jti alone suffices and the pair is already the document's established way of naming a token.

    It improves the four-party case

    Step 6 currently gives the AS a materially weaker check than the PS:

    A PS MUST look up the person token identified by person_token_jti among those it issued, and MUST verify that ps, sub, mission_s256, and tenant match that token exactly... An AS MUST verify that ps names the PS that sent the token request.

    The asymmetry is forced: the resource token names a token the PS issued, which the AS has no way to resolve, so the AS is left checking a routing fact instead of comparing claims.

    Under the generalized rule a step-up in four-party names an auth token the AS issued itself. The AS can then perform the same full comparison the PS does. The first authorization in four-party still names a PS-issued person token and keeps the weaker check, so this does not close the asymmetry entirely — but it closes it exactly where R3 per-call operates, which is the case this issue is about, and per-call is the path where the check runs most often.

    Two constraints on the fix

    The name cannot be bare jti. The resource token already defines its own jti for replay detection, audit, and revocation. The new claim needs a distinct name. presented_jti reads well — "presents" is the document's own verb for what an agent does with a credential via Signature-Key (§Person Token Usage, §Auth Token Usage), so the name says which of the two tokens in play it refers to.

    Scope it to credentials carrying the person's identity — a person token or an auth token, not an agent token. An agent token has no sub and no mission_s256, so naming one would leave step 6 comparing nothing: the anti-stripping property would evaporate silently rather than fail loudly, which is the worst failure mode for a defence of this kind. -11 already forbids issuing a resource token without a verified person token behind it (§Person Token: "A resource MUST have verified a person token before it issues a resource token"), so the restriction costs nothing that is currently legal.

    Knock-on: step 6 needs rewording in the same edit

    Step 6 is phrased for one credential type — "look up the person token identified by person_token_jti among those it issued". Generalized, the recipient looks up whichever token it issued under that jti, whatever its type.

    Worth doing as part of this change rather than after: once both PS and AS resolve a token they issued and compare the same four claims, the PS/AS split in the step's last sentence may collapse into a single rule, with the AS's weaker ps-names-the-sender check surviving only as the fallback for a first authorization in four-party, where the named token is not the AS's. That is a simpler step 6 than the one there now, and leaving it phrased around person tokens would hide the simplification.

    Relationship to #87

    #87 is the PS-side retention obligation and is not resolved by this. A PS still has to resolve a token it issued, so it still needs the record, and the retention floor, error-code, and keying questions in #87 all stand.

    What changes is that the problem stops being symmetric. Under the current text both parties need retention; under this proposal only the issuer does — which is the party that already has a reason to keep issuance records, and the only one that can resolve a token authoritatively. The resource is out of it entirely.

  2. dickhardt commented on Aug 12, 2026

    @dickhardt
    OwnerAuthor

    Closing: the premise is wrong

    Worth saying plainly rather than closing quietly, because three implementations built person-token retention and none of them had to. The ergonomics push that way; the document does not require it. The issue asserted that a resource is forced into unstated retention, and that is not so.

    Three things dissolve it.

    1. A resource may simply re-challenge

    This is the correction that matters most, and the issue as filed did not consider it.

    On a step-up or per-call invocation carrying an auth token, a resource that has no person token in hand can answer requirement=person-token. The agent presents one on the retry, and the resource mints the resource token from the credential it now holds. Two round trips, zero retention, fully conformant against the text as it stands today.

    The issue listed this as its second reading and dismissed it on cost — "an extra round trip on every per-call invocation". But cost is not conformance. Retention is an optimisation that saves a round trip, and a resource is free to decline it. That makes the three readings not a genuine ambiguity but a choice the document already permits, with one branch cheaper than the other. Nothing is unstated; nothing is forced.

    2. presented_jti covers the rest

    The proposal above generalizes the claim to name whatever credential the resource verified on the request that produced the resource token.

    The supporting fact is stronger in -11 than it was: §Auth Token Structure makes sub a REQUIRED payload claim. scope is optional, and the older "one of sub or scope" rule is gone from the document entirely. So an auth token carries ps + sub + cnf — everything a person token carries for this purpose, plus authorization.

    A per-call challenge therefore arrives on a request already bearing a credential the resource can name. It names that token's jti. No retention, and no extra round trip either — so the optimisation in (1) is available without the storage that appeared to be its price.

    3. #92 removes the situation entirely

    For the case that prompted this issue, a resource that defers with 202 and holds the invocation never lets go of the credential context in the first place. There is no gap to bridge, because the resource never released the call.

    What survives

    #87 stands unchanged. The PS genuinely must retain the person tokens it issued — it is the only party that can resolve one authoritatively, and the document still never says so, sets no floor, and does not distinguish an absent record from mismatched claims. Closing this issue does not touch any of that.

    What it does change is the shape of the problem. Under this issue's framing, persistence was symmetric: both ends of a person token's life needed unstated storage. It is not symmetric. Only the issuer retains, which is the party that already keeps issuance records for revocation and audit. That is a simplification of #87, not a resolution of it — the retention floor, the error-code split, and the keying question all remain open there.

    The tuple point is absorbed. This issue ended by arguing that a retained record must be the whole tuple rather than the jti alone, so a resource cannot pair a mission-bearing jti with a stripped resource token. Under presented_jti that is structural rather than an obligation on the resource: the recipient resolves a token it issued and compares all four claims against its own record. The resource holds nothing to get wrong.

    Closing as resolved by analysis rather than by a change. Nothing in the drafts needs editing for this issue; presented_jti proceeds on its own merits, and #92 on its own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions