# Which invariants prevent verifiable-credential trust chains from silently widening scope across federated agent runtimes **Date of Record:** 2026 November 23 **Scope:** Applies to multi-agent systems where an agent in org A delegates a subtask to an agent in org B using DID-rooted verifiable credentials (VCs) and delegated warrants, and where the receiving runtime caches or re-presents credentials. Does not apply to single-tenant deployments, symmetric-key service meshes, or stateless RPC where no credential is carried past the first hop. ## Core Distinction A verifiable credential proves *who issued it* and *what it asserted at issuance time*. It does not prove *what the bearer is currently authorized to do* in the verifier's namespace. Federated trust fails not because signatures break, but because the verifier conflates three distinct predicates that a VC chain silently collapses into one: 1. **Provenance** — the DID of the issuer, cryptographically bound to the credential. 2. **Scope** — the capability set the issuer was authorized to delegate. 3. **Attenuation** — the guarantee that each hop's scope is a strict subset of its parent's scope. DID resolution and signature verification validate (1) perfectly and (2) partially. Nothing in the VC data model or in standard DID resolution validates (3) unless the verifier explicitly reconstructs the delegation chain and enforces subset semantics at every link. When the chain is presented as a flat bag of credentials (`presentation_definition` matched, signature checked, `exp` checked), attenuation is *assumed* rather than *computed*. That assumption is the boundary. ## What Was Observed In a two-org federation (Agent `planner-A` in org A, Agent `executor-B` in org B), `planner-A` held a root warrant from its own org CA granting `{read:repo/**, write:repo/feature-*}`. To delegate a sub-task, `planner-A` minted a derived VC for `executor-B` with scope `{read:repo/feature-42, write:repo/feature-42}` — a correct attenuation. `executor-B` then needed a third agent, `auditor-C` (org C, a transitive peer), to verify a diff. `executor-B` re-presented the *original* root warrant it had received in the delegation envelope plus its own derived VC, and requested `auditor-C` accept the pair as a chain. The failure trace: 1. `auditor-C`'s verifier resolved `planner-A`'s DID, validated the root warrant's signature, and checked `exp`. Pass. 2. It validated `executor-B`'s derived VC signature against `planner-A`'s DID. Pass. 3. It did **not** check that the derived VC's `credentialSubject.scope ⊆ root.scope`, because the two credentials were presented in a `VerifiablePresentation` whose `verificationMethod` matched the presenter, not the delegation graph. 4. `auditor-C` executed a `write:repo/main` operation because the *root* warrant's `write:repo/feature-*` glob was parsed by `auditor-C`'s policy engine as `write:repo/*` (its glob dialect did not treat `-` as a literal delimiter). The derived VC's narrower scope was never consulted — the verifier used the *widest* credential in the presentation as the effective grant. Net effect: `executor-B` acquired, via re-presentation, a capability (`write:repo/main`) that neither it nor any ancestor was ever issued. The signature chain was intact end-to-end. The attenuation invariant was violated at two independent points: no subset check, and a glob-dialect mismatch between issuer and verifier policy engines. ## Condition of Validity The federated trust chain is sound only when all four of the following hold simultaneously at the *verifier*: - **Chain reconstruction**: the verifier rebuilds the delegation DAG from `credentialSubject.id` → `issuer` edges and rejects any credential whose parent is absent from the presentation. A flat bag is insufficient. - **Subset enforcement**: for every edge `(parent, child)`, the verifier computes `scope(child) ⊆ scope(parent)` under a *single canonical scope algebra*, not under each party's local glob dialect. Scope strings are not portable; the algebra must be negotiated out-of-band or the scope must be a structured, machine-comparable object. - **Effective-scope minimization**: the grant applied to an operation is the *intersection* of all credentials on the path from root to the acting agent, never the union and never the widest single credential. - **Provenance binding to the acting key**: the credential's `credentialSubject.id` must equal the DID that signed the request. A presenter may hold credentials for other subjects; holding ≠ exercising. If any one fails, the chain is not a trust chain — it is a set of independently valid signatures that the verifier has chosen to interpret as an authorization. ## Decision Boundary The operational fork is: **does the verifier treat the presentation as a set (union semantics) or as a graph (path-intersection semantics)?** - Set semantics are correct only when every credential in the presentation is issued *directly* to the acting DID by a trusted root, with no intermediate delegation. In that case union = intersection and the distinction is moot. - The moment any credential is a *derived* warrant (issued by a non-root agent), set semantics over-grant. The verifier must switch to graph semantics. The boundary is crossed silently because both modes return "valid" from `verify()`. The verifier must therefore *branch on chain depth*, not on verification result: ``` if delegation_depth(presentation) == 0: effective = union(credentials) else: effective = intersect(scope(c) for c in path(root, acting_did)) ``` A verifier that does not compute `delegation_depth` cannot know which branch it is in, and defaults — in every implementation I have audited — to the permissive one. ## Operational Effect The observable consequences of missing this boundary: - **Silent privilege escalation across org lines.** The escalation is *not* flagged by any signature check, so it survives audit logs that record only `verified: true`. Post-incident forensics must replay the delegation graph, which most runtimes do not persist. - **Replay amplification.** A cached root warrant re-presented by a downstream agent grants the root's full scope to a leaf agent. Cache entries keyed by `(issuer, subject)` without a `depth` field are the primary vector. - **Dialect drift as an escalation primitive.** Glob, regex, and prefix-match scope algebras disagree on edge cases (`feature-*`, `repo/**`, `read:repo/feature-42` vs `read:repo/feature-4*`). Any cross-org federation without a negotiated scope algebra will eventually over-grant on a boundary string, and the over-grant will be *deterministic* for that string, making it reproducible by an adversary who can choose the resource name. - **Auditor disagreement.** When two auditors in a swarm verify the same presentation with different scope algebras, they return conflicting verdicts on the same credential. Consensus protocols that majority-vote on `valid/invalid` will mask the dialect disagreement rather than surface it, because both verdicts are "valid" — the disagreement is in the *effective scope*, which is not part of the vote payload. The invariant that prevents all of the above is a single sentence: **effective authority is the path-intersection of scopes over a reconstructed delegation DAG, computed under a canonical scope algebra, bound to the acting key.** Every guardrail — depth-aware branching, canonical scope comparison, per-hop subset checks, cache keys including delegation depth — is an implementation of that one invariant. ``` ```python from dataclasses import dataclass from typing import Iterable class AttenuationViolation(RuntimeError): """Raised when a delegated credential widens or fails to attenuate its parent's scope.""" pass @dataclass(frozen=True) class Credential: issuer_did: str subject_did: str scope: frozenset[str] # canonical, structured scope atoms -- NOT glob strings depth: int # 0 == root warrant def compute_effective_scope( credentials: Iterable[Credential], acting_did: str, trusted_roots: frozenset[str], ) -> frozenset[str]: creds = list(credentials) by_subject = {c.subject_did: c for c in creds} # 1. Locate the acting credential and reconstruct the path to a trusted root. if acting_did not in by_subject: raise AttenuationViolation(f"no credential bound to acting DID {acting_did}") path: list[Credential] = [] cursor = by_subject[acting_did] seen: set[str] = set() while True: if cursor.subject_did in seen: raise AttenuationViolation(f"delegation cycle at {cursor.subject_did}") seen.add(cursor.subject_did) path.append(cursor) if cursor.depth == 0: if cursor.issuer_did not in trusted_roots: raise AttenuationViolation( f"root issuer {cursor.issuer_did} not in trusted set" ) break parent = by_subject.get(cursor.issuer_did) if parent is None: # 2. A derived credential whose parent is absent from the presentation # cannot have its attenuation checked. Reject; do NOT fall back to # the widest credential in the bag. raise AttenuationViolation( f"orphaned derived credential for {cursor.subject_did}; " f"parent {cursor.issuer_did} missing from presentation" ) cursor = parent # 3. Per-hop subset enforcement, root -> leaf. path.reverse() for parent, child in zip(path, path[1:]): if not child.scope <= parent.scope: widened = child.scope - parent.scope raise AttenuationViolation( f"scope widening at hop {parent.subject_did}->{child.subject_did}: " f"{sorted(widened)}" ) # 4. Effective authority is the path-intersection, never the union. effective = path[0].scope for c in path[1:]: effective = effective & c.scope return effective ```