Repository navigation
docs(agent-identity): mecak8s sends gateway calls with a per-call token - #2726
Conversation
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]>
…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]>
…citation (#2732) Co-authored-by: Mecatl <[email protected]>
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]>
|
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 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:
|
jhrozek
left a comment
There was a problem hiding this comment.
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.
|
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. |
|
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. |
The design had the identity broker send tool calls to the gateway itself (
InvokeTool), holding the gateway tokenVin 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 aVbound to that one call.The decision
AuthorizeCall, naming the server, tool, argument hash, and operation ID), sends the call to the vMCP with theVit gets back, discardsV, and reports the dispatch and outcome to the broker.Vis bound to one call and single-use. AS-2 copies an RFC 9396authorization_detailsentry (server, tool, RFC 8785 argument hash, operation ID) intoV. The vMCP accepts it for exactly one matchingtools/calland records itsjti. AVheld by mecak8s can make only the call the broker just approved, once, which gives the protection broker-side dispatch was meant to give.V, not in a second token. The two-token alternative (a cacheable, ceiling-scopedVplus 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 boundVkeeps 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-issuedV, and "why the binding lives inV".credentials-and-lifecycle.md:V's custody, and the sequence diagram (InvokeTool→AuthorizeCall, mecak8s sends and reports);authorization_detailsrequest, a new AS-2 check 8, a decodedVwith its binding, and "oneVper call" replacing "Caching";jti), with outcomes now mecak8s's;audit.md: the broker records its decision before returningV. Dispatch and outcome are reported by mecak8s and recorded as reported. Correlation goes through the per-callV, and the reconciliation rows are updated.threat-model.md: a new protection ("the harness holds no reusable gateway credential") and rows for reusing aVand 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-callVand the vMCP binding replace theVcache tests. Two ToolHive work-list rows are added (AS-2 binding with configurable lifetime, and vMCP enforcement with a sharedjtistore). 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.
AuthorizeCallalready 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-gitignorepasses for these files. Its only findings, two broken links and one unreachable document, are in an untracked localdocs/acceptance/file that isn't part of this change. That same file is the only failure frominstruction-files.py.Review follow-up
The third commit handles the review:
Vexpires, up to a maximum call duration;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
V" wording removed: step (7), scheduled runs, session close, sign-out, gateway modes, run owner, and the audit walkthrough.