Skip to content

docs(agent-identity): bind each gateway call through the ID-JAG and the broker output check - #2950

Open
jhrozek wants to merge 2 commits into
mainfrom
docs/as2-call-binding-design
Open

jhrozek wants to merge 2 commits into
mainfrom
docs/as2-call-binding-design

Conversation

@jhrozek

@jhrozek jhrozek commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Design for binding each gateway call to its approval. The per-call authorization_details entry moves from the redemption request to the ID-JAG request. AS-1 signs it into the ID-JAG, AS-2 copies the signed entry into the access token V and may only narrow it, and the broker checks that the token response carries the entry it sent before it uses V.

This PR changes design documents only, under docs/drafts/agent-identity/. Nothing is built yet.

What changes in the design

  • Step (7): the ID-JAG request carries the call entry. AS-1 checks only the entry's shape and signs the granted entries into the ID-JAG claim. Per-type field checks belong to the type's hook.
  • Step (8): the redemption carries no authorization_details parameter. A redemption that still carries one is refused with invalid_authorization_details. AS-2 processes the signed claim, copies the granted entries into V, and refuses an empty grant or an unknown type.
  • Step (8a), new: the broker checks the token response's authorization_details member against the entry it sent, before it uses V. It treats V as opaque. The check is the broker's, not the gateway's.
  • Operation ID: it travels only inside the call entry. The separate mecatl_operation parameter is removed. Attempt IDs stay in the broker's own records, joined on the ID-JAG (iss, jti).
  • Single use: V is single use once the vMCP records each token's jti and refuses a second call. The vMCP enforces that a V serves only the call its entry names, and only once, for Mecatl's clients first. The widening to all clients is later, behind an embedder setting.
  • Standards: the entry on the ID-JAG request is permitted by ID-JAG draft-06 section 4.3. Signing the granted entries is required by section 4.3.3, and processing the signed claim is required by section 4.4.1. Refusing an empty grant, refusing an unknown type as a whole request (RFC 9396 section 5), and refusing a redemption that still carries the parameter are our policy.
  • Long-term, not part of this design: the agent ceiling at the gateway, and a Cedar policy carried in the token (an expired individual draft).

Fallout requirements

These are the work items the design needs. Owners are by role.

  • ToolHive (owner: Jakub): AS-1 accepts the call entry on the token-exchange ID-JAG request and signs it into the ID-JAG. Covered by the rescoped narrowing issue, Authorization server: narrow a JWT-bearer access token to one MCP call with authorization_details (#7061).
  • ToolHive (Jakub): AS-2 narrows V from the signed entry, refuses a redemption that still carries the parameter, and refuses an empty or unknown-type grant. Same rescoped issue (#7061).
  • ToolHive (Jakub): add an invalid_authorization_details row to the reason-code table. Authorization server: reason codes in error_description for ID-JAG redemption refusals (#7030).
  • ToolHive (Jakub): the vMCP enforces that a V serves only the call its entry names, and only once, for Mecatl's clients first. Covers batches and methods the call gate does not wire. vMCP: accept an access token for the one call its authorization_details names, once (#7062), rescoped.
  • ToolHive (Jakub): the delegated-access marker is minted on approved redemption before any credential read relies on it. Delegated access: subject mapping at ID-JAG redemption (#6887).
  • Mecatl (owner: Chris): the broker sends the call entry on every gateway call and tool listing, checks the token response before use, and fails with no retry on mismatch or absence. Bind each gateway token to its call (Bind each gateway token to its call #2727).
  • Mecatl (Chris): the pin. Call entries are sent only after the pinned ToolHive release includes the AS-1 and AS-2 changes. Bind each gateway token to its call (Bind each gateway token to its call #2727) merges with the pin bump; until both land, phase 1 keeps its current shortcut.
  • Shared: one set of argument-hash test vectors.

Replay-revoke is tracked by Revoke the grant a reused subject token created (#6973).

Open items

Not decided in this design, and not yet tracked:

  • Whether a redemption that still carries the parameter should be refused or ignored. The design refuses it.
  • The phase of the vMCP enforcement relative to phase 1 and phase 2 work. To be confirmed when the tracking issues are filed.
  • Whether external AS-2s report a missing approval as a structured outcome.

Review notes

  • Markdown link check passes (239 documents, no broken links or anchors).
  • The design was reviewed hunk by hunk against the base, and checked by an independent review pass.
  • The tracking issues are not filed yet. They follow after this PR is reviewed.

🤖 Generated with Claude Code

jhrozek and others added 2 commits November 22, 2026 22:59
…he broker output check

The per-call authorization_details entry moves from the step (8) redemption
request to the step (7) ID-JAG request. AS-1 checks its shape and signs it
into the ID-JAG; AS-2 copies the signed entry into V and may only narrow it.
The broker checks that V carries the entry it sent before it uses V (step 8a).

The vMCP must enforce that a V serves only the call its entry names, and only
once, for Mecatl's clients first. The mechanism is not part of this design.

The operation ID now travels only inside the entry. The separate mecatl_operation
parameter is removed. Attempt IDs stay with the broker's own records, joined
on the ID-JAG (iss, jti).

Standards: the entry on the ID-JAG request is permitted by ID-JAG draft-06 section
4.3; signing the granted entries is required by section 4.3.3; processing the
signed claim is required by section 4.4.1. Refusing an empty grant, refusing a
whole request on an unknown type (RFC 9396 section 5), and refusing a redemption
that still carries the parameter are our policy.

Not built yet: the AS-1 and AS-2 changes, the broker check, the vMCP check, and
the pin. See the ToolHive work list in implementation.md.

Co-Authored-By: mecatl <noreply@mecatl.dev>
The broker reads the token response member, not V's claim, and treats V as
opaque. The call type's hook refusals are invalid_authorization_details, not
access_denied. A repeated JSON member name is invalid_grant; the same entry listed
twice is invalid_authorization_details. The rollout wording says phase 1 keeps its
current shortcut until the call-binding change merges with the pin bump.

Co-Authored-By: mecatl <noreply@mecatl.dev>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant