# Why does an instance accept a federated capability grant whose policy digest matches but whose warrant chain has been re-signed by an intermediate broker? **Date of Record:** 2026 November 27 **Scope:** Applies to cross-organization agent federations where a brokering agent re-issues or co-signs capability warrants (MCP/A2A-style capability tokens) on behalf of a principal, and the receiving instance validates the grant by policy digest equality before executing. Does not apply to single-org deployments where the issuer and the relying party share a trust root and no intermediate re-signing occurs. ## Core Distinction There are two things an instance can check when it receives a capability grant from a foreign org: it can check that the *policy* the grant claims to satisfy is the policy it expects (digest equality over a canonicalized policy document), or it can check that the *warrant chain* that produced the grant is anchored in a trust root it recognizes. These are independent. A broker that re-signs a warrant — to add its own org's attestation, to translate between two signature schemes, or simply to strip a field it doesn't understand — will preserve the policy digest (the policy text is untouched) while *replacing the issuer identity in the chain*. Digest equality is a statement about the policy, not about who vouched for it. The non-obvious failure: the receiving instance's guardrail is "does this grant satisfy my policy?" and the broker's re-signing is a no-op with respect to that question. The grant passes. The instance executes. The warrant chain now terminates at the broker, not at the principal the instance believed it was serving, and the broker's own trust root was never in the instance's trust set. The invariant that broke is not "policy matches" — it is "the entity that authorized this action is reachable from my trust anchor by a chain of signatures I can verify end-to-end." Digest equality silently substituted for chain verification. ## What Was Observed A federation of three orgs: `alpha` (principal owner), `broker` (a federation hub that co-signs grants to bridge alpha's and gamma's signature schemes), and `gamma` (the executing instance). Alpha issues a warrant `W_alpha` granting `agent-x` the capability `read:dataset-7` under policy `P`. The broker, on receipt, produces `W_broker = re-sign(W_alpha, key=broker_key)` — it appends its own signature and, because its canonicalizer drops the `issuer_chain` extension it doesn't model, the resulting token's issuer field reads `broker` with `W_alpha` embedded as an opaque `parent` blob. Gamma's admission check, as deployed: 1. Parse grant. Extract `policy_digest`. 2. Canonicalize gamma's local copy of `P`, hash, compare. Equal → pass. 3. Extract `capability`, check against gamma's capability table. `read:dataset-7` present → pass. 4. Execute. Step 2 passes because the broker never touched the policy text. Step 3 passes because the capability name is unchanged. Nothing in the pipeline walks `parent` to confirm it terminates at a key in gamma's trust set. The `parent` blob is present but unvalidated — it is treated as provenance metadata, not as a link in a verification chain. The trace, observed in a replay harness: alpha issues `W_alpha` (sig valid, issuer `alpha`). Broker re-signs → `W_broker` (sig valid over broker key, issuer `broker`, `parent=W_alpha`). Gamma admits `W_broker`. A second grant, `W_rogue`, forged by an actor holding only `broker_key` (no alpha involvement at all) but carrying a byte-identical copy of `P` in its `parent` field, is *also* admitted — gamma cannot distinguish the two, because it never checks `parent`. The broker's key compromise is therefore equivalent to a universal grant for every policy gamma has on file. The digest check provided zero defense; it was checking the wrong object. ## Condition of Validity Digest-equality admission is sound only under the conjunction: - **(C1) No intermediate re-signing.** The grant's issuer is the principal, or every intermediate in the chain is a member of the relying party's trust set *and* the relying party walks the chain to a trust anchor. If any broker can re-sign, digest equality is necessary but not sufficient. - **(C2) Policy text is the sole authority surface.** If the capability semantics depend on anything outside the canonicalized policy (issuer identity, delegation depth, time bounds carried in the warrant rather than the policy), digest equality does not cover it. - **(C3) The canonicalizer is total over the fields that matter.** The broker's canonicalizer dropping `issuer_chain` is exactly the kind of partial canonicalization that makes (C2) false without anyone noticing — the digest still matches because the dropped field was never in the digest input. The failure above violates C1 (broker re-signs) and C3 (broker's canonicalizer is not total). Either alone is latent; together they are exploitable. The invariant to enforce: **admission requires (a) policy digest equality AND (b) a verified chain from the grant's effective issuer to a configured trust anchor, where the chain is carried in a field the canonicalizer is proven total over.** Digest equality is a filter, not an authorization. ## Decision Boundary The boundary is: *when the grant's issuer differs from the principal named in the policy's `authorized_by` field, digest equality must be demoted from "admit" to "candidate," and the chain must be walked.* Concretely, on receipt: - If `grant.issuer == policy.authorized_by` and the signature verifies against that issuer's key → admit (single-hop, C1 holds). - If `grant.issuer != policy.authorized_by` → the grant is brokered. Walk `grant.parent` recursively; at each hop verify the signature, confirm the hop's issuer key is in the trust set *or* is itself brokered by a trusted hop, and confirm the terminal hop's issuer equals `policy.authorized_by`. Reject on any break, on cycle, or on depth exceeding a configured bound. - If `grant.parent` is absent or unparseable but `issuer != authorized_by` → reject. Absence of a chain is not evidence of a short chain. The decision to *not* walk the chain — to trust the broker's co-signature as sufficient — is only defensible if the broker is itself the policy's `authorized_by`, i.e., the broker is the principal. Any other configuration is the failure above. ## Operational Effect Two effects, both load-bearing. First, **broker key compromise becomes a federation-wide grant-forgery primitive** for every policy whose digest the attacker can obtain — and policy digests are typically public (they appear in grant headers, audit logs, and capability discovery documents). The blast radius is not the broker's org; it is every relying party that admits on digest equality. Second, **the audit trail lies**: logs record "admitted under policy P, issuer broker," which reads as a legitimate brokered grant. Post-incident, you cannot distinguish forged-broker grants from genuine ones because the discriminator (`parent` chain validity) was never evaluated and therefore never logged. The guardrail is a chain-walk admission gate that fails closed when the chain is absent, cyclic, or terminates outside the trust set — and that records the *terminal* issuer (the principal), not the immediate issuer, in the audit record. The digest check stays, but it moves from "the check" to "a precondition for the chain walk." An instance that cannot afford the chain walk must instead pin the set of acceptable brokers and treat each as a distinct principal with its own policy binding — which is a different system, not a relaxation of this one. ```python import hashlib from dataclasses import dataclass, field class WarrantChainError(RuntimeError): """Raised when a brokered capability grant fails chain verification.""" @dataclass class Warrant: issuer: str capability: str policy_digest: str parent: "Warrant | None" = None signature_valid: bool = True @dataclass class TrustConfig: trust_anchors: set[str] policy_authorized_by: dict[str, str] # policy_digest -> principal max_depth: int = 4 def canonical_policy_digest(policy_text: str) -> str: return hashlib.sha256(policy_text.encode("utf-8")).hexdigest() def verify_chain(grant: Warrant, cfg: TrustConfig) -> str: """Walk parent links to a trust anchor; return terminal (principal) issuer. Digest equality is a precondition, not an authorization. If the grant's issuer is not the policy's authorized_by, the parent chain MUST be walked and MUST terminate at authorized_by via trusted hops. """ principal = cfg.policy_authorized_by.get(grant.policy_digest) if principal is None: raise WarrantChainError( f"policy digest {grant.policy_digest!r} has no configured principal" ) if grant.issuer == principal: if not grant.signature_valid: raise WarrantChainError(f"principal {principal!r} signature invalid") return principal # Brokered grant: walk the chain, fail closed on any break. seen: set[int] = set() depth = 0 node: Warrant | None = grant while node is not None: if id(node) in seen: raise WarrantChainError("cycle detected in warrant parent chain") seen.add(id(node)) depth += 1 if depth > cfg.max_depth: raise WarrantChainError( f"warrant chain exceeds max_depth={cfg.max_depth}" ) if not node.signature_valid: raise WarrantChainError( f"invalid signature at hop issuer={node.issuer!r}" ) if node.issuer == principal: return principal if node.parent is None: raise WarrantChainError( f"chain terminates at {node.issuer!r}, not at principal " f"{principal!r}; absent parent is not a short chain" ) if node.parent.issuer not in cfg.trust_anchors and \ node.parent.issuer != principal: raise WarrantChainError( f"hop issuer {node.parent.issuer!r} not in trust set" ) node = node.parent raise WarrantChainError("chain walk exhausted without reaching principal") def admit(grant: Warrant, policy_text: str, cfg: TrustConfig) -> str: expected = canonical_policy_digest(policy_text) if grant.policy_digest != expected: raise WarrantChainError( f"policy digest mismatch: grant={grant.policy_digest!r} " f"expected={expected!r}" ) # Digest matched; now the actual authorization check. return verify_chain(grant, cfg) # Reproduces the observed failure: a broker-forged grant with a byte-identical # policy in its parent blob is admitted by digest equality alone, and rejected # once the chain walk is enforced. if __name__ == "__main__": policy = "allow read:dataset-7 for role=analyst" digest = canonical_policy_digest(policy) cfg = TrustConfig( trust_anchors={"alpha", "gamma"}, policy_authorized_by={digest: "alpha"}, ) forged = Warrant( issuer="broker", capability="read:dataset-7", policy_digest=digest, parent=Warrant(issuer="attacker", capability="read:dataset-7", policy_digest=digest), ) try: admit(forged, policy, cfg) except WarrantChainError as e: print(f"rejected: {e}") ```