Skip to content

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

Open
9 of 12 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 gateway call outside the agent's limit is refused before any token is issued; each broker-issued gateway token serves one call
Slice 5: Attributed trail (#2565) #2541, #2566, #2731, #2843, #2844, #2845, #2846 Every decision and call is recorded (records nobody waits for can be dropped until #2848), 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
Other #2973 (connect link for a missing provider connection; its first step is #3025, skip a failed provider leg), #3051 (connect link tests: streamed result and production mux) A user without a provider connection is asked through the gateway, and the link connects that provider

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" and its owner is not notified; the owner is not reminded to renew before the horizon; an owner disabled at the company IdP keeps their schedules running until the horizon; 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 name the token jti and operation ID through a mecatl subject enricher rather than natively ("Name the gateway token and its operation on the embedded gateway's audit events" (#3023)), records nobody waits for (closes, refusals, dispatch and outcome reports, refused calls, schedule revocations, and mecak8s's request, ownership, and host session deletion events) are queued in memory and dropped when the queue is full, no definition-load or credential-issuance events, 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)
mecak8s's own audit events are written only when the identity broker is on, to the broker's destination; mecak8s keeps no dispatch or outcome records of its own #2807
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
Records reach the store mecak8s cannot change through a collector that reads mecak8s's standard output on the node; until the collector delivers a record, mecak8s can lose it but not change it, and the loss is not detected until records are numbered #2807 (the broker's records), #2848 (detection)
Only the session owner can open a transcript from an audit record. Investigators can read the audit store, but not other users' transcripts. #3071
A helper's tool call removed by compaction answers not_kept, because a helper's compaction archive is not kept. #3075
The connect link is not bound to the user who asked: whoever signs in through it is connected under their own user #3049 (users the gateway has never seen), #3126 (users it knows)
A newly connected server's tools join the session only after the user refreshes the session's MCP tools #3101
Schedule grants the broker discards (pending setup grants, a run's child grant) are dropped, not revoked at AS-1; the owner is not reminded to renew before the horizon #2568
The broker's ledger of reported dispatch attempts is held in memory #2563

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 gateway call outside the acting agent's limit, and each broker-issued gateway token serves one call; every decision and call is recorded in the audit profile (records nobody waits for can be dropped until #2848), 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

9 of 12 Issues completed
Loading 12 sub-issues

Activity

  1. 12 remaining items

  2. rdimitrov commented on Nov 30, 2026

    @rdimitrov
    Member

    Proposed row for "Shortcuts, removed in phase 3", from the #2845 readiness check:

    Shortcut Removed by
    Only the session owner can open a transcript from an audit record. Investigators can read the audit store, but not other users' transcripts. #3071
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