Repository navigation
docs: describe agent authority, broker trust boundaries, and implementation gaps - #2121
Conversation
bca7cf8 to
8c6f099
Compare
8c6f099 to
70e62b9
Compare
JAORMX
left a comment
There was a problem hiding this comment.
Jakub, my main concern here is keeping the agent/subagent hierarchy from the existing identity model:
I'm fine with code-reviewer being a stable logical identity that we can use in policy. But we also need to know which instance of that reviewer we're talking about and where it sits in the delegation tree:
Alice
└── main
└── code-reviewer
└── security-reviewer
└── another specialist
Each child inherits restrictions from its parent, all the way down. If the main agent was restricted to reviewing PR 42, spawning a specialist with a broader definition must not give it access to other repositories or permission to merge.
The document does say children only narrow authority. What I'm missing is how we carry and enforce that hierarchy through issuance, broker admission and recovery. The credential identifies the definition, and then we have separate run and call bindings, but where is the binding to the actual parent and the authority delegated to this particular child?
I'm not asking for a private key per subagent or claiming this isolates goroutines from a compromised Mecatl process. I want us to preserve the delegation tree as something we enforce, rather than something we only reconstruct from logs.
Can we make that relationship explicit before settling the credential model? I'd like the broker flow to implement the definition/instance/run model, rather than leave the instance hierarchy behind.
|
One clarification on my earlier comments: I’m thinking of this in two phases. First, identities and cryptographically verifiable attribution across the agent/subagent tree, so we can audit which instance did what and beneath whom. Then, policy enforcement where each child’s authority stays within what its parent may delegate. I see this PR as helping with that first foundation. I’m not asking us to settle the policy language or containment mechanism here, or make the complete enforcement model a prerequisite for attribution. I want us to preserve the hierarchy now so enforcement can build on the same model later. |
|
Jakub, one more thing I'd like us to account for is agent definition provenance. This expands the scope a bit, so I'm not asking us to implement every source adapter or settle a wire format in this PR. But I think we should capture the requirement on both the Mecatl side and the identity broker side. For attribution, I'd like to answer: which agent definition revision did this particular agent instance actually use, and where did it come from? With local files, that could mean repository, path, commit and content digest. But Mecatl's Could we leave room for an agent definition provenance envelope with extensible metadata and versioned profiles? Something like this, just to illustrate the shape: agent_definition_provenance:
profile: mecatl.agent-definition-provenance.git/v1
metadata:
repository: https://github.com/example/agents
path: agents/reviewer.md
commit: "<full commit ID>"
source_content_digest:
algorithm: sha256
value: "<digest of the source content>"
accepted_definition_digest:
algorithm: sha256
value: "<digest of the normalized agent definition>"A Kubernetes profile could describe the source cluster, custom-resource object UID, observed revision and relevant-content digest. A service-backed profile could use a service/tenant namespace, object identifier and revision. Those are source details; the workload running the agent has its own identity and runtime metadata. I'm fine with the metadata being a map, provided each profile has a strict contract: required fields, schemas, hashing rules and defined revision semantics. The operator should be able to require particular evidence, and the source shouldn't be able to weaken those requirements by selecting a more permissive profile. The distinction between source content and the accepted agent definition matters here. Mecatl parses and normalizes agent definitions, so the bytes read aren't necessarily the exact representation used to construct the agent. Having a commit and a digest also doesn't establish that the loaded content belongs to that commit. A locally modified file is an obvious example. The flow I have in mind is: This information should come from source resolution and trusted execution state, not from the model. The agent definition and its provenance need to describe the same snapshot. We shouldn't reconstruct provenance afterward by looking at whatever happens to be current in Git, Kubernetes or the service. On the broker side, we should distinguish what it verifies independently from what it accepts as Mecatl's attestation. “Mecatl reports loading these bytes from commit X” is different from “the broker verified these bytes against commit X.” We don't need the broker to access every backend, but its signature shouldn't obscure that trust distinction. I also don't think the full provenance record needs to be a claim in every token. We could embed it or use an integrity-protected reference to retained evidence. If the logical-agent credential is reusable across instances, the binding needs to live in instance-specific evidence or an authenticated broker record instead. Otherwise, one credential could end up describing several different agent definition revisions ambiguously. This fits the observability-first phase: establish which agent definition each instance used and preserve that evidence alongside the delegation hierarchy. It doesn't grant permissions by itself. Later, enforcement could require approved revisions or particular source authorities. Can we capture this in the proposal and track the Mecatl interface and broker work separately? I'd like us to preserve enough information now that verifiable attribution doesn't stop at the agent definition's name and admission tier. |
8c1f133 to
1b69f1a
Compare
|
So, I think we're mixing two threat models here. With native execution enabled, mecak8s already keeps workspace filesystem operations and Shell in separate executor Pods, behind the execution provider. A prompt-injected agent running a command doesn't automatically get access to the mecak8s process or its credentials. The proposal acknowledges that existing boundary, but I'd like that distinction to drive the rationale throughout. I'm in favor of brokerage, and I want the real provider credentials kept away from mecak8s. I also want to keep the agent loop minimal. Owning OAuth enrollment, account association, refresh, credential selection, and mediated provider calls is plenty of responsibility for a broker already! I don't have a strong opinion about whether that needs its own deployment. A separate deployment is fine for operational ownership, independent lifecycle, or sharing the service across instances. But I wouldn't make process separation the main security argument for the identity design. Keeping credentials outside mecak8s can reduce exposure if that process is compromised, provided its storage and deployment permissions are actually separated. That's a useful property, but it's a different threat from hostile code running in an executor. And moving the signer doesn't make the identity reports independently trustworthy. If we trust mecak8s to report the user, agent instance, and delegation context, that trust remains. A compromised process holding multiple agent credentials can still substitute one for another. The docs already acknowledge this, and I think we should make it part of the starting assumptions rather than something readers discover after the architecture. I'd frame this around the responsibilities first: the loop runs agents, the existing execution boundary handles workspace code, and the broker owns provider connections and protected external calls. Identity issuance can be a module in that design without implying another service or per-agent process isolation. The part I'd like us to discuss separately is broker ownership of run admission and agent lifecycle. Establishing bounded access to external tools makes sense. Becoming another authority over whether agents can start or runs can execute is a much larger decision. Can we clarify which one we mean, and keep the attribution work from depending on the broader execution-control design? |
c3f3fa7 to
f75b378
Compare
|
Replies to the review summary and the first two issue comments, as of fbf9e8d. Review summary (delegation hierarchy through issuance, admission and recovery). The hierarchy is now enforced at the broker, not only reconstructed from logs. Each instance is registered under its parent. The broker stores an effective ceiling equal to the child's definition ceiling intersected with the parent's, evaluates it on every call, and reloads it unchanged on renewal and recovery. Details are in Delegated authority and the thread replies above. Two phases (attribution, then enforcement). Phase 1 maps onto the audit evidence table and the illustrative authorization record. They attribute each call to its instance, incarnation, definition revision, creation parent, run, delegation and user, and mark which facts are verified and which are reported. Server/tool enforcement against the parent's ceiling landed in v1 as well. Still deferred: task-specific bounds, resource/argument policy, and a verified per-operation binding for the reported run and delegation fields. Agent definition provenance. Captured in a new Definition provenance section:
Mecatl and broker work are tracked separately in implementation.md. No wire format is chosen. The 2026-10-12 comment on threat models and broker scope is still under discussion. |
JAORMX
left a comment
There was a problem hiding this comment.
Jakub, I'd like us to strengthen the audit sections around a practical outcome: we can establish who did what, when and where, and follow the full delegation chain behind the action. We already have toolhive-core/audit, so let's build on that rather than introduce a separate event format.
I'm not asking this PR to implement every NIST control or make a blanket compliance claim. NIST's Audit and Accountability controls are a useful guide for choosing the record structure and identifying what Mecatl, ToolHive, and the deployment each need to provide. I filed the reusable enhancements in toolhive-core and linked them in the inline comments. The request here is to make those requirements and dependencies explicit in the proposal and its verification companion.
|
|
||
| ## Illustrative authorization evidence | ||
|
|
||
| The following readable fields illustrate a proposed broker authorization event for the reviewer's call in the [interactive walkthrough](credentials-and-lifecycle.md#interactive-execution). They are an audit shape to guide implementation, not an immutable event API or a Cedar policy representation. |
There was a problem hiding this comment.
Can we make this a documented profile of toolhive-core/audit.AuditEvent, rather than leave it as an independent illustrative shape? The shared package already gives us the type, source, component, subjects, target, outcome, event ID, and UTC logging timestamp.
I'd like the chapter to map these fields onto that structure and say which evidence we require: who acted and on whose behalf, what operation and target, when it occurred/was observed, where it originated and was recorded, and the decision or observed outcome. Operation and attempt IDs should connect the records without confusing a retry with another event for the same attempt. Keep the verified-versus-reported distinction and the retained policy/definition references.
I filed the generic correlation, provenance, timestamp, and unknown-outcome conventions here: stacklok/toolhive-core#341
This is the useful direction from NIST AU-3 and AU-8, not a request to satisfy the whole control catalog: https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final. Could we also carry the field mapping and round-trip checks into the implementation companion?
There was a problem hiding this comment.
Done in 1a56af2. The illustrative table is replaced by an AuditEvent profile. We ran the mapping past ToolHive, OAuth, identity, and audit-standards reviews first. The profile now covers:
- Each field. The table says what Mecatl puts in each
AuditEventfield, and uses toolhive-core's existing conventions so records join with vMCP's:Outcomeis limited tosuccess,failure,error, anddenied, plusunknownfrom mecatequi/mecak8s: register --mcp-server and per-server bearer-token env (factory mode) #341.Sourcestays the network origin.Targetuses the existing keys.Typeusesmecatl_-prefixed snake_case.
- Who acted, and for whom.
Subjectsholds issuer-qualified keys for the user, the company owner, the workload, and the acting instance. Amecatl.provenancemap marks each fact asverified,record:<AuditID>,reported:<component>, orunavailable, and an unverified identity never appears asuser_id. - Correlation. Operation, attempt, and event IDs work like this:
- A retry is a new attempt.
- A re-send keeps its
AuditIDandLoggedAt. - A late result after
unknownis a new event that references the earlier one. - The broker passes the operation and attempt IDs to AS-1 and the vMCP.
- When. Occurrence time and its clock are recorded next to
LoggedAt. - The outcome. Each event type (decision, dispatch, observed outcome) has a fixed set of outcomes.
- References. Credentials are recorded as
(iss, jti)or record references, never values. - Lineage.
DelegationChainholds only anactchain the recorder validated. Creation ancestry and delegation are kept separately, inData.lineage. - Scope. The profile lists the event families the identity work needs. Cedar evaluation fields are marked as authority work.
Interim mecatl. keys stand in until #341 and #342 land. The implementation companion now has the field mapping as round-trip checks: JSON and slog projections, re-emission, missing and reported identities, unknown then retry then late result, per-type outcome sets, key allowlists, and secret exclusion.
One related change: AS-1 now sets act.iss. Otherwise an agent: identifier looks like AS-2's once AS-2 copies act into V.
| | Field group | Illustrative values or required evidence | | ||
| | --- | --- | | ||
| | Event and call references | Event `authz-42`, operation `op-pr42-001`, attempt `attempt-1`, recording component, and observation time. Distinguish another attempt from another event for the same attempt. | | ||
| | Actor and context | Verified reviewer subject from its registered instance; verified workload with trust qualifier; host session `S42`; reviewer's agent-instance incarnation; run `R42`; creation-parent reference; reported delegation `D42` from `R41`; API-reported Alice with issuer/subject and request reference. Preserve the provenance above. | |
There was a problem hiding this comment.
Can we explicitly require the full delegation chain to be part of the retained audit evidence, not just the immediate parent and delegation references? Starting with a specialist's tool call, we should be able to follow Alice -> main -> reviewer -> specialist, identifying each instance, the relevant execution/delegation, and which component established or reported each relationship. Two instances with the same definition must not become indistinguishable.
toolhive-core/audit already records RFC 8693 actor chains, including malformed/truncated markers. Let's reuse that where it applies, but keep OAuth actor history, creation ancestry, and the delegation for the current execution distinct. They aren't necessarily the same chain.
We don't need to duplicate an unbounded ancestry list in every event. Parent-linked lineage records in the audit dataset can work, provided references are integrity-protected, remain resolvable for the audit-retention period, and don't depend on live session state. Missing or truncated evidence must remain visibly incomplete, never presented as the full chain.
I've tracked the reusable support here: stacklok/toolhive-core#342. Could the investigation example and verification companion demonstrate reconstructing a multi-level chain after restart or transient session cleanup? This is about preserving attribution; it doesn't require completing task-specific authorization first.
There was a problem hiding this comment.
Done in 905f9e9. The full chain is now retained evidence. See Lineage.
- Two lineage events. Registration records each instance and a reference to its creation parent's registration. Delegation records each delegation (the delegating run and instance, and the receiving run and instance) and a reference to the delegation the delegating run was itself under. References are
AuditIDs. Both events are marked as reported by mecak8s, because only mecak8s observes those relationships. - Three chains, kept apart.
DelegationChainholds only a validatedactchain. Execution delegation and creation ancestry come from the lineage events. Nothing is derived from the SPIFFE path. - Retention. Lineage events follow the audit retention period, not the session's lifetime. Session cleanup doesn't delete them.
- Incomplete chains. An unresolved reference makes the reconstruction report the chain as incomplete, with where and why it stopped. It never shows a shorter chain as complete.
- Example. The investigation section now walks a
security-reviewerspecialist's call back through the reviewer and main to Alice's session, and notes which links are reported and which come from AS-1. - Checks. The implementation companion now covers rebuilding a three-level chain after a broker restart and after session cleanup, keeping two instances of the same definition apart, and reporting incomplete chains.
This needs one new piece of plumbing: mecak8s reports each delegation to the broker when it happens. Integrity protection for the store itself goes with your delivery-contract comment, which I'm taking next.
|
|
||
| The broker records its authorization decision, whether it attempted dispatch, and the outcome it observed as separate facts. An allow is not a dispatch; a dispatch attempt is not proof of receipt or success. A denial dispatches no backend operation. If completion is missing after possible dispatch, the outcome is unknown, not evidence of nonexecution. Credential recovery cannot justify automatic replay of an unknown operation. | ||
|
|
||
| Decision, dispatch, and observed-outcome evidence must be durable and survive broker restart. The storage mechanism, write ordering relative to dispatch, failure handling when evidence cannot be persisted, and cross-service delivery and authenticated correlation remain explicitly unresolved implementation requirements. This design does not select a transactional ledger or claim atomicity between an audit write and an external effect. |
There was a problem hiding this comment.
Can we add a small delivery and operational contract here, even if the backend remains an implementation choice? Correctly shaped events aren't enough if we can't tell that they were lost.
There's already audit-sink work in stacklok/toolhive-core#326. I filed the complementary failure-observability work at stacklok/toolhive-core#343: returning an error from a writer doesn't make it visible through AuditEvent.LogTo and slog. We should distinguish an emission attempt, receiver acknowledgment, and durable storage, and make failures observable through a usable reporting channel.
For this proposal, I'd like us to identify the required event families and their producers, the write/dispatch and failure semantics we depend on, and the deployment's responsibilities for protected storage, retention, and investigation. Include relevant registration/delegation, authorization, connection, and policy changes, not only successful calls. Audit and referenced lineage/policy evidence must not disappear with ordinary session cleanup before their configured retention expires. Be explicit about audit coverage outside broker-mediated MCP.
AU-2/5/6/9/11/12 are useful pointers here, not a requirement to implement every control, choose a SIEM, mandate WORM, or universally stop execution on logging failure. Let's select and document the guarantees we need, then verify actual destination delivery, failure reporting, secret exclusion, and reconstruction of the delegation chain. The separation of decision, dispatch, and unknown outcome in the preceding paragraph should stay.
There was a problem hiding this comment.
Done in 3557e50. The new section is Delivery, protection, and reconciliation. Before writing it, we had an audit reviewer walk a specialist's call backwards through every record and check each step against AU-3, AU-6, AU-8, AU-9, AU-11, and AU-12.
- Emission and destination. Every component records through the toolhive-core audit logger, and the sink work in toolhive-core#326 lets each deployment choose the destination. ToolHive's authorization server records nothing today. That's in the ToolHive ledger, now including sign-in and token issuance at AS-1.
- Protection. The deployment points sinks at a store mecak8s can't write or delete, and investigators get read-only access. That helps even while the broker runs inside mecak8s: records delivered before a compromise survive.
- Producers. A table lists which component records which event families. It now includes AS-1 sign-in and token issuance, and mecak8s request and ownership checks, so the user's identity anchors to the company IdP's independent log.
- Write order and failure.
- The broker mints attempt IDs.
- The sink must accept a decision record before the broker dispatches; if it can't deliver the record, the broker refuses to dispatch. That's the broker's choice, not a library default.
- "Accepted by the sink" is kept distinct from durable storage, which is the destination's job.
- Delivery failures go to a separate channel, per Telemetry for the headless binaries (mecatequi, mecak8s) #343.
- Gap detection. Each component, replica, and process start gets a contiguous sequence, with start and stop events, plus a synchronized time source.
- Reconciliation. These checks run across stores and flag mismatches:
- an AS-2 redemption with no AS-1 issuance;
- a vMCP call with no broker dispatch, and the reverse;
- a session-open conversion with no AS-1 issuance and sign-in.
- Lineage consistency. The broker checks that a reported delegation's instances share a session tree and that the parent links line up. This catches mistakes, not a compromised mecak8s.
- Retention. Lineage is kept as long as anything references it. Each deployment names an owner and a duration, and agrees retention with an external gateway operator.
- Coverage. Filesystem tools, Shell, and spawning are covered only by harness logs.
- Later. Hash chains with signed checkpoints after the broker is a separate service, and signed records for non-repudiation.
The implementation companion's checks now cover refuse-on-delivery-failure, sequence gaps, each reconciliation flag, and the lineage consistency check.
|
Documenting our earlier conversation here for visibility: Should we split this into phases and focus first on the identity broker and the plumbing/audit of agent identities? We can tackle policy enforcement once that foundation is in place. This will keep us from making early assumptions that might require rework down the road. |
| - the presenter is the authenticated client `mecatl`; | ||
| - the request asks for no wider scope than the original grant. | ||
|
|
||
| Accepting a token whose `aud` is mecak8s from a different client is an explicit, narrow AS-1 policy for client `mecatl`, not a general audience bypass. AS-1 issues a broker refresh token and creates its record: client `mecatl`, AS-1 `sub`, broker session reference, host session and incarnation, source token `jti`, issue time and hard expiry, and rotation chain. The broker supplies the session reference. Rotation inherits the record and does not extend the hard expiry. Session close revokes the token and deletes the record. In v1 the refresh token is not tied to the user's AS-1 login session. |
There was a problem hiding this comment.
Could we clarify the expected behaviour when a user logs out while an agent is still working? My understanding is that the agent can continue making authorised tool calls because its broker session remains active. If that’s intentional, what explicit user action ends that access? It would help to make the distinction between signing out and stopping the agent’s access clear.
There was a problem hiding this comment.
Good question. Your reading was right: before this change, signing out didn't stop a running agent, because its authority is a broker-held refresh token, not the client's tokens. 5aec36d makes the two actions explicit in Sign-out and revocation:
-
Sign out in the TUI or Studio revokes only that client's tokens. Running agents and schedules continue.
-
Sign out everywhere is the explicit action that stops every agent acting for the user. It ends:
- live runs;
- tool calls parked waiting for authorization, and tool calls in flight;
- the broker sessions and their refresh tokens;
- the authority of every schedule.
The transcripts stay. A schedule stays configured, and its next run ends with "needs owner action" until the user renews it.
-
If the company IdP disables the account, the same happens without the user doing anything. When AS-1 issues an ID-JAG, it re-checks the company-IdP refresh token behind the grant, at most once per interval. If the IdP refuses, AS-1 revokes all of the user's grants. That works with any IdP that issues refresh tokens, with no IdP-specific events.
Faster IdP signals are listed as later work. Those are back-channel logout from Keycloak and event hooks from Okta; Entra and Google Workspace don't send either to third-party apps. Binding the broker's token to the AS-1 login session, so that signing out at AS-1 itself stops agents, is later work too.
|
Following up on @ChrisJBurns's phasing comment, and on @JAORMX's earlier two-phase comment: yes, we're sequencing the work that way. The identity work comes first, with no broker authority work in it. The authority work follows. The README now has an Order of work section listing both. Identity work:
Authority work:
Until the authority work is in place, the harness's existing delegation restrictions are the only ceiling checks. Registration already records the definition reference and the creation parent, so the authority work adds computation, not a migration. The three audit comments from 13 October are still open. Those are part of the identity work, and I'm working through them next. |
|
@JAORMX, replying to your threat-model comment. Thanks, this was the right push. Here's where it landed. Run admission. This is now a non-goal, as you suggested (81eae38). The broker governs protected tool calls. It does not decide whether agents start or runs execute, and registering an instance grants no permission to run. The work is also sequenced so that the identity work comes first and carries no broker authority at all (eede8bd). So the attribution work doesn't depend on any execution-control design. Deployment. The broker starts as modules inside mecak8s (broker core, AS-1, the agent issuer, and the definition loader). Later those modules move together into one separate service. Identity issuance stays a module of the broker in both cases. The new Deployment and threats section (adae397) starts from your framing. 1. Executor code and a compromised mecak8s are separate threats. Agreed. Executor Pods handle hostile workspace code in both deployments. Where the broker runs only matters against code execution in the mecak8s process. 2. Process separation is a custody argument, and only if storage and permissions are really separate. Agreed. The section has a table of what each deployment closes against a compromised mecak8s, and the conditions the split needs to be real: separate storage, KMS permissions, RBAC, and configuration. While the broker runs inside mecak8s, it gives no protection against that attacker. The docs say so, and the claims that assumed a separate broker are qualified. 3. Moving the signer doesn't make mecak8s's reports trustworthy. Agreed, with one change since you wrote this: the user is no longer a mecak8s report.
These stay mecak8s's word in both deployments, and audit marks them as reported:
The broker now loads global definitions itself, so mecak8s can't supply their content or ceilings (d9fb3c0). We found ways the later authority work could narrow the rest (an envelope around the root ceiling, and tool-call grants scoped to a run the user started), but they're not settled. The modulith constraints list what we keep fixed now so the later move is a deployment change. Examples: AS-1's final issuer URL from the start, because external consent links are keyed on it; the same RPC contract in-process; separate broker storage; and one key per signing role. |
|
Heads up: #2003 adds named agent definitions as interactive session roots, with a persisted authority ceiling that later grants and fork/clear successors cannot widen. I left some thoughts on how the two efforts should fit together here: #2003 (comment) I think that gives us a useful starting point for this proposal, without making 2003 depend on the broker work. The distinction I’d keep is that For the integration, I’d like us to spell out how trusted definition resolution produces an admitted source/revision reference, and how a particular durable instance gets registered against that reference and associated with its owner/session. The broker should establish the MCP ceiling from admitted records, rather than accepting a name or tool list supplied by the client or model. Knowing a definition exists also shouldn’t implicitly grant a caller permission to instantiate it. There’s a lifecycle detail worth reconciling explicitly: 2003 rebuilds fork/clear successors using the current definition catalog while retaining inherited authority, whereas this proposal pins a definition revision to an instance. My suggestion is to distinguish a successor with a new instance identity from restoration of an existing instance. Neither should widen inherited authority, and current restrictions or revocation still need to apply. Direct execution resume after restart is intentionally refused in 2003’s first version, so safe continuation remains follow-up work. Could we reference 2003 here and capture those integration rules? That would keep the session-binding work and the broker design aligned without pulling credentials, registration, or restart recovery into the first PR. |
|
This round of review comments is answered, and each thread has a reply linking the commit. I've left the threads open so you can resolve them, or push back if a reply doesn't settle it. Answers to review comments
Other changes, not asked for in review, worth a look
|
Fix what the final review round found: - A closed session returns its recorded reason with that reason's status everywhere; a replaced refresh token returns superseded; a lease waiter re-reads its grant before answering. - Re-registering a SPIFFE ID must match its earlier host session, owner, definition revision, and parent; the undefined "deregistered" check is dropped. - Delegation records are kept per session and re-reported parents first; an unrecorded delegating run becomes a root run only for a root instance. - Schedule setup keeps the schedule's owner after revocation, renewal moves a live grant's horizon, the scheduled-run open refuses a closed session and has its own failure table, deleting a schedule has its own reason, and scheduled runs map every revocation to "needs owner action". - Sign out everywhere also ends AS-1 login sessions, the revocation time compares iat strictly, and issued access tokens are stated to keep working for the API until they expire. - The error_description character set, the README key-sharing and instance sentences, the registration list in agent-definitions, and stale tests in implementation.md. Co-Authored-By: mecatl <[email protected]>
Make credentials-and-lifecycle the single home of the end-to-end token flow and reorder it for implementers: - One credentials table with custody, then the walkthrough with a new step (0) for broker startup, the failure matrix, and error reasons. - Scheduled runs follow the interactive flow; lifetimes and renewal become one table; vMCP sessions move here from the gateway chapter. - A Later work section collects the unselected options; the workload and instance-identity material moves under Reference. - The User identity, custody, actor-history, provider-selection, and sender-binding sections are folded into the steps they belong to. mcp-gateway-modes keeps only what differs between embedded and external gateways and links to the flow. implementation.md keeps the grant record, open items, tests, and ledger, and links to the chapter instead of restating it. Step numbers are unchanged so existing links still resolve. Co-Authored-By: mecatl <[email protected]>
From the pass-3 review: - Restore the credential record's compare-and-swap refresh, the run ID's path to the vMCP, renewal-failure behavior, Mecatl revoking the consent link, the broker-side SVID limit, the custody disclaimer, RFC 8707 at the vMCP, and the open item on correlation-record order. - vMCP sessions belong to the instance and user, so they survive a replacement broker session and end when the instance ends or the user's grants are revoked. - The delegation report now precedes step (6), which depends on it; the failure matrix and error reasons follow scheduled runs, whose rows they include; step (0) is marked as a startup prerequisite. - The embedded-vs-external resolution table lives only in the gateway chapter; "provider credential" and "broker refresh token" replace the ambiguous "upstream credential" and "session refresh token". - The chapter points to the tests and the threat model; links to run grants and session-bound tokens go to Later work; implementation's section is renamed Grant record. - README: the identity-work checks include the run and its owner, and the post-split attacker limit names new sessions and schedule grants. Co-Authored-By: mecatl <[email protected]>
Replace the "Where trust lives" diagram with one that draws administrative domains as boxes and the four trust boundaries as numbered edges: user entry, credential custody between mecak8s and the broker, gateway entry, and provider egress, each labelled with what crosses and who checks. It shows the intended deployment, a separate broker and an external gateway, and a note says what differs today. The agent trust domain is shown as a naming label on the agents, not a boundary, since agents share the mecak8s process and their SVIDs are asserted. AS-1 touches both user entry and gateway entry. Co-Authored-By: mecatl <[email protected]>
de4303c to
1fc17d5
Compare
Co-authored-by: Mecatl <[email protected]>
…identity broker Add internal/identitybroker, the in-process core of the agent-instance issuer proposed in #2121. New(config, definitions, signer) validates the identity configuration (SPIFFE trust domain, unique audiences, credential lifetime capped at one hour), an ECDSA P-256 (ES256) crypto.Signer, and already-loaded definition records (source, name, revision, provenance with SHA-256 digests), then retains independently owned copies. Identical duplicate records collapse; conflicting records for the same reference are rejected. Errors wrap one of four sentinels for later transport mapping. ES256 is required because agent credentials are planned as JWT-SVIDs, which do not permit EdDSA. The package imports only the standard library, enforced by a new depguard rule that also denies file, process, network, syscall, TLS, plugin, and logging packages. Add a contributor design record in docs/drafts covering scope, package ownership, validation and snapshot semantics, and future work. Co-authored-by: Mecatl <[email protected]>
design Follow the updated agent identity design (#2121 head de4303c): - Config carries a single Audience, the broker's, because every agent JWT-SVID names exactly one audience and the broker's verifiers reject more. - Cap definition source and name at 63 bytes (MaxSegmentBytes), the proposed SPIFFE path segment limit. - Export DefinitionRecord.Validate so the definition loader can skip bad definitions, as the design requires, while New stays strict. - Use global/ and system/ examples: the broker loads only operator and built-in definitions; repository definitions are mecak8s reports. Update the design record: per-instance definition records settle restoration after a source change, the snapshot scope, the single audience, the segment cap, the signing key ID, the registration checks for the next step, and the open question of two sources sharing a category. Co-authored-by: Mecatl <[email protected]>
…undation Drop registration, adapter, restoration, and roadmap material that belongs to later agent identity tickets, and point at the merged design in docs/drafts/agent-identity instead of PR #2121. Co-authored-by: Mecatl <[email protected]>
Summary
Document the intended agent-identity and external-broker design, separating the
reader-facing explanation from implementation evidence and remaining work.
Design narrative
docs/agent-authority.mdcovers:a shared Mecatl process to identify its agents.
logical-agent credentials and SPIFFE workload authentication.
ToolHive token exchange using the existing user access token and a separate
logical-agent credential.
Implementation companion
docs/agent-authority-implementation.mdrecords inspected implementationsnapshots, gaps and follow-up decisions. It distinguishes existing functionality
from proposed integration rather than presenting the design as already shipped.
Scope
Documentation only. No runtime behavior changes.
The design retains the existing broker, browser authorization, token refresh and
provider credential custody. It does not introduce a new consent or mandate system.
Provider-credential linkage is an OAuth/ToolHive concern, separate from SPIFFE
workload authentication.
Review focus
OAuth token claims?
Validation
task docsran but did not pass link validation.follow-up briefs not included in this commit; those links need resolution
before merge.