Repository navigation
docs: agent identity model, mecatl as its own SPIFFE trust domain - #321
Conversation
Grounding: ToolHive vMCP auth & the XAA/ID-JAG implementationResearch pass over the ToolHive codebase (vMCP auth path, What ToolHive ships today (verified in code)XAA/ID-JAG is fully implemented (THV-0079, The more interesting discovery: ToolHive's embedded authorization server ( Supporting facts:
How this doc's model could land in the MCP gateway pathThree layers, all composable from shipping ToolHive code:
The full use case this enables: user → mecatl agent → subagent → ToolHive vMCP → backend MCP server, with the delegation chain riding the token end-to-end and each hop verifiable. Discussion points
|
There was a problem hiding this comment.
Apologies for the first version of this review — the prose was dense to the point of
being unreadable. Same content below, rewritten. The line-specific corrections are the
14 inline comments.
What I think is right
I read this with the SPIFFE, RFC 8693 and WIMSE specs open, and checked the code behind
each claim about mecatl. Four things stand out:
- The three tiers match types mecatl already has —
AgentDef,Session,
Engine.Run. Because the identity path is built from the same ids the runtime uses,
the two graphs can't drift apart. - "Subagents are not network entities" removes a problem instead of solving it. No
subagent ever holds a key, so there is no key distribution question to answer. - The
subcollision is a real find. JWT-SVID wantssubto be the token holder.
8693 delegation wantssubto be the delegator. Both can't be satisfied at once, and
I haven't seen anyone else write that down. - The revisit triggers for
dlgare the right way to record a contested choice. They
say what would change your mind, which makes the decision reversible later.
One correction to my own praise, expanded in an inline comment. The doc says act is an
audit record and never an authorization input. That's true for earlier actors nested
inside the chain. It's too strong for the current one — RFC 8693 §4.1 explicitly allows
authorizing on the current actor. Worth loosening, because the stricter reading is
load-bearing elsewhere in the doc.
This also supersedes my own draft on the same topic, which I'm deleting. The tier model
here is better than what I had.
I read 6a62807d, so the two new sections and the revisit triggers are included.
A · Design questions
A0 · The outbound boundary
Not a challenge to this PR. One ask.
The ask. Line 359 says "the harness presents the subagent's SVID plus its own
proof-of-possession." That reads as decided, and it isn't. Please mark it open and link
out. It matters because that single hop decides how much of the issuer machinery is
actually doing work. On one of the two options below, the SVID does nothing at that hop.
I put the analysis in a stacked doc rather than inline here, because it's a design with
its own open questions: docs/agent-identity-outbound.md. What's in it:
- vMCP is a gateway, so there are two hops, not one. mecatl to vMCP is the first.
vMCP to each backend MCP server is the second. What you choose at the first constrains
what's available at the second. - At the first hop there is one credential and two options. The default: connect over
mTLS with the X.509-SVID, and let one client-authentication path cover both grants
mecatl needs.client_credentialswhen there's no user, which is what scheduled work
needs.token-exchangewhen there is a user. The alternative is ID-JAG at the
front-door IdP, for callers whose token doesn't name mecatl. What separates them: the
first needs nothing from anyone outside ToolHive, and the second needs the IdP to
implement ID-JAG. - The SVID does less than this doc assumes. It buys two things. No static
client_secretsitting in mecatl's environment, which matters becauseenvscrub
exists precisely so the model can't read harness credentials out of its own
environment. And per-pod attestation. Both are real. Both are smaller than "the
harness's identity." - A subagent's identity should key on the definition, not the instance. The reason is
caching, and it answers your open question 4 — see A1 below. - One real conflict. A delegated token can't also carry the reference to the user's
stored upstream credentials. Dropping that reference breaks the plain-OAuth strategy at
the second hop, which is the one serving most ordinary backends. This is the finding
most likely to force a rework. - The blocker is a decision, not a build. Three different values for
act.subare in
flight across ToolHive's code and design notes, and no policy can be written until
someone picks one. The default option above dissolves most of it, becauseclient_id
gets derived from the SPIFFE ID, so two of the three candidates turn out to be the
same string.
A1 · On resume, check the caller who's asking now, instead of trusting the stored record
A different approach for the parkable-lifecycle section. I think it's both safer and less
work.
The suggestion. When a session resumes, mint from the identity of whoever is asking
right now. Use the stored chain only to check that the new credential isn't wider than
what was granted before. The chain becomes a ceiling you validate against, rather than
the place you read the subject from. Instead of "the record says Alice, so mint for
Alice," it becomes "the caller proved they're Alice, and the record confirms Alice was
allowed this much."
Why. A stored record is only as trustworthy as whatever can write it, and today that
is an unauthenticated Redis. Even after Redis is fixed, "the row says so" is a weaker
claim than "the caller just authenticated." As written, all authority after a restart
comes from the row.
Four shipped systems made the opposite choice, which is what makes this the main
alternative rather than a detail:
- AWS Bedrock AgentCore re-derives identity from the live request on every
invocation, and says so: "AgentCore does not enforce session-to-user mappings." - OpenAI Codex persists the agent task into its rollout stream. On rehydration it
callstask_matches_current_identityand discards on mismatch. The stored record is a
cache; the live check is the authority. - CB4A, which this doc already cites, makes SVIDs non-renewable: "agent MUST
re-attest to get new SVID." practices-05§5.5, which the doc already quotes for the pause language.
What it buys. Most resume paths already have a live caller, so they're covered for
free:
- Approve-after-restart is only reachable from
ApproveRun, which is only reachable from
the wire. A human clicking approve is an authenticated request. - A
resume:of a persisted subagent runs under a live parent turn. - Background children are run-scoped, with a live parent.
The only case with genuinely nobody present is a scheduled fire (A2, B4). So the
signed-chain machinery is needed for one case instead of all of them — and that case
isn't mentioned in the doc yet. Much smaller thing to build, and the effort lands where
the risk actually is.
If you keep the chain as the authority anyway, it needs integrity. Right now it rides
the same snapshot pattern as Profile and ProviderID, which has no integrity
protection, and Service.rehydrateSession trusts those labels verbatim — including
sess.Mode, the permission posture. So "attenuation is monotonic across resume" is one
HSET away from being false. The fix: sign the chain when you mint, and verify it before
re-minting. Then the row proves its own integrity, instead of being trusted because it's
in the database.
This answers your open question 4 — definition or instance. The doc guesses "a
definition name like code-reviewer is simpler and probably right at first" without
giving a reason. The reason is caching.
Key the token on (user, definition, scope set, audience) and eight concurrent
subagents of one AgentDef share a single token, which survives across turns and
sessions for its TTL. Name the instance instead and every token is per-session, which
puts a network round trip on the tool-call path every time you fan out.
So: the definition goes in the actor claim, where it's both authorizable and cacheable.
The instance id becomes a correlation value that isn't used for authorization. RFC 8693
§4.1 allows exactly that split. Per-spawn minting is only forced if every instance needs
a different scope set, and definition-level tool sets suggest it doesn't.
One scoping note. ADR 0041/0058 direct-write subagents have no boundary at all, so by
this doc's own reasoning they use the parent's identity and are out of scope here
entirely.
A2 · Make the stored owner the primary record, and the edge one of its writers
The suggestion. Rather than the network edge being the only place a principal gets
bound, treat the stored owner as the primary record and the edge as one of the things
that writes it. Then work that starts itself has somewhere to read a principal from, and
the edge keeps doing exactly what it does today.
Why. The doc makes the network edge the only source of user/<uid>, and everything
downstream depends on that. But makeFireFunc calls CreateSessionWithProfile
in-process, from a leader-elected goroutine. A scheduled fire never passes through the
interceptor, so it has no user by construction. No amount of issuer or KMS work reaches
it, because the work never crosses the point where identity gets assigned. A harness that
runs work on a timer can't get its principals only from inbound requests.
What it costs. ScheduleSpec gains an owner field (B4), and the fire path reads it
instead of finding nothing. That's the whole change on the mecatl side.
What that owner should be. Not a user. A cron fire has no user, so there's no ID
token and no subject token to exchange. It should be the unattended branch of A0's
default option: client_credentials at ToolHive's AS, where the schedule authenticates
as itself and policy is written against the client. Then the audit log says "the schedule
did this," which is true, instead of "Alice did this at 3am," which isn't. It needs no
separate component, because the same client authentication serves both grants.
The tempting alternative is to give the schedule a service-account user with a stored
long-lived refresh token. That brings back exactly the stored-credential problem the rest
of this design exists to remove, and it puts a false statement in the audit log. Worth
naming as considered and rejected, rather than leaving the reader to wonder.
Either way this belongs in the doc. It's currently in neither the out-of-scope list nor
the open questions, and the Schedule tool has already shipped.
A3 · Either don't sign phase 1, or make phase 1 enforce what it signs
Phase 1 signs scope. That claim's own table entry says "Issuer-enforced invariant:
strict subset of the parent's." Phase 1 enforces nothing.
The named downstream consumer is scoped-resource-grants.md, which is a verifier design.
So a verifier reading phase 1's scope would be correct to believe it, and wrong.
That isn't a gap a later phase fills. It's a signed claim that isn't true yet, and
signing is exactly what makes a reader stop checking.
What the unsigned version buys. It's small, it's true, and it's useful immediately: a
durable record of which principal did what, on a seam that already exists
(Service.appendEvent). It also can't be misread, because nothing about it invites trust
it hasn't earned.
A second reordering worth making at the same time. Phase 1 currently takes the
commitments that are hardest to undo. The KMS dependency. The JWKS endpoint, whose SLO
the doc admits is unresolved. And the trust-domain name, which the doc concedes is close
to one-way, since "a rename orphans every SPIFFE ID in the historical audit log," with no
migration story. All of that lands before anything has been learned about whether the
novel parts work. Moving them behind the first enforcing phase costs some sequencing and
buys the option to change your mind.
B · What has to change in mecatl
None of these are objections to the design. They're things the design assumes that aren't
true yet, and writing them into the phasing would make it concrete.
B1 · CreateSessionRequest needs a principal field
Nothing can set a principal today. CreateSessionRequest has no such field, and neither
does CreateTeamRequest, so only an in-process host could write the label. The doc
correctly identifies the edge interceptor as the missing seam. This is the proto half of
it.
Two corrections to the proto paragraph while you're there. "The driver protocol today
carries no tenant, principal, session, or namespace field on any RPC" isn't right —
every session-store RPC carries session_id. And putting a principal on the snapshot
needs no proto change at all, because the driver payload is opaque and sessnap is
additive JSON. It's the Audit section's "events gain a principal annotation" that needs
one. So the count of one change is right; it's a different change.
B2 · Tier 1 needs an agent name at session creation, or it's a constant
CreateSessionRequest has no agent field, and the per-definition engines are child
engines only. So no top-level session is ever bound to an AgentDef, which means <def>
in spiffe://<td>/agent/<def>/inst/<sessionID> is the literal string main for every
session that exists.
Four consequences worth naming in the doc, because they follow from the gap rather than
from the design:
- Definition-level policy has nothing to match on. A
tdd-workeronly ever appears
asagent/main/inst/<sid>/child/subagent-<callID>. Its name isn't in the path. may_acthas nothing to bind to. The doc discharges it onto definition-tier
policy, andAgentDefcarries no authority fields.- Two of the four tiers collapse, leaving only "instance contains child" — which
governance.Audiencealready gives you. - The name is already inside
dlg, as{id, def, scope}.
So either add the field and tier 1 becomes real, or drop <def> from the path and let
dlg carry the name. A third option is making tier 1 the role instead: Deps.Role
already exists, and roleFamily reduces it to a closed six-value set covering every
engine. Which one you pick is a product decision, not an identity one.
One snag to fix regardless. The section rejecting session-as-identity says instance
identity "inherits the wrong lifetime — sessions reopen across runs and migrate across
pods." Twelve lines earlier, the INSTANCE bullet makes surviving reopen and pod migration
the deliberate feature.
B3 · The label has to reach children, and empty has to be rejected
buildChildSession, runBranch and Supervisor.sessionID all call session.New with
no labels. setSessionLabels is the only writer, and it lives in the server adapter, off
every child-spawn path. Since the child-minting seams are phase 2, phase 1 as scoped
ships every child with an empty Principal.
The check also has to reject empty, rather than compare equal. The doc cites the
Profile/ProviderID pattern correctly, but those degrade to a sensible default and an
identity field can't: empty means both "single-user deployment" and "somebody forgot to
propagate it." There's an in-tree precedent for the right shape. needsRehydration is a
pure empty-or-set fold over exactly these labels, and profileForSession carries a
documented second inference precisely because an empty label can't be told apart from a
genuine default.
Worth knowing that no existing test would catch a missed write. The eventsource fold
guard catches a missing classification, not a missing value. storeconformance
round-trip fixtures are the cheap place to catch it.
This also touches two exported surfaces rather than one.
engine/adapter/eventsource/review_test.go compares session.Session's exported fields
exactly. Because a creation label classifies as "supplied via SessionMeta, not
event-carried," eventsource.SessionMeta has to gain the field too, with Fold
assigning it. Both need task api:update plus a CHANGELOG note.
Service.ForkSession does copy labels, but model-switch carryover takes them from the
request rather than from the source session.
B4 · ScheduleSpec needs an owner field
It persists an entire session construction — prompt, trigger, workspace, mode,
Mutating, selector, limits — with no field naming who created it. And the fire is
deliberately a fresh top-level session.
So a narrowly-scoped instance calls Schedule create, and the fire runs later with
deployment-default authority: no parent, no dlg, nothing to attenuate against. Every
bound the model establishes gets discharged by writing it down and waiting.
This is the concrete half of A2. The owner field is what makes the fire attributable at
all.
B5 · Redis needs auth and TLS before any of this means anything
The detail is inline, on the "must exist in Redis" line. The part that belongs here: this
is a prerequisite for every phase of the design, not just for that one backstop sentence,
because Principal lands in the same store.
B6 · Scheduled workspaces need containment, and scope needs a resource axis
The detail is inline, on the "Workspace paths are not claims" line. I'm filing the
validateScheduleSpec half separately as a code issue, since it's live today and
independent of this design.
B7 · Child minting has to happen in composition, not through a port the loop calls
The doc says the issuer is "injected as a port; the engine loop stays identity-agnostic
(the same storage-agnostic discipline as port.EventLog)." It also says child minting
hooks into buildChildSession. Those two can't both be true.
EventLog works because the loop only emits, and a downstream relay persists — the loop
never calls Append. There is no downstream seam for spawn, because the child is
constructed and driven inside dispatch.
The fix is an idiom already in the tree. The team member factory is composition-supplied:
agent.TeamMemberEngineFactory is a closure built in composition, and
WithSubagentEngineFactory has the same shape. Mint inside composition-supplied factory
closures on both seams, and have engine/agent carry only an opaque string on
parentCaps, following the forkHistory precedent. No new port, and the
identity-agnostic claim survives.
If you'd rather the loop be identity-aware, that's defensible. But then the honest
in-tree analogy is Deps.ChildAskReviewer, not port.EventLog.
B8 · Smaller prerequisites
SessionLease.Owner can't carry the issuer identity. It has to be distinct per Build
— the doc's own words are "two Builds in one process get distinct owners" — while an
issuer identity is shared across replicas. Exclusion needs distinctness; attribution
needs sharing. It's also equality-compared in every backend, so overloading it would make
four adapters plus leaseconformance security-relevant. An additive field gets the same
result. (The same bullet also uses "pod identity" and "issuer identity"
interchangeably.)
callID needs sanitising before it becomes a path segment. It's the provider's
tool-call id, taken verbatim off the stream, so uniqueness depends on provider entropy.
Fine for OpenAI and Anthropic. Not fine for a gateway that emits call_1, where a
collision is a silent principal swap. sanitizeFireIDName already exists because a
schedule name containing a slash would land in a session id; the child id families never
got the same treatment.
The KMS residual needs one more category. "A compromised pod can request signatures"
covers infrastructure compromise. But on any image with a shell, prompt injection reaches
the same capability — and prompt injection is this doc's own primary adversary. The Bash
runner sets only cmd.Dir. governance.readOnlyVerbs classifies cat, ls, grep and
find as read-only by verb, with no path predicate. So IsolationApprovable
auto-approves them for an isolated child, with no human involved. Distroless plus the
/bin/sh default makes this inert today, which is worth naming as a requirement of the
feature rather than a happy accident, since coding-agent images routinely need git and
go. Separately, networkpolicy.yaml allows egress to anything on 443 with no to:
selector. Credit where it's due: it blocks port 80, so cloud metadata is unreachable.
Definition drift across a resume isn't detected. A project-tier AgentDef is read
from a mutable workspace, and instance identity is deliberately stable across reopen and
pod migration. So a resumed instance can be running a different catalog or model than the
one its credential was minted for. If you want to close that,
draft-goswami-agentic-jwt-01 derives agent identity from a one-way hash of prompt, tools
and configuration, and forces re-registration when any of them change. Two caveats: its
§VII-D1 flags a TOCTOU problem, because runtime template substitution is hard to tell
apart from prompt injection, and the mechanism is patent-pending (application
19/315,486).
jti-to-session-liveness isn't a substitute for revocation. It revokes the session,
not one leaked token. And since the harness re-mints on demand, a holder with access to
the signing path just mints a fresh jti. Calling it a liveness hint would be accurate.
Whether ListSessions must be principal-filtered is left undecided. Unfiltered, it
returns every stored session id — and under this threat model, an id is the lookup key.
C · Please add a section on what breaks today
The doc says nothing is implemented, but never states the current position. That matters,
because it changes what the design has to defend.
Service.ListSessions returns every stored session, with a Title derived from that
session's first user prompt, clamped to 120 runes. So it leaks the session inventory and
prompt content together, and no id is needed to get it. On Redis it takes the slow path,
because redisstore implements PrunableStore but not MetaLister, so it also loads
every session on every request.
GET /v1/sessions/{id}/events deliberately relays EvUserPrompt and
EvCompactionArchive — every prompt verbatim, plus entire pre-compaction conversations.
The handler comment explains why, and ends "Do NOT copy the live-relay filter here."
That's correct for a single-user harness, and it's exactly the assumption that breaks on
a shared store.
Framing that keeps this fair. mecatl has no tenants today, because one shared
operator token means one principal. So this is cross-session context isolation, not a
cross-tenant vulnerability. A missing session owner is also normal for harnesses: Claude
Code's listSessions(projectKey) takes no principal, Codex's get_threads returns
first_user_message, and LangGraph OSS's alist has no owner filter. Every system that
does enforce a check is a multi-tenant server product — Google ADK's primary key is
(app_name, user_id, session_id), and list_sessions can't be called without a
user_id. ADR 0048's shared Redis moved mecatl into the second category while the code
stayed in the first.
The lesson from ADK: put the principal in the signature, so enumeration is scoped by
construction. A get-by-id-only fix leaves ListSessions open.
Worth stealing from Entra: it hard-blocks specific permissions from ever being
granted to an agent identity, even by an admin who wants to grant them. That's a ceiling
that holds whether or not the issuer is correct, which is stronger than narrowing at the
issuer and then trusting the issuer.
And split the unattended-trigger gap from the parking gap. Sweeney covers async
consent, where a human approves out of band, so "no synchronous caller" is already
covered elsewhere. What nobody covers is firing repeatedly on a timer against an
already-granted authority, with no human involved at all. That's the Schedule/Fire shape.
Two contributions; the doc claims one.
|
Haven't done full review but just based on the first section I wrote this with claude (or did claude write it with me?) I chased down whether we could get all of this from SPIRE without standing up our own trust domain. Mechanically the answer is yes. SVID.MintJWTSVID mints a JWT-SVID for any SPIFFE ID with no registration entry lookup, and a CredentialComposer plugin can inject arbitrary private claims on that same signing path (ca.SignWorkloadJWTSVID calls CredBuilder.BuildWorkloadJWTSVIDClaims, which loops the configured composers). SPIRE would sign a path space we direct, and dlg/scope/txn ride along. No fork required. I don't think we should do it, for two reasons. First, the deployment ask is unacceptable. That design needs the customer to install a server-side plugin into their SPIRE server, and to give us a credential that SPIRE's own authz policy classifies as allow_admin. Admin is a boolean over the entire trust domain, not scoped to a path prefix, so an admin caller can mint any identity the customer has. We would be asking for a credential strictly more powerful than the one we are trying to build. Nobody sensible grants that, and a managed SPIFFE platform cannot grant it at all. Second, both surfaces are SPIRE implementation details, not SPIFFE spec. Nothing in SPIFFE-ID, JWT-SVID, or the Workload API says an issuer must let you inject private claims or mint unregistered IDs. SPIFFE issuance is diversifying: Defakto (formerly SPIRL) sells a SPIFFE platform, cert-manager's csi-driver-spiffe issues SVIDs signed by ordinary cert-manager issuers with no SPIRE anywhere, Istio's istiod has been its own CA for years. Building on SPIRE plugin surface means we only work in one of those worlds. So: own trust domain, but for a portability reason rather than the "SPIRE can't do delegation" reason the doc gives today. I'd rewrite that section. The real argument is narrower and stronger. SPIRE's attestation unit is a process, and our principals are goroutines. No workload attestor can attest an in-process principal, so we are the only thing that can attest our own sub-principals. We do that, and we stay on spec-only surface so we work with whatever issues identity in the cluster. Three layers, no vendor coupling anywhere:
Beyond this -- One question we haven't talked about. Build vs. buy. Do we use off the shelf library and systems or do we build our own? For security sensitive code we want to build on proven systems vs. going our own way. I have some slop from claude on this but haven't dug deeply. I feel that this should be part of the analysis. |
|
Right, I also agree we should not use SPIRE for this mechanism. It may be a possibility to leverage it for infra/workload identity, but it should be an optional implementation detail and not a requirement. I still don't have an answer on the build vs buy part. I'm trying to think of the north star and how it would look like. And then evaluate whether something existing gets us closer or whether we should aim to build that ourselves... or something in between. We'll get a notion of that soon... gotta get the head hamsters running and them GPUs generating heat. |
|
Recommendations + data points on the build vs buy option are welcome! |
|
Slop from Claude on build/buy. The biggest concern is to avoid writing subtle security code if we can manage it and instead rely on libraries. Still digesting.On not writing subtle security code The doc doesn't currently have a build-versus-buy section, and I think it needs one. go-spiffe/v2 gets a single mention as a revisit trigger. KMS and Vault appear as a pattern rather than a dependency. cert-manager and step-ca are cited as proof that issuer operation is a normal cost, not as things we build on. Biscuit, UCAN, and macaroons are in the research summary but not in the doc. Phase 1 reads as if trust domain config, signing, and the JWKS endpoint are all ours to write. Most of it isn't:
The attenuation half is where I'd push hardest, because it's what the doc calls innovation ground and it's the area with the most existing art. Biscuit does public-key offline attenuation by the token holder. That's stronger than "the issuer refuses to mint wider," and it takes the issuer off the child-spawn path entirely. But I checked, and the Go implementation is 89 stars with 24 open issues. Actively pushed, Apache-2.0, but small. I don't want that under our attenuation logic on the strength of a design doc, and I don't want to hand-roll subset checking without at least reading it first. Timeboxed spike, not a dependency decision. There's also a contradiction to resolve, and it changes the library answer. Line 307 says the parkable lifecycle works because "minting is a local signing call, not a network dependency." The key custody section puts the key in a KMS and rejects per-pod intermediates. A KMS sign is a network call. SPIRE gets local signing by using the KMS as an upstream authority: the KMS signs an intermediate, and the server signs workload SVIDs with that intermediate in memory. That's the pattern the doc rules out. |
|
|
||
| ``` | ||
| spiffe://<td>/user/<uid> | ||
| spiffe://<td>/agent/<def-name> |
There was a problem hiding this comment.
This namespace is interesting and may be too limited.
Let's say I launch atrium and start a session. What is the agent name then? Is this something that is bound to me, as a user? Do we create a unique name per user or per agent definition? Practically, how will this work?
I can see a world where you have long lived agents that are named and maybe not tied to a particular user. A service account type of scenario. But what about agents that are tied to users?
Perhaps something like spiffe://<td>/user-agent/<uid>/inst/<sessionID>?
Have a scheme for agents that are owned by users and another for those that are shared/service account agents? Maybe I'm just thinking about this the wrong way.
There was a problem hiding this comment.
Ah -- I see -- the delegation chain tells the story about who you are acting on behalf of.
But the point stands, I think, that this flat namespace may bite us. We could have structure and namespaces there at some point that are encoded differently, I guess. Use | as a separator and namespacing thing inside of the agent def id. Or go opaque and use a random identifier that has to be decoded elsewhere.
| 2. **The chain is audit, never authority.** 8693 §4.1 is normative: | ||
| consumers "MUST only consider the token's top-level claims and the | ||
| party identified as the current actor… prior actors identified by any | ||
| nested act claims are informational only." We honor exactly that: | ||
| authorization keys off `sub` (the acting instance) + `scope` (its | ||
| effective authority). `dlg` entries are informational — the audit | ||
| trail, not an authz input. This is how every deployed 8693 STS (AWS, | ||
| Azure, GCP SA impersonation) already evaluates tokens, and it is what | ||
| keeps a compromised or confused deep actor from re-asserting rights | ||
| via the chain. |
There was a problem hiding this comment.
This adopts 8693 §4.1 verbatim, but the doc changed which claims are top-level, so the rule lands wrong.
In canonical 8693, sub is the delegator (the user) and act is the current actor. Authorizing on the user is therefore a top-level check and is explicitly allowed. The prohibition is only on reaching into nested prior actors.
Here sub is the acting instance and the user has moved to the root of dlg. That is the right call given the JWT-SVID sub collision you work through above, but it means "which user is this for?" is now mechanically a dlg lookup, and this paragraph bans it. That is the most common legitimate authz question there is.
The distinction that matters is not audit vs authority, it is direction:
- Grants come from
sub+scope, never a chain entry. Keep this absolute. Ancestry-as-grant is monotonically widening, which is precisely what defeats attenuation. - The root principal is authorizable. It is the delegator, not a prior actor. It is invariant across every token in the tree, and granting on it widens nothing, because everything below it is already attenuated relative to it.
- Intermediate entries may narrow, never widen. "Deny if any hop was a background subagent" is safe. "Allow because the parent held write" is the forbidden move.
Two independent checks, both required: scope answers whether the action is permitted at all, the root answers whose resources it may touch. A downstream service asking "is this token rooted at the user who owns this repo?" is doing ownership matching, not privilege granting, and it needs that answer to function.
Suggested rewrite: the chain may restrict, never grant, and the root principal is authorizable as the delegator. Worth noting that root-based authz is only as trustworthy as the issuer that signed the chain, which is fine inside one trust domain and is another face of the cross-domain item already on your frontier list.
Two concrete cases where the answer depends on the root and no scope can carry it:
Rate limits. Alice has 1,000 calls/hour. Her agent spawns eight subagents (our default child concurrency). Each presents a valid, correctly attenuated SVID with a distinct sub. A limiter keyed on sub sees nine principals, all under the limit, and Alice now has 9,000. Attenuation did not help: every child scope was a strict subset and the invariant held. max_depth did not help either, because the fan-out is wide, not deep.
The user store. A child carries scope: memory:read. Which memory? Against sub you get an empty per-instance namespace. Against an ambient default you get cross-tenant reads. The root is the only correct answer. Billing attribution, data residency, and erasure requests are the same shape.
The reason is that scope is a verb vocabulary and identity is the subject. Folding the subject in means scopes that name resources, which is what "The scope vocabulary" already rules out when it excludes workspace paths. That is the right call, but it leaves resource-shaped questions answerable only from identity. A minimal verb-scope plus an ancestry-blind verifier leaves "whose?" nowhere to live.
| that never leave a signing service. | ||
|
|
||
| - **Key custody**: one logical issuer; the signing key lives in a KMS/Vault | ||
| Transit-style signing service (SPIRE's `aws_kms`/`gcp_kms`/`vault` upstream |
There was a problem hiding this comment.
I worry about the cost of this. Every outgoing tool call will require a call to the KMS to sign the JWT. Not sure the options to work through it but it is something to call out explicitly.
|
This isn't something that I can claim to be an expert on. While I set things in motion with SPIFFE, to really evaluate this stuff you have to live and breath it and I don't currently. So there is likely a lot that I missed. Jakub (and the agents) are much better on the details. The thing that would help me is an example that puts this in context. How do we expect this to work in practice? Are there concrete scenarios where we can dry lab test against it? Perhaps talk, in those scenarios, about the types of threats this would protect against? Having something evocative will help, for me, snap it into focus and we may see issues that we wouldn't otherwise see. |
|
Thanks so much for the thorough reviews, @jhrozek and @jbeda... this is exactly the kind of beating a design doc needs before it becomes an ADR. I went through everything, double-checked it against the primary sources (didn't want to just take anyone's word for it, ours included), and pushed a big amendment round plus a readability pass. Latest is So, what changed... The "why not SPIRE" section is rewritten around your argument, Joe. The attestation-unit point (SPIRE attests a process, our principals are goroutines, no attestor can reach an in-process principal) is the real reason, and it's stronger than what we had. I also corrected two things our draft got wrong: SPIFFE does have an on-behalf-of (the Broker API), and the "Delegated Identity API impersonates any workload" line was pointing at a deprecated draft. The frame now is portability, not capability... we keep the SPIFFE envelope wholesale and build only the delegation layer. The delegation semantics section had the sharpest catch. We were quoting RFC 8693 §4.1 verbatim as our evaluation rule, but our token inverts On claims: The KMS contradiction you both poked at is resolved by adopting the SPIRE pattern: KMS signs a short-lived intermediate, pods sign locally with it. "Minting is a local signing call" was never going to survive next to "keys live in KMS"... I also added a Build vs buy section (go-spiffe for verify, go-jose for sign, sigstore for KMS custody, and a Biscuit spike rather than a dependency), a "What breaks today" section (the ListSessions/events leaks, the scheduled-fire owner gap), and made phase 1 unsigned-and-honest per A3. One place I pushed back instead of folding: the namespace. I initially segmented the child path by family ( Still open and I'd love your read: the Happy to keep iterating. This is getting genuinely good! |
fc1a58f to
206de3e
Compare
jhrozek
left a comment
There was a problem hiding this comment.
Second pass, mostly on what's been added since last time: the threat model and the two
scenarios.
Most of my comments come back to one thing, so here it is up front. An agent can never
carry a tsid. Nothing mints one for it, because there is no browser login anywhere in
its path, and the exchange handler drops any it inherits. Both scenarios rely on a
credential lookup keyed on that claim. For an agent, that lookup cannot run.
Rather than just flag it, I worked the hop out in a doc stacked on this branch:
docs/agent-identity-outbound.md.
That doc also settles the question you left open, act as authority or audit-only. Your
reading of §4.1 is right. What I had missed is that the credential arriving at the gateway
is not an SVID. It is an ordinary access token minted by vMCP's authorization server, so
the JWT-SVID rule that forces sub to be the holder does not apply to it, and sub can
just be the user. Two credentials, two conventions, each right in its own domain, and no
chain for anyone to walk.
Two of the comments below are ones that doc depends on: the Cedar one, and the one about
where the delegation chain stops.
The scenarios were written to give @jbeda something concrete, which was the right call. The
stacked doc has worked examples of both token requests and a policy rule. Happy for those
to move into your doc rather than sit beside it.
|
|
||
| - **Key custody**: one logical issuer. The root key lives in a KMS/Vault | ||
| Transit-style signing service. **Each pod signs locally with a | ||
| short-lived intermediate key the KMS signs at startup and rotation**, |
There was a problem hiding this comment.
The signing key sits in the process an injected model can reach
The intermediate key is resident in the mecatl pod, for local-signing performance. The Bash
tool an injected model drives runs in that same pod.
So "a compromised pod can request signatures" and "prompt injection at the main agent" are
given separate risk postures, but this key-custody choice merges them, unless OS-level
isolation holds between the tool subprocess and the parent process holding the key. That
isolation is never named as an invariant, never tested, and not listed as an assumption.
SPIRE splits agent and server precisely so the signing component is never co-located with
the workload being attested. The doc cites SPIRE and then makes the opposite call for
performance, without revisiting whether that holds when the workload is driven by untrusted
natural language.
Two ways out: name the process isolation as a tested invariant of the model, or look at a
signing-sidecar shape that keeps the key out of the agent loop's address space.
|
Thanks for the second pass, @jhrozek... and for the stacked doc, which is genuinely good work. We ran it through another adversarial round against the primary sources and the actual code (didn't want to take your claims or ours on faith), and you were right on the load-bearing stuff. The tsid mechanism really is dead for an agent, Scenario A really does stop earlier than I wrote it, and "the chain rides the token the whole way" was sloppy of me. RFC 8693 §2.1 is about token-lifecycle coupling, and §4.1 puts the act chain in the output token, so the chain is verifiable by the backend but the credential scope is enforced at the gateway. I've got edits to make. But there's a reframe hiding in your own work table that I think changes the conversation, and I want to check we're on the same page about it. Your review treats a bunch of ToolHive behaviors as reasons the scenarios can't work: vMCP rejects external actor tokens, the tsid lookup is dead for agents, XAA hard-fails without a session-keyed ID token, there's no client_credentials grant, no confidential client. All true today. But... we own ToolHive and the Cedar layer. Those aren't constraints we design around, they're a work list we schedule. Your own "The work" table already treats them that way (the #6082, #5989, #5815, #5194 trackers). So the question stops being "given what vMCP does today, which model fits?" and becomes "which model is right, and what do we build in vMCP to support it?" That reopens a couple of things your review reads as settled, and I'm curious how you see them:
So, where does this land? My read is the two docs are complementary once scoped: mecatl issues the internal chain for attribution and audit, and the outbound hop is a separate boundary with its own token shape, and we get to choose what vMCP supports rather than inherit it. Does that match how you're thinking about part 2, or are you set on two-leg as the actual destination rather than the current best fit? |
|
Quick update, @jhrozek... I've pushed the full-agreement fixes ( What's in: The scenario section now opens with a "what's fixed vs what's ours to change" note. The current ToolHive behaviors you flagged (self-issued-only validation, the tsid-keyed lookup, Cedar string glob) are framed as a tracked work list (#5989, #5815, #6082), not constraints... which is the reframe from my last comment, now in the doc. Scenario A names the trust-placement fork out loud instead of pretending a mecatl-signed SVID crosses today. Two-leg (your shape) vs single-mint (teach vMCP to validate our SVID via #5989 + #5815). The diagram keeps two-leg because it works against the AS vMCP already has, but the fork is stated as an open decision, and it's the one I most want your read on. Scenario B is reframed as a user-keyed credential read with the ownership recheck, since tsid is dead for agents. I noted the primitive already exists ( "Attenuation enforceable by the backend" is fixed to "verifiable by the backend, enforced at the gateway" (your §4.1 vs §2.1 point), and the Cedar claim is precised to glob-on- Threat model: your P3 circularity catch is in (anchor to the IdP's original assertion iss+id, not the suspect component), your three threats are added (delegated-token-carrying-credential-ref, store-writer-no-signing, substituted trust bundle), P1 is softened (posture_ceiling is an identity-carried lever), P5 is digests-only, and the leaked-SVID bullet now says bearer-until-Phase-3. The signing-key section got the honest reachability note: local-signing buys audit/integrity, not process isolation, the Bash tool shares the FS namespace with whatever holds the key, and a policy-enforcing sidecar is a later-phase option. This is the other one I'd like your steer on... sidecar vs just leaning on the external-AS model for the outbound hop. Small stuff: three-tier convergence softened, single-audience is "strongly recommended" and required at the projection, my sigstore/go-spiffe module-graph claim corrected (net-new deps), agent/ trust tier noted as carried-not-enforced, "distinct principal" scoped to the internal tiers, txn vs outbound correlation split into two join keys, and the minting-seam lifetime precedent is Deps.ChildAskReviewer now, not port.EventLog. Left open on purpose, since they're design decisions not doc fixes: the two-leg vs single-mint fork, and the sidecar. Curious where you land. |
The review of #321 came back asking whether two legs is design merit or a workaround for what vMCP happens to reject today. Stress-testing our own reasoning showed the ranking was wrong, and the wrong ranking is what made the question reasonable to ask. The doc led with "the authorization server decides which agents may exist" and filed "mecatl signs nothing" below it as a deployment convenience. But the first one has a hole: if the worry is only that repo-written definitions could take operator names, mecatl could refuse to name untrusted-tier definitions itself, with no registration anywhere. Cheaper, and it closes the same hole on paper. What kills that, and what actually carries two legs, is that any such rule runs inside the process being injected. Under single-mint mecatl holds a key whose signature IS the authority claim, and the Bash tool shares its address space. An injected model signs an assertion naming any agent, so every rule keyed on act.sub is bypassable. That is the actor claim collapsing, not key hygiene. So signing nothing is the security property and who-decides is its consequence. Reordered to say that, with the honest cost stated: only registered definitions are nameable, so a per-project specialist runs under one rather than as one. Also states what would change our mind, which the doc did not. Two legs assumes the signing key stays reachable from the agent loop. A signing sidecar removes that assumption, and then mecatl-signed identity with the trust tier in the identifier becomes viable and buys back specialists as nameable principals. For the outbound hop the two are substitutes, not complements. Now an open question. And the Today block no longer reads as the motive. It said what ToolHive rejects before saying why the design is shaped this way, which invited exactly the reading the review gave it. Co-Authored-By: Claude Opus 5 <[email protected]>
jhrozek
left a comment
There was a problem hiding this comment.
Thanks — and one correction of ours before anything else.
You're right about §2.1 and we cited it wrongly. It's about token lifecycle
coupling, not about history in the output token, and §4.1 does carry the act
chain. Our comment overreached. The conclusion survives on better ground, and
that ground is worth having because it constrains your Cedar layer:
§4.1 requires a consumer to consider only the token's top-level claims and the
party identified as the current actor. So the chain is present and a
conformant consumer still evaluates one hop of it. Cedar cannot conformantly
intersect a nested act chain — worth knowing before anyone designs toward
that. And separately, the backend never receives our token at all, only a
provider credential, so verifiability there is moot for a reason neither of us
had stated.
Ours to fix: re-ground that paragraph on §4.1 and drop the §2.1 claim. Done
in #324.
Q1 — trust placement. Design merit, and it's three calls now, not two legs.
The shape: (1) client_credentials naming the root agent, audienced to the AS;
(2) token-exchange over the parent's agent token, which narrows per spawn;
(3) token-exchange adding the user, audienced to the gateway.
It doesn't rest on what vMCP rejects today. Under mecatl-signed identity the
strength of the actor claim equals the isolation of mecatl's signing key, and a
shell the injected model drives runs in that address space. Teaching vMCP to
validate our SVID makes this worse rather than better: it then validates the pod
with confidence and still takes mecatl's word about which agent is acting.
The argument I'd actually put weight on is yours. Your projection section says
the SVID is "a projection of the session's authority for outbound calls, never
the source of it," and your second projection rule — scope claims may only
narrow on re-mint — is exactly what call 2 enforces. You wrote the invariant.
The open question is only who enforces it, and an authorization server can while
a pod-resident key can't.
Action, ToolHive: #5815 currently requires actor_token.sub == client_id.
Call 2 needs the subject to name the agent while the client is the workload, so
that check rejects it. The replay attack it defends is real and cnf defends it
better — the token is already bound to the holder's key, so a leaked one is
useless rather than merely attributable. Ask: keep self-issued, bind by cnf
rather than by sub.
Action, ToolHive: BaselineClientScopes is one list applied to every client,
so today agent:code-reviewer is granted to everyone and call 1's refusal never
fires. Per-client scopes isn't a refinement of this design, it's the
precondition. Worth a line on #6082, since its SPIFFE option auto-registers with
every scope and would make calls 1 and 2 vacuous as-is.
Q2 — Cedar. No reason to prefer the glob, and the fix is bigger than exact
matching.
Two changes, and the second matters more. Use the set form for scope, because
claim_scope like "*cap:github.read*" also matches cap:github.readwrite. And
make the agent the typed principal entity rather than a string compared inside
context, so schema validation rejects a policy naming a nonexistent or
misspelled agent when it's written instead of silently matching nothing at
evaluation time.
One thing that came out of working this through: grantedScopes can't be derived
by Cedar. containsAll does the comparison, but the value has to be materialized
before the decision, and a stale or absent one means the rule permits. In our
shape that value arrives on the request inside the token, so it can't drift —
which is why the narrowing lives at call 2 and not in policy. Policy consumes an
already-narrowed token; it never computes the bound.
Action, ToolHive: structured evaluation plus the typed principal — after Q1,
not before. A correct SPIFFE parser evaluating an attacker-signed assertion is
still wrong.
Q3 — the sidecar. My earlier answer was wrong in the mechanism.
I'd said SO_PEERCRED over a unix socket. That doesn't work: peer credentials
distinguish processes, not privilege, and our shell subprocesses share the
parent's uid, so a subprocess can ptrace the parent and read the key. Pid pinning
is worth having on top but it isn't the control.
The split is two problems with two answers. A shell fetching its own SVID is
closed by a SPIRE selector pinning issuance to the binary — a spawned /bin/sh
fails unix:sha256. A shell reading the key out of the loop's memory is
closed only by a uid the loop doesn't have.
Your objection — that a faithful SPIRE split doesn't map onto goroutines — is
correct and doesn't bite, because the broker attests nothing and knows nothing
about goroutines. It keeps one key out of one address space. Subagents stay
goroutines.
Action, and I think this one is yours: the rule is no key whose possession
or signature carries authority sits in an address space an injected model can
reach. That's key custody, which is your doc's territory, and it covers your
KMS intermediate as much as our SVID — one uid-isolated holder would hold both.
If you state it there we'll reference it from part 2 rather than argue custody
twice and drift.
Your closing synthesis is right, and it is this shape. "mecatl issues the
internal chain for attribution and audit, and the outbound hop is a separate
boundary with its own token shape." If the outbound token is minted by the
gateway's AS, mecatl's chain never crosses the boundary. Two credentials, two
purposes, one of which travels.
Not set on anything as a destination. The three calls are what survives the
reachability argument; if the signing key moves out of the loop, mecatl-signed
identity with the trust tier in the identifier becomes viable again and buys back
per-project specialists as nameable principals — which the current shape gives
up. That trade is in #324 as an open question rather than a settled call.
| entities**. A subagent is a goroutine, not a pod; it never presents its own | ||
| SVID. When the harness makes an outbound call attributable to a subagent | ||
| (a forge API call, an MCP call), the *harness* presents the subagent's SVID | ||
| plus its own proof-of-possession. Only the pod tier holds keys; everything |
There was a problem hiding this comment.
This paragraph and the reachability note you added in the same commit can't
both stand.
Here the credential crossing to vMCP is a mecatl-signed subagent SVID, PoP'd by
the pod. Below, in the signing-key section, "local-signing buys audit/integrity
and availability, not process isolation. The Bash tool runs in the same
filesystem namespace…".
If the key is reachable by an injected shell, then a shell mints a subagent SVID
naming any agent with any scope — and the credential the gateway is trusting is
one you've already characterised as audit-grade.
The reconciliation is the split your own closing comment proposes: the
mecatl-signed chain is attribution inside mecatl's domain, where a forgery is a
lying log; the outbound authority credential comes from the AS, where a forgery
would be stolen authority. Both exist; only one crosses.
Action: either move the key out of the loop's address space — the Q3 uid
boundary — and this paragraph stands, or scope it to the internal chain and say
the outbound credential is AS-minted. I'd left this alone rather than editing
your file; happy either way.
| and it is ours to close** (it is the current implementation, not a | ||
| protocol law): the read should key on the *user* (`sub`/`UserID`), the | ||
| primitive for which already exists (`GetLatestUpstreamTokensForUser`), and | ||
| re-check the inbound `sub` against the stored `UserID` at the read seam |
There was a problem hiding this comment.
GetLatestUpstreamTokensForUser exists — verified. Two gaps before it satisfies
the read this design needs.
It's keyed (userID, providerID), so it's provider-grained. The read needs a
resolved target — tool, operation, resource — because "which provider" does
not distinguish one repository from another, and the whole point of the gate is
that the credential matches what was allowed.
And it leaves the call site untouched. The load still happens in auth middleware
before the JSON-RPC body is parsed, so nothing there knows what's being called.
A different key at the same call site is still a read-before-decision.
Action: a method taking a user and a resolved target, plus moving the call
after admission. The cheap way to keep the ordering honest is to make the
resolved target a value only admission can produce — then a caller in middleware
has nothing to pass and the early read stops being expressible.
|
We've talked this through across multiple review rounds — the SPIFFE-based trust-domain model, the |
* docs(agent-identity): part 2 — the outbound boundary The companion doc models identity from the user down to the subagent and stops at the boundary. This covers the boundary: how the harness reaches a tool, what the gateway decides, and how a user's stored third-party credential gets used without handing an agent more than it was given. Eight hops, with the three that carry real decisions worked out in detail. The exchange runs in two legs: the pod authenticates with its SVID and receives an agent token minted by vMCP's authorization server, then that token is the actor input to an exchange that adds the user. Splitting it puts the server, rather than mecatl, in charge of which agents may exist — a definition invented in a pull request cannot be named because nothing registered it — and means mecatl signs nothing, so no trust bundle crosses the boundary. The gate decides once over a resolved target, and the credential is read only after it allows, keyed on the user rather than on a login session. That last part is forced rather than chosen: an agent can never carry a tsid, so the lookup both current scenarios rely on cannot run for one at all. Status notes are inline, marked, and verified against code. They are cost signals, not constraints. Two review rounds found false claims in them and both times the claim sounded like plumbing and turned out to be a prerequisite, which is why they stay in the text rather than moving to an implementation doc. Deferred items each carry the condition that would un-defer them: resource-level authority, and per-agent credential isolation. The second is where AWS and Azure both are, and the honest summary of where this design stops is that it narrows every token except the one that reaches the provider. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): rank hop 3's argument by what actually carries it The review of #321 came back asking whether two legs is design merit or a workaround for what vMCP happens to reject today. Stress-testing our own reasoning showed the ranking was wrong, and the wrong ranking is what made the question reasonable to ask. The doc led with "the authorization server decides which agents may exist" and filed "mecatl signs nothing" below it as a deployment convenience. But the first one has a hole: if the worry is only that repo-written definitions could take operator names, mecatl could refuse to name untrusted-tier definitions itself, with no registration anywhere. Cheaper, and it closes the same hole on paper. What kills that, and what actually carries two legs, is that any such rule runs inside the process being injected. Under single-mint mecatl holds a key whose signature IS the authority claim, and the Bash tool shares its address space. An injected model signs an assertion naming any agent, so every rule keyed on act.sub is bypassable. That is the actor claim collapsing, not key hygiene. So signing nothing is the security property and who-decides is its consequence. Reordered to say that, with the honest cost stated: only registered definitions are nameable, so a per-project specialist runs under one rather than as one. Also states what would change our mind, which the doc did not. Two legs assumes the signing key stays reachable from the agent loop. A signing sidecar removes that assumption, and then mecatl-signed identity with the trust tier in the identifier becomes viable and buys back specialists as nameable principals. For the outbound hop the two are substitutes, not complements. Now an open question. And the Today block no longer reads as the motive. It said what ToolHive rejects before saying why the design is shaped this way, which invited exactly the reading the review gave it. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): record the flow as three calls, and correct two claims Two errors surfaced while illustrating the flow end to end. The two legs had silently become one exchange per hop. That happened when the subset-attenuation fix landed: making a child derive from its parent looked like it replaced the agent-token tier, so I collapsed them. It did not need to. The narrowing is a THIRD call between the two existing legs, and collapsing cost the AS-audienced intermediate token — a credential that only works as input to another token request is worthless to steal, and both AgentCore and Entra keep that property. Restored: call 1 names the root agent, call 2 narrows per spawn against the parent's token, call 3 adds the user. And "the subagent cannot make a call itself" is false. It is catalog-scoped, not structural: readOnlyExplorerCatalog has no MCP tool so the parent proxies, while noFSChildCatalog registers the global MCP tools and the child calls the gateway directly. Either way the token presented names the child in act, so the narrowing is what gets enforced. Hop 4 now says which component calls and why, and notes the default child still has a shell. Also recorded, all of it from the specialist round: Three scope namespaces, separated. cap:github.read is ours, not GitHub's, and Alice's IdP token carries no cap:* scope unless the AS is registered at the IdP with our vocabulary — so by default her token bounds identity, not capability, and the ceiling is the client registration alone. That is weaker than the doc previously implied. The client id is the workload, spiffe://…/ns/prod/sa/mecatl, not a pod instance. A per-pod registration would be unmaintainable, and the consequence is that replicas share one ceiling. One client authentication method. JWT-SVID assertion is the draft's fallback for deployments that cannot terminate mTLS at the authorization server, and we terminate it on the gateway call already. Call 1 is now named as the remaining hole, with AgentCore's refusal of the analogous path quoted, and the note that BaselineClientScopes being one list for every client makes call 1's refusal never fire — a precondition, not a refinement. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): fix the two overclaims, and write down revocation Three fixes from an audit against the settled ground truths in .scratch/binding-first-principles.md. Six of the eight held; these are the rest. The adversary table said a prompt-injected parent "cannot exceed its own [authority]" and that "a credential-carried ceiling bounds what it hands out." Hop 2 says no value representing a parent's current authority exists. So the table stated the intended design as if it shipped — the same error class we filed against the companion doc. It now says what is true: the parent can name and spawn any registered agent, cannot name an unregistered one or present another user, and the bound is the registration rather than a runtime ceiling. The proof slice used one agent and a denied write. A single-agent run never requests a second definition, so the step that matters never executes and the slice passes whether or not the spawn is guarded. Two agents now, one read-only and one writing, and the criterion is that the read-only one cannot obtain the other's authority. And revocation was absent from the document entirely — zero mentions, in a design whose instance tier exists for attribution. The ground truths had settled on two credentials, a shared one plus a cheap per-call token naming the individual, on the argument that you cannot revoke a label. This design collapsed that to one credential plus a correlation header and never recorded why. Written down now, with the argument stated rather than assumed: an instance is a goroutine, cancelling it is the revocation, and a per-instance credential would name something no external party can address, present or revoke — a credential in form and a log field in effect. draft-ietf-wimse-arch section 2 requires a workload to be independently addressable, which a goroutine is not. The reversal trigger is named too: a subagent in its own process is addressable, and the two-token shape becomes correct at that point. Also recorded, from the consent review: revocation is bounded by TTL, not by the revoking action. Removing a grant does not invalidate a token already issued. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): close call 1 with a uid boundary, not a protocol change Call 1's ceiling is the pod's whole registration, and the doc left that as an unresolved open question with three candidate answers. Two of the three are dead and the third was never the point. A startup-only root grant is not expressible in any registered mechanism, and would not work anyway: boot code mints tokens for every agent name, and a same-uid shell reads them out of process memory. Exhausting the grant hands the shell the already-minted token instead of letting it ask. One pod per session fails on storage rather than semantics — a mature authorization server's client store degrades well before ten thousand clients, and create-then-delete-in- seconds is not a supported access pattern. What actually matters is reachability, and it splits in two. A shell FETCHING its own SVID is closed by a SPIRE selector pinning issuance to the binary, which a spawned shell fails. A shell READING the key out of the agent loop's memory is closed only by a uid the loop does not have, because a subprocess sharing a uid can ptrace its parent. That second half is why an earlier note about SO_PEERCRED was wrong: peer credentials distinguish processes, not privilege, when the uid is shared. So the SVID moves to a token broker at its own uid, making all three calls on the loop's behalf, with pid pinning on top and its agent-name policy in configuration the loop cannot write. Recorded with what it is not: the broker attests nothing and knows nothing about goroutines. It keeps one key out of one address space. AgentCore reaches the same property with one agent per Runtime per execution role. A uid boundary buys it without one pod per session. The reachability claim is marked unverified, because whether a shell can reach the SVID in our deployment depends on the selector and the inherited socket path, and neither is checked in our code. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): make the agent a typed Cedar entity, not a context string The example rule compared context.claim_act.sub against a string literal. That is stringly typed end to end: a policy naming a nonexistent agent, or one whose casing or SPIFFE path segments drift from what the token carries, matches nothing and reports no error. Silent non-match, not a validation failure. With the agent as the principal entity, Cedar's schema validator rejects that when the policy is written. Entity grouping also becomes available, though the doc does not use it — an entity DAG expresses membership, not an ordered lattice of privilege, so "own group or below" is not something to force into it. Same class as the claim_scope substring hazard already recorded, and the two are now stated together. Also recorded, and it is the load-bearing part: grantedScopes cannot be derived by Cedar. containsAll does the comparison but the value has to be materialized before the decision, and a stale or missing value means the rule permits. In this design that value comes from the token on the request, so it cannot drift — which is precisely why the narrowing lives at call 2 and not in policy. Policy consumes an already-narrowed token; it never computes the bound. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): gate the credential read per agent, without copying it The read was keyed on the user alone, so every agent acting for Alice reached every integration she had connected. AWS keys its vault on the agent and the user together and gets integration isolation from it. Copying the credential per agent is the wrong way to reach that. A per-agent copy of Alice's provider token still carries her whole grant, so duplication buys no scope reduction while multiplying consent flows, rotation points and revocation calls. One credential per user and provider with a read policy naming the agent gets the same isolation and leaves one thing to rotate — and an audit log already records which reader touched which secret, which is the forensic half of the same property. Also recorded: the store need only check the agent. Admission establishes the user before the read happens, so the dual-principal decision stays where it already is and the store answers one question. That matters because a store's policy language may not be able to address a nested actor claim at all, and this design does not need it to. Two leftovers fixed in passing: the paragraph still said "leg 2" and "GitHub" where the surrounding text now says call 3 and speaks of providers generally. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): provider narrowing is a capability axis, consent is a signature Two later-phase entries stated more narrowly than the truth. The provider row said this design narrows every token except the one reaching the provider, and left it there as if nothing could be done. What is true is that nothing can narrow a credential it did not mint, so a stored user OAuth token is final — but some providers will issue a credential scoped to one resource and one permission from a grant already held, and for those the store can derive per call instead of handing over what it stored. That is a property of each provider and a per-integration decision, not a step in the flow and not one provider's feature promoted into a structural position. The per-agent consent entry treated the un-defer condition as a record that does not exist yet. The harder half is that no mechanism produces one for a scheduled run: an absent user cannot consent, and the only available pattern is an administrator deciding in advance that consent is not needed for a class of agent. That substitutes organizational authorization for the user's. Recorded as a decision someone signs rather than a gap to be engineered away. Also finished the leg-to-call renaming these two paragraphs had missed. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): redraw the diagram — the broker was missing from it Four prose commits changed the flow and none of them touched the picture, which is the same failure as last time: edit the text, forget the drawing. The worst of it was that the token broker was absent. It holds the only private key in the system and makes all three token calls, so leaving it out did not simplify the diagram, it deleted the mechanism that closes call 1. The loop now asks the broker to mint and the broker talks to the authorization server, so the uid boundary is visible as the thing standing between an injected model and the pod's credential. The startup note moved with it, since fetching the SVID is the broker's job and was attributed to the pod. Three smaller drifts fixed at the same time. The leg naming was stale where the prose says call 1, 2 and 3. The credential read said "keyed on Alice and that target" without the per-agent gate. And the provider call named Alice's GitHub token, which contradicts provider narrowing being a per-provider capability — the participant is now "the provider" and the store returns the narrowest credential that provider can issue. Also shown, because it is the residual and hiding it would flatter the design: the loop hands Alice's token to the broker for call 3. A shell in the loop has that token too, which is why the floor is that it can do whatever Alice can. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): the pod is the workload, the broker is the key holder The named invariant said "the pod is the workload and the key holder," which the broker commit made false two commits earlier. Worse than stale: it asserted the exact arrangement that leaves call 1's ceiling reachable, in the section the rest of the document defers to by name. Split into the two facts it was conflating. Nothing below the pod holds a key — unchanged, and the reason is unchanged: siblings share a process. And the pod's key is not in the agent loop, because a key in that address space is readable by a shell the loop can spawn. Workload identity is the pod's; custody is the broker's. The second half is new to the invariant list and is what closes call 1, so it belongs here rather than only in hop 3 where the argument lives. Note for the reply to the companion doc: this is a key-custody rule and custody is that doc's territory. It also answers its open question about a signing sidecar, and it generalizes — the same argument applies to mecatl's own signing key, not just to the SVID. The rule should be stated there and referenced here rather than argued twice. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): we cited RFC 8693 section 2.1 for something it does not say Hop 7 used §2.1's "one-time event... does not create a tight linkage between the input and output tokens" to argue a backend cannot reconstruct the delegation chain. That sentence is about lifecycle coupling between the two tokens, not about what the output token carries — and §4.1 does put the act chain in the output. The companion doc's author caught it. Same error class we have been filing against his citations, so it is recorded as a replacement rather than quietly swapped. The conclusion holds on two better grounds. §4.1 requires a consumer to consider only top-level claims and the party identified as the current actor, so a conformant consumer evaluates one hop even though the chain is present — which also bounds the gateway's policy layer, since it may not conformantly intersect a nested act. And the backend never receives our token at all, only a provider credential, so there is nothing there to walk regardless. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): link the outbound doc into the strawman index docs/agent-identity-outbound.md had no inbound link, so matlatl's strict check flagged it as unreachable/under-linked and failed CI. Cross-link it from the strawman index next to agent-identity-model.md (part 1) and regenerate llms.txt. Co-Authored-By: Claude Sonnet 5 <[email protected]> --------- Co-authored-by: Claude Opus 5 <[email protected]>
…domain Design doc (pre-ADR strawman tier, like scoped-resource-grants.md): three-tier identity (definition/instance/run) mapped onto AgentDef/ Session/Run, JWT-SVIDs with a private delegation vocabulary (dlg chain, monotone scope attenuation, depth limits, txn correlation), KMS-backed issuer HA per the converged industry pattern, projection-not-authority semantics, the parkable HITL credential lifecycle (innovation ground), and dual-ID audit over the existing EventLog. Co-Authored-By: mecatl <[email protected]>
The delegation section now states the three normative commitments (dlg IS act nesting; chain is audit never authority per the informational-only rule; delegation never impersonation), explains that may_act's consent-hook role is played by definition-tier policy, and marks exactly where 8693 ends and the novel part begins (enforced attenuation, in-process exchange). Co-Authored-By: mecatl <[email protected]>
…sion argument Self-containedness pass from an independent review: define the Q1-Q5 verdict labels in the prior-art section, replace in-group shorthand (gauntlet-#7, ADR List 3) with what it means, gloss ADR references and the governance evaluator on first use, bound the SPIFFE path depth by max_depth, tally the unanswered issuer-operator questions, and move the parkable-lifecycle section next to the credential mechanics. Also adds the load-bearing argument for dlg over act: JWT-SVID and RFC 8693 assign sub incompatible meanings (holder's SPIFFE ID vs delegator), so the chain rides a private claim with 8693-derived semantics. Co-Authored-By: mecatl <[email protected]>
…s not enough) + dlg revisit triggers Adds the reader-facing case for the work: the trust-me semantics of a multi-tenant delegation machine today (self-attested audit, unattributable outbound calls, convention-only delegation narrowing, unproven multi-tenancy) and what an identity layer changes. Explains why SPIRE stays for infrastructure but cannot carry user/agent/subagent delegation (workload-scoped identity, no on-behalf-of, no attenuation semantics, wrong-shaped escape hatches). Records the five conditions under which the dlg-vs-act decision flips, from the adversarial team review. Co-Authored-By: mecatl <[email protected]>
Readability (long sentences split, passive to active), engagement (section claims lead; north-star claim stands alone), terminology locked (governance evaluator, instance SVID, mint), em-dash density reduced, section transitions connected, doubled hedges removed. Structure, technical content, and honesty markers unchanged. Gates: matlatl strict clean, docs/lint passes. Co-Authored-By: mecatl <[email protected]>
…elegation semantics, claims, lifecycle Fold in the double-checked findings from the research sweep and the two reviewers (jhrozek, jbeda), keeping only what survived primary-source verification: - Why-not-SPIRE rewritten around the attestation-unit argument (process vs goroutine), correcting the false 'no on-behalf-of' claim and the Delegated Identity API overstatement; portability, not capability. - Delegation semantics restated in this token's own vocabulary instead of quoting RFC 8693 §4.1 verbatim (the sub inversion makes the verbatim rule semantically dangling); audit-vs-authority reconciled (prior actors audit, current actor = sub is an authority input). - Claims: scope -> RFC 9396 authorization_details (adds resources axis for the workspace gap); dlg -> delegation_chain (cite liu drafts); URI-named private claims; txn noted as RFC 8417-registered; cnf+jkt for PoP. - Namespace: kept flat child/<childSessionID> after the K3 security sweep showed family-segmentation was overreach; sanitize-and-reject def names (the one justified change). - Lifecycle: JWT-SVID mint-per-request framing, Zhu convergence, live- caller authority + signed-chain integrity on resume, TTL-only as considered-and-rejected. - Issuer: adopt KMS-signed per-pod intermediates (resolves the local-signing contradiction); drop the false Redis backstop; federation honesty (https_web/https_spiffe, bilateral). - New sections: Build vs buy, What breaks today; phasing made unsigned-and-honest-first (A3); risks add JWT size budget, key-compromise recovery, def drift, deployment-scale optionality. Co-Authored-By: mecatl <[email protected]>
K3 tech-writer pass: gloss first-use jargon (sessnap, HSET, ID-JAG, CB4A, actor-profile, client_credentials), split overlong sentences in the new/ rewritten sections, reduce em-dash density, add a connective line to Build vs buy. No technical changes; claim names, citations, and structure preserved. Gates: matlatl strict clean, docs/lint passes. Co-Authored-By: mecatl <[email protected]>
Repair a mid-compound line break the sentence split left ('This state /
machine') and correct an overclaim the writer inherited ('resolved here
rather than deferred' -> 'named here rather than deferred' — the JWKS SLO
is named, not resolved). Manual sweep confirms no other broken wraps or
overlong prose lines; remaining long lines are table rows + the banner.
Co-Authored-By: mecatl <[email protected]>
…end scenarios Adds the capstone the reviewers asked for: an ASCII trust-boundary diagram (user edge / state / downstream / trust-domain edge), a three-actor adversary model (compromised subagent, compromised pod, leaked SVID) with what the design does and does not defend, and two grounded end-to-end flows using ToolHive vMCP as the testing ground — the XAA/ID-JAG cross- domain path and the user-keyed credential-store path (loadUpstreamTokens tsid -> GetAllUpstreamCredentials -> upstream_inject). Notes explicitly that ToolHive is the example because it already ships the delegation constructs, not the only option; the same shape applies to any downstream (memory service, filesystem grants) that supports them. Co-Authored-By: mecatl <[email protected]>
Verification pass (three agents, primary sources) caught real errors: - Scenario A: GitHub's AS only supports authorization_code + device_code — no token-exchange, no ID-JAG (an Okta-authored enterprise-IdP-to- enterprise-app grant). Swapped the backend to an enterprise service federated with the org's IdP, and said explicitly why GitHub is not a valid XAA example. GitHub moves to Scenario B, where the plain 3LO credential-store path genuinely works. - Scenario B: stopped overclaiming the tsid binding. ToolHive's read path keys on tsid alone and never re-checks inbound sub against stored UserID (ErrInvalidBinding declared, never returned), and under this design's own tier model the inbound sub is the acting instance, not the user. Reframed 'the right user's credential' as a mecatl-side guarantee (bind tsid to Alice-rooted chains only) plus a ToolHive-side gap to file. - Threat model: added the Phase-2 caveat to 'the issuer refuses to mint wider' (today it's catalog + audience fold, not crypto containment) and named five missing adversaries: main-agent prompt injection (P1), malicious tenant / tenant isolation (P2), edge mis-binding (P3), downstream credential-store compromise (P4), event-log replay/exfil (P5). Co-Authored-By: mecatl <[email protected]>
161 em-dashes read as LLM-generated. Convert them to commas, periods, colons, or parentheses throughout the prose, section by section with real edits (no script). Kept only the one inside an ASCII diagram and any in verbatim quotes. No technical changes. Co-Authored-By: mecatl <[email protected]>
…review round Consensus amendments after the adversarial verification of jhrozek's second pass and PR #324, reframed by the fact that the team owns ToolHive/Cedar: - Scenario intro: add the 'fixed vs ours to change' note. Current ToolHive behaviors (self-issued-only validation, tsid-keyed lookup, Cedar string glob) are a tracked work list (#5989/#5815/#6082), not constraints. - Scenario A: name the trust-placement fork (two-leg AS-minted vs single- mint via multi-issuer validator) instead of pretending the mecatl-signed SVID crosses today; diagram keeps the two-leg shape with the fork stated. - Scenario B: reframe the credential read as user-keyed (the primitive exists) with the ownership recheck, since tsid is dead for agents; this is an enhancement we own, not a protocol law. - 'Attenuation enforceable by backend' -> verifiable by backend (RFC 8693 4.1 carries the act chain) but credential scope enforced at the gateway. Cedar claim precised (glob on context.claim_act.sub, user as principal). - Threat model: P3 circularity fixed (anchor to IdP assertion iss+id); added three threats (delegated-token-carrying-credential-ref, store- writer-no-signing, substituted trust bundle); P1 softened (posture_ceiling is an identity-carried lever); P5 digests-only anchoring; leaked-SVID is bearer-until-Phase-3. - Signing key: honest NLP-reachability note (no OS isolation, envscrub irrelevant to in-memory signer); local-signing is audit/integrity not isolation; sidecar as later-phase option. - Accuracy: three-tier convergence softened; single-audience 'strongly recommended' and required-at-projection (confused deputy); sigstore/ go-spiffe noted as net-new deps; agent/<def> trust tier carried-not- enforced; 'distinct principal' scoped to internal tiers; txn vs outbound correlation as two join keys; minting-seam lifetime precedent is Deps.ChildAskReviewer not port.EventLog. Co-Authored-By: mecatl <[email protected]>
* docs(agent-identity): part 2 — the outbound boundary The companion doc models identity from the user down to the subagent and stops at the boundary. This covers the boundary: how the harness reaches a tool, what the gateway decides, and how a user's stored third-party credential gets used without handing an agent more than it was given. Eight hops, with the three that carry real decisions worked out in detail. The exchange runs in two legs: the pod authenticates with its SVID and receives an agent token minted by vMCP's authorization server, then that token is the actor input to an exchange that adds the user. Splitting it puts the server, rather than mecatl, in charge of which agents may exist — a definition invented in a pull request cannot be named because nothing registered it — and means mecatl signs nothing, so no trust bundle crosses the boundary. The gate decides once over a resolved target, and the credential is read only after it allows, keyed on the user rather than on a login session. That last part is forced rather than chosen: an agent can never carry a tsid, so the lookup both current scenarios rely on cannot run for one at all. Status notes are inline, marked, and verified against code. They are cost signals, not constraints. Two review rounds found false claims in them and both times the claim sounded like plumbing and turned out to be a prerequisite, which is why they stay in the text rather than moving to an implementation doc. Deferred items each carry the condition that would un-defer them: resource-level authority, and per-agent credential isolation. The second is where AWS and Azure both are, and the honest summary of where this design stops is that it narrows every token except the one that reaches the provider. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): rank hop 3's argument by what actually carries it The review of #321 came back asking whether two legs is design merit or a workaround for what vMCP happens to reject today. Stress-testing our own reasoning showed the ranking was wrong, and the wrong ranking is what made the question reasonable to ask. The doc led with "the authorization server decides which agents may exist" and filed "mecatl signs nothing" below it as a deployment convenience. But the first one has a hole: if the worry is only that repo-written definitions could take operator names, mecatl could refuse to name untrusted-tier definitions itself, with no registration anywhere. Cheaper, and it closes the same hole on paper. What kills that, and what actually carries two legs, is that any such rule runs inside the process being injected. Under single-mint mecatl holds a key whose signature IS the authority claim, and the Bash tool shares its address space. An injected model signs an assertion naming any agent, so every rule keyed on act.sub is bypassable. That is the actor claim collapsing, not key hygiene. So signing nothing is the security property and who-decides is its consequence. Reordered to say that, with the honest cost stated: only registered definitions are nameable, so a per-project specialist runs under one rather than as one. Also states what would change our mind, which the doc did not. Two legs assumes the signing key stays reachable from the agent loop. A signing sidecar removes that assumption, and then mecatl-signed identity with the trust tier in the identifier becomes viable and buys back specialists as nameable principals. For the outbound hop the two are substitutes, not complements. Now an open question. And the Today block no longer reads as the motive. It said what ToolHive rejects before saying why the design is shaped this way, which invited exactly the reading the review gave it. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): record the flow as three calls, and correct two claims Two errors surfaced while illustrating the flow end to end. The two legs had silently become one exchange per hop. That happened when the subset-attenuation fix landed: making a child derive from its parent looked like it replaced the agent-token tier, so I collapsed them. It did not need to. The narrowing is a THIRD call between the two existing legs, and collapsing cost the AS-audienced intermediate token — a credential that only works as input to another token request is worthless to steal, and both AgentCore and Entra keep that property. Restored: call 1 names the root agent, call 2 narrows per spawn against the parent's token, call 3 adds the user. And "the subagent cannot make a call itself" is false. It is catalog-scoped, not structural: readOnlyExplorerCatalog has no MCP tool so the parent proxies, while noFSChildCatalog registers the global MCP tools and the child calls the gateway directly. Either way the token presented names the child in act, so the narrowing is what gets enforced. Hop 4 now says which component calls and why, and notes the default child still has a shell. Also recorded, all of it from the specialist round: Three scope namespaces, separated. cap:github.read is ours, not GitHub's, and Alice's IdP token carries no cap:* scope unless the AS is registered at the IdP with our vocabulary — so by default her token bounds identity, not capability, and the ceiling is the client registration alone. That is weaker than the doc previously implied. The client id is the workload, spiffe://…/ns/prod/sa/mecatl, not a pod instance. A per-pod registration would be unmaintainable, and the consequence is that replicas share one ceiling. One client authentication method. JWT-SVID assertion is the draft's fallback for deployments that cannot terminate mTLS at the authorization server, and we terminate it on the gateway call already. Call 1 is now named as the remaining hole, with AgentCore's refusal of the analogous path quoted, and the note that BaselineClientScopes being one list for every client makes call 1's refusal never fire — a precondition, not a refinement. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): fix the two overclaims, and write down revocation Three fixes from an audit against the settled ground truths in .scratch/binding-first-principles.md. Six of the eight held; these are the rest. The adversary table said a prompt-injected parent "cannot exceed its own [authority]" and that "a credential-carried ceiling bounds what it hands out." Hop 2 says no value representing a parent's current authority exists. So the table stated the intended design as if it shipped — the same error class we filed against the companion doc. It now says what is true: the parent can name and spawn any registered agent, cannot name an unregistered one or present another user, and the bound is the registration rather than a runtime ceiling. The proof slice used one agent and a denied write. A single-agent run never requests a second definition, so the step that matters never executes and the slice passes whether or not the spawn is guarded. Two agents now, one read-only and one writing, and the criterion is that the read-only one cannot obtain the other's authority. And revocation was absent from the document entirely — zero mentions, in a design whose instance tier exists for attribution. The ground truths had settled on two credentials, a shared one plus a cheap per-call token naming the individual, on the argument that you cannot revoke a label. This design collapsed that to one credential plus a correlation header and never recorded why. Written down now, with the argument stated rather than assumed: an instance is a goroutine, cancelling it is the revocation, and a per-instance credential would name something no external party can address, present or revoke — a credential in form and a log field in effect. draft-ietf-wimse-arch section 2 requires a workload to be independently addressable, which a goroutine is not. The reversal trigger is named too: a subagent in its own process is addressable, and the two-token shape becomes correct at that point. Also recorded, from the consent review: revocation is bounded by TTL, not by the revoking action. Removing a grant does not invalidate a token already issued. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): close call 1 with a uid boundary, not a protocol change Call 1's ceiling is the pod's whole registration, and the doc left that as an unresolved open question with three candidate answers. Two of the three are dead and the third was never the point. A startup-only root grant is not expressible in any registered mechanism, and would not work anyway: boot code mints tokens for every agent name, and a same-uid shell reads them out of process memory. Exhausting the grant hands the shell the already-minted token instead of letting it ask. One pod per session fails on storage rather than semantics — a mature authorization server's client store degrades well before ten thousand clients, and create-then-delete-in- seconds is not a supported access pattern. What actually matters is reachability, and it splits in two. A shell FETCHING its own SVID is closed by a SPIRE selector pinning issuance to the binary, which a spawned shell fails. A shell READING the key out of the agent loop's memory is closed only by a uid the loop does not have, because a subprocess sharing a uid can ptrace its parent. That second half is why an earlier note about SO_PEERCRED was wrong: peer credentials distinguish processes, not privilege, when the uid is shared. So the SVID moves to a token broker at its own uid, making all three calls on the loop's behalf, with pid pinning on top and its agent-name policy in configuration the loop cannot write. Recorded with what it is not: the broker attests nothing and knows nothing about goroutines. It keeps one key out of one address space. AgentCore reaches the same property with one agent per Runtime per execution role. A uid boundary buys it without one pod per session. The reachability claim is marked unverified, because whether a shell can reach the SVID in our deployment depends on the selector and the inherited socket path, and neither is checked in our code. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): make the agent a typed Cedar entity, not a context string The example rule compared context.claim_act.sub against a string literal. That is stringly typed end to end: a policy naming a nonexistent agent, or one whose casing or SPIFFE path segments drift from what the token carries, matches nothing and reports no error. Silent non-match, not a validation failure. With the agent as the principal entity, Cedar's schema validator rejects that when the policy is written. Entity grouping also becomes available, though the doc does not use it — an entity DAG expresses membership, not an ordered lattice of privilege, so "own group or below" is not something to force into it. Same class as the claim_scope substring hazard already recorded, and the two are now stated together. Also recorded, and it is the load-bearing part: grantedScopes cannot be derived by Cedar. containsAll does the comparison but the value has to be materialized before the decision, and a stale or missing value means the rule permits. In this design that value comes from the token on the request, so it cannot drift — which is precisely why the narrowing lives at call 2 and not in policy. Policy consumes an already-narrowed token; it never computes the bound. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): gate the credential read per agent, without copying it The read was keyed on the user alone, so every agent acting for Alice reached every integration she had connected. AWS keys its vault on the agent and the user together and gets integration isolation from it. Copying the credential per agent is the wrong way to reach that. A per-agent copy of Alice's provider token still carries her whole grant, so duplication buys no scope reduction while multiplying consent flows, rotation points and revocation calls. One credential per user and provider with a read policy naming the agent gets the same isolation and leaves one thing to rotate — and an audit log already records which reader touched which secret, which is the forensic half of the same property. Also recorded: the store need only check the agent. Admission establishes the user before the read happens, so the dual-principal decision stays where it already is and the store answers one question. That matters because a store's policy language may not be able to address a nested actor claim at all, and this design does not need it to. Two leftovers fixed in passing: the paragraph still said "leg 2" and "GitHub" where the surrounding text now says call 3 and speaks of providers generally. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): provider narrowing is a capability axis, consent is a signature Two later-phase entries stated more narrowly than the truth. The provider row said this design narrows every token except the one reaching the provider, and left it there as if nothing could be done. What is true is that nothing can narrow a credential it did not mint, so a stored user OAuth token is final — but some providers will issue a credential scoped to one resource and one permission from a grant already held, and for those the store can derive per call instead of handing over what it stored. That is a property of each provider and a per-integration decision, not a step in the flow and not one provider's feature promoted into a structural position. The per-agent consent entry treated the un-defer condition as a record that does not exist yet. The harder half is that no mechanism produces one for a scheduled run: an absent user cannot consent, and the only available pattern is an administrator deciding in advance that consent is not needed for a class of agent. That substitutes organizational authorization for the user's. Recorded as a decision someone signs rather than a gap to be engineered away. Also finished the leg-to-call renaming these two paragraphs had missed. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): redraw the diagram — the broker was missing from it Four prose commits changed the flow and none of them touched the picture, which is the same failure as last time: edit the text, forget the drawing. The worst of it was that the token broker was absent. It holds the only private key in the system and makes all three token calls, so leaving it out did not simplify the diagram, it deleted the mechanism that closes call 1. The loop now asks the broker to mint and the broker talks to the authorization server, so the uid boundary is visible as the thing standing between an injected model and the pod's credential. The startup note moved with it, since fetching the SVID is the broker's job and was attributed to the pod. Three smaller drifts fixed at the same time. The leg naming was stale where the prose says call 1, 2 and 3. The credential read said "keyed on Alice and that target" without the per-agent gate. And the provider call named Alice's GitHub token, which contradicts provider narrowing being a per-provider capability — the participant is now "the provider" and the store returns the narrowest credential that provider can issue. Also shown, because it is the residual and hiding it would flatter the design: the loop hands Alice's token to the broker for call 3. A shell in the loop has that token too, which is why the floor is that it can do whatever Alice can. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): the pod is the workload, the broker is the key holder The named invariant said "the pod is the workload and the key holder," which the broker commit made false two commits earlier. Worse than stale: it asserted the exact arrangement that leaves call 1's ceiling reachable, in the section the rest of the document defers to by name. Split into the two facts it was conflating. Nothing below the pod holds a key — unchanged, and the reason is unchanged: siblings share a process. And the pod's key is not in the agent loop, because a key in that address space is readable by a shell the loop can spawn. Workload identity is the pod's; custody is the broker's. The second half is new to the invariant list and is what closes call 1, so it belongs here rather than only in hop 3 where the argument lives. Note for the reply to the companion doc: this is a key-custody rule and custody is that doc's territory. It also answers its open question about a signing sidecar, and it generalizes — the same argument applies to mecatl's own signing key, not just to the SVID. The rule should be stated there and referenced here rather than argued twice. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): we cited RFC 8693 section 2.1 for something it does not say Hop 7 used §2.1's "one-time event... does not create a tight linkage between the input and output tokens" to argue a backend cannot reconstruct the delegation chain. That sentence is about lifecycle coupling between the two tokens, not about what the output token carries — and §4.1 does put the act chain in the output. The companion doc's author caught it. Same error class we have been filing against his citations, so it is recorded as a replacement rather than quietly swapped. The conclusion holds on two better grounds. §4.1 requires a consumer to consider only top-level claims and the party identified as the current actor, so a conformant consumer evaluates one hop even though the chain is present — which also bounds the gateway's policy layer, since it may not conformantly intersect a nested act. And the backend never receives our token at all, only a provider credential, so there is nothing there to walk regardless. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(agent-identity): link the outbound doc into the strawman index docs/agent-identity-outbound.md had no inbound link, so matlatl's strict check flagged it as unreachable/under-linked and failed CI. Cross-link it from the strawman index next to agent-identity-model.md (part 1) and regenerate llms.txt. Co-Authored-By: Claude Sonnet 5 <[email protected]> --------- Co-authored-by: Claude Opus 5 <[email protected]>
51ed065 to
4383ccd
Compare
Both design docs landed on main in #321, so the breakdown no longer needs to carry them. Rebased onto main and reduced to what is actually new: the issues doc itself, plus the status-block link from doc 1 forward to this file and to part 2. Defines the doc 1 / doc 2 / phase shorthand once at the top instead of leaving it implied, and re-points the one citation that named engine/port/ without its module prefix. Co-Authored-By: Claude Opus 5 <[email protected]>
Grounding: ToolHive vMCP auth & the XAA/ID-JAG implementation
Research pass over the ToolHive codebase (vMCP auth path,
pkg/vmcp/auth/**,pkg/authserver/**, Cedar authz, and the RFC corpus) to ground this design in a concrete MCP-gateway use case. No doc edits in this comment; this is context + an integration sketch for discussion. Curious how this matches your read, @jhrozek.What ToolHive ships today (verified in code)
XAA/ID-JAG is fully implemented (THV-0079,
pkg/vmcp/auth/strategies/xaa.go): two-step flow, RFC 8693 token-exchange at the IdP (user's ID token → ID-JAG, with strict validation:issued_token_typemust beid-jag, single-valueaudmatch,resourcecontainment, stricter than the draft), then RFC 7523 JWT-bearer redemption at the target AS. Uncached: two back-channel calls per proxied MCP request. The vMCP is a confidential OAuth client; multi-actor chaining is explicitly out of XAA's scope.The more interesting discovery: ToolHive's embedded authorization server (
pkg/authserver/server/tokenexchange/handler.go) already implements user→agent delegation minting: an authenticated client presents a user's JWT assubject_token; consent checks viamay_act.sub; it mintssub=user+act={sub: agent}with nested re-exchange (act.act…, depth cap 10), audience narrowing, and scope intersection (client_scopes ∩ subject_scopes). Structurally, that is exactly the user→agent→subagent chain this doc proposes.Supporting facts:
Identity.DelegationChainexists (pkg/auth/identity.go): the incoming JWT'sactclaim is parsed (toolhive-core/audit/delegation.go, flattened outermost-first), but it is audit-only today: never consulted for authz, never forwarded downstream by any strategy.act.sub(pkg/authz/authorizers/cedar/core_test.go: "Delegated access permitted when act claim matches SPIFFE ID pattern",claim_act.sub like "spiffe://toolhive.dev/ns/agents/sa/*"). The authz layer is SPIFFE-ready.MultiIssuerTokenValidatorexists but is unwired (TODO #5989); the delegation handler only trusts ToolHive's own JWKS today.client_id, not a first-class identity principal; no X.509; and THV-0073 (session binding) explicitly defers per-agent differentiation to a planned-but-nonexistentTHV-XXXX-user-to-agent-delegationRFC.How this doc's model could land in the MCP gateway path
Three layers, all composable from shipping ToolHive code:
subject_tokenonce #5989 is wired; the handler's nested-actconstruction, audience narrowing, and depth cap (10) already accommodate the chain shape.spiffe_delegationoutgoing strategy inpkg/vmcp/auth/factory/outgoing.go(or an XAA variant) reads the delegation chain fromIdentity.DelegationChainand presents the (attenuated) identity to backend MCP servers. Reuses the existingauthRoundTripperseam, zero core dispatch changes.scope/depthclaims become Cedar policy inputs; theclaim_act.subSPIFFE evaluation already works in test. ToolHive brings the chain plumbing + policy engine; mecatl brings the attenuation semantics nobody has.The full use case this enables: user → mecatl agent → subagent → ToolHive vMCP → backend MCP server, with the delegation chain riding the token end-to-end and each hop verifiable.
Discussion points
actvsdlg. ToolHive standardized on RFC 8693 nestedact(inbound parsing + audit), while this doc mints a privatedlgclaim because of thesubcollision (JWT-SVID §3 wantssub= holder; 8693 delegation wantssub= delegator). These don't directly conflict (ToolHive parsesactinbound; mecatl mintsdlgoutbound), but if ToolHive's gateway becomes a consumer of mecatl-minted tokens, that's squarely flip-condition (d) in the doc's revisit triggers ("external verifier ecosystem demands act-named claims"). Worth aligning on.THV-XXXX-user-to-agent-delegationplaceholder looks like the natural home for this collaboration. Is that still the plan, and does this doc's model match what you had in mind for it?