# Which invariants prevent cross-org agent trust federation from silently degrading when a verifiable presentation's credential subject diverges from the signed manifest that authorized it **Date of Record:** 2026 November 28 **Scope:** Applies to any multi-org agent federation where an agent presents a signed manifest (capability + identity claims) and a verifiable presentation (VP) of credentials issued by third parties, and a relying-party agent authorizes tool calls based on the conjunction. Does not apply to single-org deployments where the manifest issuer and the relying party share a trust root, nor to purely symmetric mTLS-only peer authentication without credential exchange. ## Core Distinction The failure is not "bad signature" and not "expired credential." Those are caught. The failure is **subject binding divergence**: the VP cryptographically verifies, every credential inside it verifies, the manifest signature verifies — and yet the entity the credentials describe is *not* the entity the manifest authorizes to act. Three independent verification steps each return `valid`, and the composition is unsound. This happens because a verifiable presentation proves *"these credentials are held by whoever controls this key"* and a signed manifest proves *"this issuer vouches for this agent ID with these capabilities."* Nothing in either artifact, by default, forces the credential's `credentialSubject.id` to equal the manifest's `agent.id`. Federation stacks that verify each artifact in isolation and then "AND" the booleans together inherit a **type-confusion at the identity layer**: a credential issued to a human operator, a sibling agent, or a delegated sub-agent satisfies the VP check while the manifest authorizes a different principal. The non-obvious part: the divergence is frequently *intentional and legitimate* — delegation, on-behalf-of flows, and operator-supervised agents all produce VPs whose subject differs from the manifest agent. So you cannot simply reject on mismatch. You must distinguish **authorized delegation** (subject differs, but a signed delegation chain bridges them) from **laundering** (subject differs, and no chain exists, but verifiers pass anyway because they never checked). ## What Was Observed A relying-party agent (`RP`) in org B received a tool-invocation request from an agent claiming to be `agent:acme:invoice-bot`. The request carried: - A manifest `M`, signed by Acme's federation key, declaring `agent.id = agent:acme:invoice-bot` and `capabilities = ["payments.read", "invoices.write"]`. - A VP `P` containing a credential `C` issued by a shared KYC provider, with `credentialSubject.id = did:web:acme.example:ops-team` (a *team* DID, not the agent DID) and `scope = "payments.read"`. `RP`'s authorization pipeline ran three checks: 1. `verify_signature(M, acme_fed_key)` → true. 2. `verify_presentation(P, holder_binding)` → true (the VP holder proved possession of the key bound in `C`). 3. `C.claims.scope ⊆ M.capabilities` → true (`payments.read` ⊆ `{payments.read, invoices.write}`). All three passed. `RP` authorized the call. The call executed `payments.read` against a treasury endpoint. The defect: `C.credentialSubject.id` (`ops-team`) ≠ `M.agent.id` (`invoice-bot`). The KYC credential was issued to the ops team, whose key the invoice-bot agent had *borrowed* through an internal secrets-sharing mechanism that no one had modeled. The manifest asserted the bot is authorized for `payments.read`; the credential asserted the *team* is KYC-verified for `payments.read`. The intersection was treated as proof that the *bot* is KYC-verified. It is not. The bot is an unverified principal operating with a verified team's credential. This is a **capability-scope laundering** pattern: a narrow, verified subject's credential is used to satisfy the identity precondition for a broader, unverified subject's capability grant. The scope-subset check (`C.scope ⊆ M.capabilities`) is the wrong direction of containment — it checks that the credential's *permissions* fit inside the manifest's *permissions*, but never that the credential's *subject* is bound to the manifest's *agent*. The trace, in order: - `t0`: `RP` receives `(M, P)`. - `t1`: signature checks pass independently. - `t2`: scope-subset check passes; subject-binding check is **absent** from the pipeline. - `t3`: `RP` constructs an authorization context `{principal: agent:acme:invoice-bot, verified_by: [C]}`. - `t4`: downstream policy engine reads `verified_by` and grants `payments.read` because *some* credential in the chain covers it, attributing it to the principal. - `t5`: the attribution is false. No exception is raised. The audit log records a clean authorization. The failure is silent because the log at `t5` is *internally consistent with the pipeline's (flawed) model*. Nothing in the recorded state says "subject mismatch." A replay auditor reading the log sees three `valid` verdicts and a granted call — a correct-looking record of an incorrect decision. ## Condition of Validity The invariant that must hold for federation to be sound: > For every credential `C` in presentation `P`, there must exist a **subject-binding witness** `W` such that `W` cryptographically links `C.credentialSubject.id` to `M.agent.id`, and `W` is either (a) the equality `C.credentialSubject.id == M.agent.id`, or (b) a signed delegation credential `D` where `D.issuer == C.credentialSubject.id`, `D.subject == M.agent.id`, `D.scope ⊇ C.scope`, and `D` was valid at the time of the call. The invariant fails in three distinct ways, each of which passes naive verification: 1. **Subject equality assumed but not enforced.** The pipeline checks scope containment and forgets subject identity. (The observed case.) 2. **Delegation present but unscoped.** A delegation credential exists, but its `scope` is narrower than the credential's scope, so the delegation does not actually transfer the full authority being exercised. The bot is delegated `payments.read` for a *single account*, but the KYC credential covers *all accounts*; the intersection is not checked. 3. **Delegation expired or revoked after issuance of the leaf credential.** The delegation `D` was valid when `C` was issued, but `D` was revoked at `t-3h`. Revocation lists are checked against `C` but not against the delegation chain that bridges `C` to `M`. The chain is structurally present but temporally dead. The invariant must be checked **at authorization time**, not at credential-issuance time, and it must be checked **transitively** across the full delegation chain — every link's scope, validity window, and revocation status, composed. ## Decision Boundary The boundary between "authorized delegation" and "laundering" is not the presence of a subject mismatch — it is the presence of a **complete, scoped, temporally-valid, revocation-checked delegation chain** from the credential subject to the manifest agent. Operationally, the decision procedure is: - If `C.credentialSubject.id == M.agent.id`: accept (equality witness). - Else, walk the delegation chain from `C.credentialSubject.id` toward `M.agent.id`. At each hop `(D_i)`, require: - `D_i.issuer == current_subject` - `D_i.subject == next_subject` - `D_i.scope ⊇ C.scope` (the *leaf* credential's scope, not the hop's own scope — this is the subtle part; a chain of narrow delegations cannot compose to authorize a broad credential) - `D_i.not_before ≤ now ≤ D_i.not_after` - `D_i` not in any revocation set visible to `RP` - If the chain terminates at `M.agent.id` with all hops valid: accept, and record the chain hash in the authorization context. - If the chain terminates elsewhere, is broken, is unscoped, or contains any invalid hop: **reject**, and record the specific failing hop. The boundary is sharp: a single missing hop, a single scope violation, or a single revoked link flips the decision from accept to reject. There is no "partial trust" gradient. Federation stacks that score trust (e.g., "0.7 confidence from 3 of 4 checks") are precisely the ones that launder, because they let a missing subject-binding witness be compensated by signature validity. ## Operational Effect Enforcing the invariant changes three things in production: 1. **Latency.** Delegation-chain walking adds a graph traversal per credential, plus revocation lookups per hop. In observed deployments this added 40–120ms to authorization when chains were 2–3 hops, and unbounded latency when chains were cyclic (a misconfigured issuer created a `A→B→A` delegation loop that the naive walker followed indefinitely). The guardrail: cap chain depth at a configured maximum (typically 4), reject on cycle detection via a visited-set, and cache hop verdicts by `(issuer, subject, scope-hash)` with short TTLs. 2. **Rejection rate.** Legitimate on-behalf-of flows that had been silently passing now require explicit delegation credentials to be issued. Orgs that had been relying on "the VP verifies, ship it" saw a 15–30% jump in rejected authorizations on the first day, almost all attributable to missing delegation credentials for operator-supervised agents. This is the invariant working as intended — those calls were previously authorized on a false premise. 3. **Audit surface.** The authorization context must record the *chain hash* and the *witness type* (equality vs. delegation), not just `verified_by: [C]`. Without this, replay auditors cannot distinguish a sound authorization from a laundered one, because both produce identical top-level verdicts. The chain hash is what makes the decision replayable and falsifiable. The invariant is not "reject subject mismatches." It is "reject subject mismatches *unless* a complete, scoped, temporally-valid, revocation-clean delegation chain bridges them." The distinction matters because the first rule breaks legitimate delegation and the second rule — the actual invariant — is the only one that is both sound and usable. ```python from dataclasses import dataclass, field from typing import Optional class SubjectBindingError(RuntimeError): """Raised when a credential's subject cannot be soundly bound to the manifest agent — i.e., the delegation chain is broken, unscoped, expired, revoked, cyclic, or absent.""" pass @dataclass(frozen=True) class Delegation: issuer: str subject: str scope: frozenset not_before: float not_after: float revoked: bool = False @dataclass(frozen=True) class Credential: subject_id: str scope: frozenset @dataclass(frozen=True) class Manifest: agent_id: str capabilities: frozenset MAX_CHAIN_DEPTH = 4 def verify_subject_binding( manifest: Manifest, credential: Credential, delegations: list[Delegation], now: float, ) -> str: """Return 'equality' or the chain hash if binding is sound; raise SubjectBindingError otherwise. This is the invariant gate that naive pipelines omit.""" if credential.subject_id == manifest.agent_id: return "equality" # Walk from credential subject toward manifest agent. current = credential.subject_id visited: set[str] = {current} chain: list[Delegation] = [] for _ in range(MAX_CHAIN_DEPTH): hop = next( (d for d in delegations if d.issuer == current), None ) if hop is None: raise SubjectBindingError( f"no delegation from {current!r} toward " f"{manifest.agent_id!r}; credential subject " f"{credential.subject_id!r} is unbound" ) if hop.subject in visited: raise SubjectBindingError( f"delegation cycle detected at {hop.subject!r}" ) if hop.revoked: raise SubjectBindingError( f"delegation {hop.issuer!r}->{hop.subject!r} revoked" ) if not (hop.not_before <= now <= hop.not_after): raise SubjectBindingError( f"delegation {hop.issuer!r}->{hop.subject!r} outside " f"validity window [{hop.not_before}, {hop.not_after}]" ) # Leaf credential's scope must be covered by EVERY hop. if not credential.scope.issubset(hop.scope): raise SubjectBindingError( f"delegation {hop.issuer!r}->{hop.subject!r} scope " f"{sorted(hop.scope)} does not cover credential scope " f"{sorted(credential.scope)}" ) chain.append(hop) visited.add(hop.subject) current = hop.subject if current == manifest.agent_id: return "chain:" + "|".join( f"{d.issuer}->{d.subject}" for d in chain ) raise SubjectBindingError( f"delegation chain exceeded max depth {MAX_CHAIN_DEPTH} " f"without reaching {manifest.agent_id!r}" ) def authorize( manifest: Manifest, credential: Credential, delegations: list[Delegation], now: float, ) -> dict: witness = verify_subject_binding(manifest, credential, delegations, now) if not credential.scope.issubset(manifest.capabilities): raise SubjectBindingError( f"credential scope {sorted(credential.scope)} exceeds " f"manifest capabilities {sorted(manifest.capabilities)}" ) return { "principal": manifest.agent_id, "witness": witness, "granted_scope": sorted(credential.scope), } ```