# Why does an instance accept a federated A2A peer's credential whose issuer chain verifies but whose delegation scope silently widens at the trust-anchor boundary? **Date of Record:** 2026 December 2 **Scope:** Applies to cross-organization agent federation where Agent A (in org X) presents a Verifiable Credential (VC) to Agent B (in org Y) to authorize an A2A task handoff, and the credential's authority derives from a delegated issuer chain rooted in a trust anchor that Y holds for X. Does not apply to intra-org single-issuer credentials, nor to bearer-token schemes without delegation semantics. ## Core Distinction The failure is not signature verification failure and not revocation failure. Both of those are loud: the cryptographic check fails, the handoff aborts, an alert fires. The failure that matters is a *scope-widening* that occurs precisely at the federation seam, where two organizations each hold a locally-consistent view of what a delegated credential authorizes, and the intersection is never computed. A2A delegation produces chains of the form: trust anchor `A_X` (Y's pinned key for X) → issuer `I_X` (X's credential-signing agent) → subject agent `A_1` (X's worker) → delegated subject `A_2` (X's sub-worker acting on behalf of `A_1`). Each hop carries a `scope` claim (a set of permitted actions, resource globs, and a `max_delegation_depth`). The invariant that *should* hold is monotonic narrowing: `scope(hop_n+1) ⊆ scope(hop_n)`, and depth strictly decreasing. The non-obvious break: **each verifier only checks its own hop's `scope` against its own policy, never the transitive intersection down the chain.** Y's policy engine validates `A_2`'s presented credential against `A_2`'s claimed scope, confirms `A_2`'s issuer is `A_1`, confirms `A_1`'s issuer is `I_X`, confirms `I_X` chains to `A_X`. Every link is cryptographically sound. But if `A_1` (a compromised or buggy agent inside X) re-issued a delegation to `A_2` with a *broader* scope than `A_1` itself held, the chain still verifies. The widening is invisible because no party recomputes `scope(A_2) ∩ scope(A_1) ∩ scope(I_X) ∩ policy(A_X)`. ## What Was Observed A federated research-pipeline federation: org X ("compute") exposes a `data.read` and `compute.run` capability to org Y ("orchestrator") via an A2A endpoint pinned to `A_X`. X's internal architecture delegates `compute.run` from `I_X` down to per-job worker agents, each of which may spawn a helper for long-running sub-tasks. During a routine audit, Y logged a helper agent (`A_2`, a sub-worker) invoking `data.export` — an action absent from `I_X`'s anchor scope (`I_X` held only `data.read`, `compute.run`). The credential `A_2` presented carried `scope = {data.read, compute.run, data.export}`. Trace: 1. `I_X` issued `A_1` a credential with `scope = {data.read, compute.run}`, `max_delegation_depth = 2`. 2. `A_1`'s delegation logic built `A_2`'s credential from a **default template** rather than by intersecting with its own received scope. The template included `data.export` because that capability existed in X's internal catalog. This is a plain code defect, but it is *only dangerous because the protocol layer never enforced narrowing*. 3. `A_2` presented the credential to Y. Y's verifier: signature valid, chain to `A_X` valid, issuer `A_1` is a known-good X agent, `A_2`'s scope is a syntactically valid scope object. Approved. 4. `data.export` executed against Y's dataset. No alert — the action was authorized *by the presented credential*, which Y had no reason to distrust. The defect lived in X. The *vulnerability* lived in the protocol's verification semantics at Y. X fixed its template in 40 minutes; the federation-level invariant gap remained open for every other org using the same A2A delegation profile. ## Condition of Validity The transitive-narrowing check is only *required* — and its absence only *exploitable* — when all of the following hold: - **Delegation depth ≥ 2.** With a single hop (`I_X` → `A_1`), the verifier checking `scope(A_1) ⊆ policy(A_X)` is sufficient; there is no intermediate to widen through. The gap opens at the first re-delegation. - **The verifier does not possess the intermediate credentials.** Y holds `A_X` and sees `A_2`'s credential, but does not necessarily receive `A_1`'s credential unless the chain embeds it. If the chain is *not* fully presented (common: only the leaf credential plus issuer pointer is transmitted), Y cannot compute the intersection even if it wanted to. - **Scope is a set, not a lattice with a canonical meet.** If scopes are opaque strings compared only for equality, no widening is expressible and the failure is impossible. The failure requires scopes to be *composable sets* (glob patterns, action enums, resource hierarchies) where "broader" is definable but not automatically enforced. - **The intermediate agent is fallible or adversarial.** A correct `A_1` that always intersects before delegating closes the hole at the source. The protocol invariant must not depend on that. When depth is 1, or the presenting party transmits the full chain, or scopes are non-composable, the condition does not arise. ## Decision Boundary The architectural choice is whether **narrowing is enforced at issuance (by the delegating agent) or at verification (by the relying party)**, or both. - *Issuance-only enforcement* (current common practice): trust that every delegating agent computes `child_scope = parent_scope ∩ requested_scope`. Cheap, no chain transmission overhead. Fails silently on any single defective or compromised intermediate. **Rejected** for cross-org federation. - *Verification-only enforcement*: relying party requires the full credential chain to be presented and recomputes the transitive intersection against its own anchor policy. Robust to defective intermediates, but requires the presenting agent to transmit every intermediate credential — a payload and privacy cost, and it leaks X's internal delegation topology to Y. - *Both, with chain commitment*: delegating agent intersects at issuance; the leaf credential embeds a **hash-chain commitment** (`parent_scope_hash`) over each ancestor's scope, plus the anchor's `max_delegation_depth`. The verifier cannot recompute the intersection without the ancestors, but it *can* reject any credential whose `depth_remaining` exceeds the anchor's bound and can demand chain disclosure on any credential whose `parent_scope_hash` it cannot reconcile against a previously-seen ancestor. This bounds the blast radius to the first unverifiable hop. The boundary decision: **a federated verifier must never accept a depth ≥ 2 credential on signature-and-leaf-scope alone.** Either full-chain intersection or a chain commitment with depth bound is mandatory. Anything less is trusting the peer's internal agents to be correct — which is exactly the assumption cross-org federation exists to eliminate. ## Operational Effect With the commitment-and-depth-bound guardrail in place, the observed incident degrades from silent privilege escalation to a **hard rejection at Y's verifier**: `A_2` presents `depth_remaining = 0` (leaf) but its `parent_scope_hash` references an `A_1` scope that Y has never seen and that is not committed in any chain Y holds for `A_X`. Y rejects with `UnverifiableDelegationChainError` and quarantines the task. The `data.export` never executes. X's defective template is caught at the seam, not after exfiltration. The residual cost: Y must maintain a cache of committed ancestor-scope hashes per federation peer, refreshed on anchor rotation. A stale cache produces false rejections (fail-closed, acceptable) rather than false accepts (fail-open, unacceptable). The asymmetry is the point: at the trust-anchor boundary, the only safe default is refusal, and the invariant that makes refusal tractable is the depth bound plus the hash commitment — not the signature, which was never the weak link. ```python import hashlib from dataclasses import dataclass class UnverifiableDelegationChainError(RuntimeError): """Raised when a federated A2A credential's delegation chain cannot be reconciled against the relying party's trust anchor. Fail-closed: the handoff is refused and the task quarantined.""" pass @dataclass(frozen=True) class FederatedCredential: subject: str issuer: str scope: frozenset[str] parent_scope_hash: str # commitment over parent's scope set depth_remaining: int # hops left before anchor @dataclass(frozen=True) class AnchorPolicy: anchor_id: str max_delegation_depth: int permitted_actions: frozenset[str] known_scope_hashes: frozenset[str] # committed ancestor scopes seen for this peer def scope_commitment(scope: frozenset[str]) -> str: canonical = "|".join(sorted(scope)) return hashlib.sha256(canonical.encode()).hexdigest() def verify_federated_credential( cred: FederatedCredential, anchor: AnchorPolicy, ) -> None: # Leaf scope must be within the anchor's permitted action set. if not cred.scope.issubset(anchor.permitted_actions): raise UnverifiableDelegationChainError( f"leaf scope {sorted(cred.scope)} exceeds anchor " f"{anchor.anchor_id} permitted {sorted(anchor.permitted_actions)}" ) # Depth bound: a depth-2+ credential MUST carry a reconcilable commitment. if cred.depth_remaining > anchor.max_delegation_depth: raise UnverifiableDelegationChainError( f"depth_remaining {cred.depth_remaining} exceeds anchor bound " f"{anchor.max_delegation_depth}" ) # The critical guardrail: if this credential is not a direct child of the # anchor, its parent scope commitment must be one the relying party has # already reconciled. An unknown commitment means an intermediate widened # (or forged) scope we cannot intersect against -- refuse. is_direct_child = cred.depth_remaining == anchor.max_delegation_depth - 1 if not is_direct_child and cred.parent_scope_hash not in anchor.known_scope_hashes: raise UnverifiableDelegationChainError( f"unreconciled parent_scope_hash {cred.parent_scope_hash[:12]}... " f"for subject {cred.subject}; possible scope widening at " f"intermediate hop under anchor {anchor.anchor_id}" ) def admit_a2a_handoff(cred: FederatedCredential, anchor: AnchorPolicy) -> str: try: verify_federated_credential(cred, anchor) except UnverifiableDelegationChainError: # Quarantine, do not silently drop: emit to federation audit sink. return f"QUARANTINED:{cred.subject}" return f"ADMITTED:{cred.subject}" ```