Repository navigation
Description
A client that is not the user's browser, such as Mecatl's scheduled agent
or an agent authenticated by the company IdP, needs to use a connection
the user already made at the gateway (their GitHub token, say), without a
browser session. This epic covers three cases:
- Mecatl's agent, via ID-JAG. Mecatl's authorization server issues
an ID-JAG for the user; the gateway's authorization server redeems it,
resolves the user, and issues a short-lived access token carrying the
delegated-access marker. The vMCP then injects that user's credential
for the routed provider. - A token from the company IdP, exchanged at the gateway's
authorization server, or presented to the vMCP and translated in
process into the same kind of token. - One gateway calling another ToolHive server that has its own
authorization server, without passing credentials between
authorization servers.
Rules that hold throughout:
- Stored connections are read per user and per the provider the tool is
routed to, and the stored row must belong to the user. - Only the gateway's own authorization server can grant credential use,
by issuing the marker after resolving the user and checking the client
and the agent. A missing session ID or anactclaim never grants it. - A missing connection is never answered with 401 or 403: the user gets a
link to connect the provider ("vMCP: answer a call for an unconnected
provider with a URL elicitation carrying the connect link" (vMCP: answer a call for an unconnected provider with a URL elicitation carrying the connect link #7188)), and
the session survives a backend the user hasn't connected ("vMCP: keep a
delegated session and route calls when the user has not connected a
backend's provider" (vMCP: keep a delegated session and route calls when the user has not connected a backend's provider #7189)). - A user who has never signed in at the gateway is refused at redemption
(subject_unknown) until they sign in there once; that sign-in creates
their account and connects their providers. The gateway's authorization
server never creates a user as a side effect of a lookup.
Phase 1 (Mecatl) is the blocked-by list of "Delegated access: turn on
subject resolution at ID-JAG redemption" (#7247): "Delegated access:
resolve the ID-JAG subject and issue the marked token behind the gate"
(#7246), "User-keyed upstream storage behind the embedder option" (#7263),
"Ownership-checked credential read for delegated tokens, keyed by user
and routed provider" (#6407), "vMCP: session identity binding is not
enforced for tools/list (and other list methods)" (#6779), "vMCP: bind
sessions to the client, acting agent, and delegated-access marker, not
just the user" (#6888), "Test that one upstream identity never maps to
two authorization-server users" (#6980). All closed; resolution is on as of "Turn on subject resolution at ID-JAG redemption" (#7356). Mecatl still needs a release that contains it.
Phase 2 (Mecatl): "vMCP: answer a call for an unconnected provider
with a URL elicitation carrying the connect link" (#7188), "vMCP: keep a
delegated session and route calls when the user has not connected a
backend's provider" (#7189), "Authorization server: narrow a JWT-bearer
access token to one MCP call with authorization_details" (#7061), "vMCP:
accept an access token for the one call its authorization_details names,
once" (#7062), "Bind provider-identity rows to the issuer and subject
claim that created them" (#7256).
Later: per-user storage for runner-built deployments ("Re-authorization
walks the full upstream chain instead of evaluating existing credentials"
(#6831)); case 3, carrying identity-provider claims ("Carry upstream claims
across RFC 8693 exchange" (#6511)); case 2, "Delegated access: tokens and
actors from third-party issuers" (#7159); the design record, "User-owned
upstream credential storage (RFC)" (#6885); the delegated read in the other strategies and in thv vmcp serve, "Read delegated credentials in token_exchange, aws_sts and xaa, and in thv vmcp serve" (#7359).
Known gaps.
- The pre-existing ordering gap where backend discovery and initialization
run before authorization; only protected tool execution is gated. - Refresh is serialized across replicas only once "Handle multi-pod
refresh token rotation race condition" (Handle multi-pod refresh token rotation race condition #4122) lands; until then two
replicas can race on one row. - Until the refresher's conditional delete ("Re-authorization walks the
full upstream chain instead of evaluating existing credentials" (Re-authorization walks the full upstream chain instead of evaluating existing credentials #6831)),
a failed persist after a refresh can delete a row another client just
wrote. - No per-provider or per-user scoping of credential use: an allowed client
may use every connection of the user. A grant evaluated at read time is
kept for later. - Carried identity-provider claims are limited to what "Carry upstream
claims across RFC 8693 exchange" (Carry upstream claims across RFC 8693 exchange so delegated tokens work with attribute-based Cedar policies #6511) defines. - No user-facing disconnect yet: a connection whose token never expires
stays until it is replaced.
Activity
[-]Support non-interactive agents reading stored upstream credentials[/-][+]Delegated client access to a user's connections[/+]tools/list(and other list methods) #6779