Skip to content

docs(agent-identity): mecak8s sends gateway calls with a per-call token - #2726

Merged
ChrisJBurns merged 8 commits into
mainfrom
docs/agent-identity-mecak8s-sends-calls
Nov 6, 2026
Merged

ChrisJBurns merged 8 commits into
mainfrom
docs/agent-identity-mecak8s-sends-calls

Conversation

@ChrisJBurns

@ChrisJBurns ChrisJBurns commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

The design had the identity broker send tool calls to the gateway itself (InvokeTool), holding the gateway token V in its cache. This PR changes the final state to the one agreed with Jakub: mecak8s's MCP client sends tool calls, and the identity broker decides each call and issues a V bound to that one call.

The decision

  • mecak8s's MCP client sends tool calls. It asks the broker to authorize each call (AuthorizeCall, naming the server, tool, argument hash, and operation ID), sends the call to the vMCP with the V it gets back, discards V, and reports the dispatch and outcome to the broker.
  • The broker decides and issues tokens, and never proxies MCP. Sending calls would pull the MCP protocol, vMCP sessions, streaming, cancellation, and elicitation into the most trusted component.
  • V is bound to one call and single-use. AS-2 copies an RFC 9396 authorization_details entry (server, tool, RFC 8785 argument hash, operation ID) into V. The vMCP accepts it for exactly one matching tools/call and records its jti. A V held by mecak8s can make only the call the broker just approved, once, which gives the protection broker-side dispatch was meant to give.
  • The binding lives in V, not in a second token. The two-token alternative (a cacheable, ceiling-scoped V plus a short per-call token signed by the broker, in the style of transaction tokens) would save two token requests per call. But it would make every vMCP, including an external gateway's, trust the broker's signing key. A bound V keeps each gateway trusting only its own AS-2.

What changed

  • README.md: the identity broker is no longer "the existing MCP broker, extended". The MCP client gets its own description, and the diagram, the boundary table, the walkthrough, and the record paragraph follow the new flow.
  • mcp-authorization.md: the dispatch section uses the new flow, binding, "why mecak8s sends the call", tool discovery with a broker-issued V, and "why the binding lives in V".
  • credentials-and-lifecycle.md:
    • V's custody, and the sequence diagram (InvokeTool → AuthorizeCall, mecak8s sends and reports);
    • step (6): input and output;
    • step (8): the authorization_details request, a new AS-2 check 8, a decoded V with its binding, and "one V per call" replacing "Caching";
    • step (9): new vMCP check 3 (binding and jti), with outcomes now mecak8s's;
    • the failure matrix, lifetimes, configuration, vMCP sessions (owned by the MCP client), pauses, and the send-once record.
  • audit.md: the broker records its decision before returning V. Dispatch and outcome are reported by mecak8s and recorded as reported. Correlation goes through the per-call V, and the reconciliation rows are updated.
  • threat-model.md: a new protection ("the harness holds no reusable gateway credential") and rows for reusing a V and misreporting an outcome.
  • mcp-gateway-modes.md: resolves the contradiction over where the embedded gateway runs. It shares the process while the broker is inside mecak8s, and is its own deployment once the broker is separate.
  • implementation.md: tests for the per-call V and the vMCP binding replace the V cache tests. Two ToolHive work-list rows are added (AS-2 binding with configurable lifetime, and vMCP enforcement with a shared jti store). The approval check renumbers to 9.
  • run-owner.md: InvokeTool → AuthorizeCall.

Phase 1 differences from this final state (unbound V, the in-memory send-once record, tool discovery keeping the per-session OAuth path) go in the phase 1/2 tickets, not the design.

API compatibility

Design documentation only. No proto, route, event, or stored-data change. AuthorizeCall already returns the gateway token to the caller in code. The client-visible pieces (new reasons and outcomes, if any) get their assessment in the PRs that implement them.

Checks

matlatl check . --strict --respect-gitignore passes for these files. Its only findings, two broken links and one unreachable document, are in an untracked local docs/acceptance/ file that isn't part of this change. That same file is the only failure from instruction-files.py.

Review follow-up

The third commit handles the review:

  • messages that belong to an open call are accepted after V expires, up to a maximum call duration;
  • the argument hash is specified exactly, with shared test vectors;
  • the vMCP work-list row covers list calls;
  • the work list has no phase wording;
  • the MCP client, not the broker, recreates a gone vMCP session;
  • the per-call cost is stated as accepted.

Squash message: the first commit's message says where the restriction lives is "open until phase 2". It was decided afterwards (in V), so please use the PR title and this description, not that commit message, when squashing.

Since then

  • docs(agent-identity): a missing provider connection is a URL-mode elicitation #2732 (URL elicitation for a missing provider connection) was merged into this branch, so it's part of this PR now.
  • Leftover "cached V" wording removed: step (7), scheduled runs, session close, sign-out, gateway modes, run owner, and the audit walkthrough.
  • Attempt ID: step (9) now says the broker mints it and the MCP client only passes it on.

ChrisJBurns and others added 3 commits November 5, 2026 21:52
The identity broker decides each protected MCP call and issues a gateway
token bound to that one call; mecak8s's MCP client sends the call and
reports the outcome. The broker no longer sends tool calls (InvokeTool)
or caches the gateway token. Whether the per-call restriction lives in
the token or in a second, broker-signed token is open until phase 2.

Co-authored-by: Mecatl <[email protected]>
…d token

Records the decision: the per-call binding lives in V itself, so every
gateway trusts only its own AS-2. The two-token alternative is kept as
the rejected option with its reason.

Co-authored-by: Mecatl <[email protected]>
- Messages that belong to an open call (cancellation, elicitation
  replies) are accepted after V expires, up to a maximum call duration.
- Specify the argument hash exactly (JCS over params.arguments, {} when
  absent, I-JSON only) and require shared test vectors.
- The vMCP row covers list calls; drop phase wording from the work list.
- The MCP client, not the broker, recreates a gone vMCP session.
- State the per-call cost as considered and accepted.

Co-authored-by: Mecatl <[email protected]>
The vMCP accepts messages for an open call after V expires, so it must
remember which call a V started until that call ends, not only until
exp plus the clock skew. Step (9) check 3, the vMCP work-list row, and
the configuration entry now say so.

Co-authored-by: Mecatl <[email protected]>
@ChrisJBurns
ChrisJBurns requested a review from jhrozek November 5, 2026 22:39
…ion replies while it is open

Fixes a test bullet that still limited them to the token's lifetime.

Co-authored-by: Mecatl <[email protected]>
ChrisJBurns and others added 3 commits November 5, 2026 23:27
Step (7)'s intro and input, the scheduled-run output, session close,
sign-out step 2, the gateway-modes overview, the run-owner rules, and
the audit walkthrough still described a cached V. Every call now gets
its own V, so they say that instead. Step (9) also says the broker
mints the attempt ID and the MCP client only passes it on, matching
the audit write order.

Co-authored-by: Mecatl <[email protected]>
…ssion to be open

A credential from an agent whose broker session is closed is refused at
AS-1 as well as at the broker, as #2534 already requires.

Co-authored-by: Mecatl <[email protected]>
@jhrozek

jhrozek commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Chris, here is the draft for the per-call narrowing. Please file these two; I haven't filed anything.

1. Authorization server: carry the per-call authorization entry in the access token. Today the server parses the authorization_details entry and keeps it out of the JWT. Add it to the token issued on the JWT-bearer grant, narrowed to the one call, with a configurable lifetime per client.

2. vMCP: check a tool call against its per-call entry. Read the entry from the token, hash the arguments as received, and deny on a mismatch before the Cedar check. Record each token ID and refuse a second use. Put it in the existing admission seam, next to its open tracking items. Cedar can't express the exact-argument check (it has no hash, and arrays are sets), and cedar-go has no extension hook, so the check runs in Go before Cedar as a required condition that can only deny more.

Not tracked in the ToolHive work list, for you to decide whether to file:

  • Audit records at AS-1 and AS-2.
  • Operation and attempt IDs at AS-1 and the vMCP.
  • The per-call binding and the jti record at the vMCP. Only list-session binding is tracked.
  • A single-level act from the registered actor. It could fold into the ID-JAG issuance issue.
  • Requesting an upstream refresh token with offline_access at sign-in. Unknown per identity provider.
  • Later items with no tracker: session-bound refresh tokens, back-channel logout, RFC 9396 on the refresh grant, ending vMCP sessions on revocation, DPoP, per-tool narrowing at the gateway, Cedar reading act, and SPIFFE client authentication at AS-2 for the JWT-bearer grant.
  • The connector gateway capabilities the flow needs. No tracker in this repo covers them, so they need a capability list from the gateway's owners.

@jhrozek jhrozek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the design as written. The rows in the ToolHive work list with no tracker are listed in my comment above, for you to file.

@jhrozek

jhrozek commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Chris, should I file the two ToolHive issues? I work mostly on ToolHive, so I can take them if you'd like. If you'd rather file them, say so and I'll leave them to you.

@ChrisJBurns
ChrisJBurns merged commit 5f3368f into main Nov 6, 2026
37 checks passed
@ChrisJBurns
ChrisJBurns deleted the docs/agent-identity-mecak8s-sends-calls branch November 6, 2026 13:52
@ChrisJBurns

Copy link
Copy Markdown
Contributor Author

Thanks, Jakub. Both drafts are already filed:

Yes please, take them both. You're much closer to that code.

On the rows you listed as untracked, most already have issues; the work list just doesn't link them yet:

After this merges, I'll open a small follow-up PR that links those issues from the work list rows, so this approved PR doesn't change.

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.

2 participants