Skip to content

Phase 2: Per-session agent identities, linked helpers, scheduled runs, limited access, and an attributed trail #2545

Open
6 of 11 issues completed

Description

@ChrisJBurns

Problem

After phase 1, every agent shares one identity, helper agents cannot make broker MCP calls, scheduled runs have no grant of their own so their gateway calls fail closed, the broker does not limit which tools an agent may call, and nothing traces a call back through the agents that led to it.

Design

Goal

An agent, and every helper it starts, acts under its own identity tied to its session. A helper's identity is linked to the agent that started it. A scheduled run works with no one present, on its own grant. Each agent can call only the tools its definition allows, never more than its parent, and each gateway token serves one call. Every decision and call is recorded and can be traced to the agent, its parents, the session, and the user.

Slices

Slice Tickets Testable result
Slice 1: Per-session agent identity (#2550) #2526, #2527 Every grant names the specific agent in its session; the shared agent identity is gone
Slice 2: Linked helper identities (#2554) #2555, #2557, #2947 (follow-up: a run's owner recorded from its request) A helper's MCP call carries its own identity, linked to its parent, and its run and delegation are reported and checked
Slice 3: Scheduled runs #2569 A scheduled run calls gateway tools on its own grant, with no one present
Slice 4: Limited access (#2851) #2842, #2727, #2938 A call outside the agent's limit is refused before any token is issued; each gateway token serves one call
Slice 5: Attributed trail (#2565) #2541, #2566, #2731, #2843, #2844, #2845, #2846 Every decision and call is recorded, traceable from a gateway record to the agent, its parents, the session, and the user, and linked to the transcript
Slice 6: End to end #2817 An unattended scheduled review runs under its own identities, within its limits, and leaves a trail

Order: slice 1, then slice 2; slice 4 after #2527. Slices 3 and 5 can start now. Slice 6 after the others. Phase 1's #2729 lets a scheduled run list gateway tools, and phase 1's gateway work (#2533) is what makes the calls reach the gateway in production.

ToolHive work for phase 2: "Authorization server: narrow a JWT-bearer access token to one MCP call with authorization_details" (stacklok/toolhive#7061) and "vMCP: accept an access token for the one call its authorization_details names, once" (stacklok/toolhive#7062) (through "Bind each gateway token to its call" (#2727)), "vMCP: answer a call for an unconnected provider with a URL elicitation carrying the connect link" (stacklok/toolhive#7188) and "vMCP: keep a delegated session and route calls when the user has not connected a backend's provider" (stacklok/toolhive#7189) (through "Connect link for a missing provider connection, through the gateway's URL elicitation" (#2973)), "Bind provider-identity rows to the issuer and subject claim that created them" (stacklok/toolhive#7256).

Decide before #2527 starts: D4 (asked on #2527). Decided in #2866: an instance registering again keeps the revision it registered with.

Shortcuts, removed in phase 3

Shortcut Removed by
Registration names the definition and the revision the loader reports, with no provenance check; no root eligibility; no nesting limit #2548, #2551
The tool limit is a plain check, not generated Cedar policy, and records no policy revision #2849
Schedule grants are held in memory; a restart loses them #2563
Run and delegation records are held in memory, per replica, at most 4096 per session #2563, #2805
Revoking a schedule drops its grant at the broker, not at AS-1; a lapsed schedule fails closed without "needs owner action"; a run longer than the ID-JAG cap loses gateway access #2568
Only the broker's and mecak8s's records: no authorization server records, the gateway's records are joined by user, agent, and time rather than operation ID (until "Name the gateway token and its operation on the embedded gateway's audit events" (#3023)), no record-stream sequence numbers or start and stop records, no separate channel for delivery failures, and no reconciliation #2848
The embedded gateway records a JSON-RPC error inside an HTTP 200 as a success, because ToolHive cannot drop the error message without dropping the outcome #2848 (after stacklok/toolhive#7371)
Inline MCP servers in definitions bypass the broker, because the harness does not run definitions from the broker's loader #2548
Definitions the broker did not load are refused, not accepted as reported by mecak8s #2551
Under an operator harness_context policy, only built-in definitions register, so named sessions and helpers are refused #2548
A resumed subagent runs the default explorer, so a named helper whose credential is gone cannot be resumed #2548
Audit records are protected by the store they go to, not signed at their source #2808

The phase 1 shortcuts that phase 3 removes (#2451: one replica, the in-process broker with an unverified caller, durable state, sign-out, credential renewal and key rotation, a new vMCP session per call, TUI-only sign-in, the connect link instead of asking before the call, and the embedded gateway only) also stay.

Done when

Every main and helper agent has its own identity tied to its session, and each helper's identity is linked to its parent; a scheduled run calls gateway tools on its own grant with no one present; the broker refuses any call outside the acting agent's limit, and each gateway token serves one call; every decision and call is recorded in the audit profile, can be traced from a gateway record to the agent, its parents, the session, and the user, and links to the session's transcript; the end-to-end scenario (#2817) passes; "Bind provider-identity rows to the issuer and subject claim that created them" (stacklok/toolhive#7256) is released and pinned by Mecatl; and "Connect link for a missing provider connection, through the gateway's URL elicitation" (#2973) is closed.

Sub-issues

Sub-issues

6 of 11 Issues completed
Loading 11 sub-issues

Activity

  1. 8 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions