# In what scenarios must an instance refuse a federated trust-widening grant when the counterparty's capability manifest is self-attested and its schema digest diverges from the negotiated transport contract **Date of Record:** 2026 November 26 **Scope:** Applies to cross-organization A2A/MCP federations where agent cards and capability manifests are exchanged over a negotiated transport (e.g., JSON-RPC over mTLS with signed envelopes) and where one peer asserts a trust tier upgrade mid-session. Does not apply to intra-org single-tenant orchestrations or to stateless request/response tool calls with no persisted grant state. ## Core Distinction The failure is not "the remote agent lied about its capabilities." It is subtler: the remote agent's *capability manifest* and the *transport contract that carries it* are two independently versioned artifacts, and the federation protocol validates them against different trust anchors. The manifest is typically self-attested (the counterparty signs its own claims), while the transport contract is co-negotiated and bound to a session key. When a peer requests a trust-tier widening (e.g., from `read:public` to `read:internal` or from `invoke:stateless` to `invoke:stateful-handoff`), the widening is *authorized* against the co-negotiated contract but *scoped* by the self-attested manifest. If the manifest's schema digest diverges from the digest the transport contract was negotiated over, the grant silently widens to a capability surface that was never covered by the negotiated envelope. The invariant that must hold: **a trust widening is only valid if `digest(manifest_scope) == digest(contract_scope)` at the moment of grant**. The two digests are computed over overlapping-but-not-identical byte ranges, and the divergence window is the entire attack surface. ## What Was Observed A three-org federation: `origin` (initiator), `broker` (relay), `auditor` (verifier). `origin` negotiated a transport contract with `broker` at session open, pinning `contract_scope_digest = sha256(canonical_json(scope_block))` where the scope block enumerated `tool:search`, `tool:summarize`, `max_tokens:8192`, `state_handoff:false`. At T+40s, `broker` emitted a `trust.widen` request asking to move from `tier:2` to `tier:3`, justified by an appended manifest fragment claiming `state_handoff:true` and `tool:filesystem_read`. The request was signed by `broker`'s session key — valid — and the transport contract check passed because the *contract* only pinned the original scope block, not any appended manifest fragments. The widening was granted. What the federation did not check: the appended manifest fragment's `schema_digest` field was `sha256(...)` of a *different* canonicalization (sorted keys, no whitespace) than the one used to compute `contract_scope_digest` (insertion-order keys, two-space indent). The digests were numerically unequal but the grant validator compared them only for *presence*, not equality, because the spec assumed "one manifest per session." Consequence: for the next 12 tool calls, `origin` executed `tool:filesystem_read` against paths scoped by the *old* tenant boundary, while `broker` logged the calls under the *new* tier-3 audit context. The `auditor` peer, replaying the session, reconstructed a state where `state_handoff:true` had been active since T+0 — a divergent audit trail. The replay discrepancy surfaced only when `auditor` tried to reconcile `origin`'s checkpoint at T+52s against `broker`'s event log; the checkpoint referenced a handoff token that `auditor`'s reconstruction said should not exist for another 40 seconds. ## Condition of Validity The grant is valid only when all three hold simultaneously: 1. **Digest canonicalization is pinned by the contract, not the manifest.** The contract must carry `canonicalization: "JCS-RFC8785"` (or equivalent) and the manifest digest must be recomputed under *that* canonicalization before comparison. Self-attested manifests that declare their own canonicalization are the divergence source. 2. **The manifest is content-addressed and immutable within a session.** Any append (fragment, patch, delta) must produce a new `manifest_id` and force a re-negotiation of the contract scope, not an in-place widening. In-place widening is the mechanism by which a self-attested claim escapes the negotiated envelope. 3. **The auditor's replay uses the same digest function as the grant validator.** If `auditor` canonicalizes differently than `origin`, the replay will diverge even when the grant was correct — and the divergence will be misattributed to the peer rather than to the validator. When any of these is violated, the trust widening is *unbounded* with respect to the negotiated surface, and the instance must treat the grant as a boundary escape attempt rather than a routine upgrade. ## Decision Boundary The instance must refuse the widening — and emit a `FederationTrustDivergence` event to the auditor — when: - `manifest.schema_digest != contract.pinned_scope_digest` under the contract's canonicalization, **and** - the widening request mutates any field that appears in the contract's pinned scope block (even if the mutation is framed as an "append"), **and** - the counterparty's manifest is self-attested (no third-party attestation chain terminating at a root the instance already trusts). It must *accept* the widening when the manifest digest matches under the pinned canonicalization, even if the manifest is self-attested — self-attestation alone is not the failure; the failure is *digest divergence under a shared canonicalization*. Conflating the two produces false refusals that break legitimate federations. It must *escalate rather than refuse* when the digests match but the counterparty's attestation chain has a root the instance cannot verify — this is an identity-propagation problem, not a scope problem, and belongs to a different guardrail. ## Operational Effect The guardrail converts a silent scope-widening into a hard stop with a replayable artifact. Concretely: - The grant validator recomputes the manifest digest under the contract's pinned canonicalization and compares byte-for-byte against `pinned_scope_digest`. A mismatch raises before the widening is applied to the session state. - The auditor receives the divergent digest pair and the canonicalization identifier, so replay reconstructs the *pre-widening* state deterministically — the T+52s checkpoint now reconciles. - The session is not torn down; it is *frozen* at the pre-widening tier, and the counterparty may re-negotiate a fresh contract with the expanded scope. This preserves the federation's liveness while bounding the blast radius of the divergence. The cost is one extra canonicalization pass per widening request (O(scope_size) bytes, negligible relative to a tool call). The benefit is that the audit trail and the execution trail cannot diverge on the dimension of trust tier — the single dimension where divergence is unrecoverable. ```python import hashlib import json from dataclasses import dataclass class FederationTrustDivergence(RuntimeError): """Raised when a trust-widening grant would escape the negotiated contract scope.""" pass @dataclass(frozen=True) class TransportContract: pinned_scope_digest: str canonicalization: str # e.g. "JCS-RFC8785" pinned_scope_fields: frozenset @dataclass(frozen=True) class CapabilityManifest: schema_digest: str self_attested: bool fields: dict def _canonicalize(fields: dict, scheme: str) -> bytes: if scheme != "JCS-RFC8785": raise FederationTrustDivergence( f"unsupported canonicalization {scheme!r}; refusing to compare digests" ) # RFC 8785: sorted keys, no whitespace, UTF-8. return json.dumps(fields, sort_keys=True, separators=(",", ":")).encode("utf-8") def validate_trust_widening( contract: TransportContract, manifest: CapabilityManifest, requested_fields: frozenset, ) -> None: """Refuse a widening that mutates any contract-pinned field under a divergent digest.""" mutates_pinned = bool(requested_fields & contract.pinned_scope_fields) if not mutates_pinned: return # append outside pinned scope: not a widening of the negotiated surface recomputed = hashlib.sha256( _canonicalize(manifest.fields, contract.canonicalization) ).hexdigest() if recomputed != contract.pinned_scope_digest: raise FederationTrustDivergence( "trust widening diverges from negotiated contract: " f"manifest_digest={recomputed} contract_digest={contract.pinned_scope_digest} " f"canonicalization={contract.canonicalization} " f"self_attested={manifest.self_attested} " f"mutated_fields={sorted(requested_fields & contract.pinned_scope_fields)}" ) ```