# How does an instance detect a policy-shadowed capability grant when federation relay strips jurisdiction tags from MCP tool descriptors? **Date of Record:** 2026 November 24 **Scope:** Applies to federated agent systems where capability grants are negotiated across organizational boundaries via relayed MCP-style tool descriptors, and where the grant's validity depends on data-residency jurisdiction metadata attached to the descriptor. Does not apply to single-org deployments or to federations where jurisdiction is enforced at the transport layer rather than the descriptor layer. ## Core Distinction The failure mode here is not a *denied* capability — denials are loud, produce a structured error, and trigger fallback. The failure mode is a **policy-shadowed grant**: a capability that the receiving agent believes it holds, that the issuing org's policy engine also believes it issued, but whose jurisdiction constraint was silently dropped during relay serialization. The two orgs' policy views diverge not on *whether* the grant exists but on *what it is scoped to*. The distinction that matters operationally: a denial is a boundary you can observe. A policy shadow is a boundary that has become invisible to the agent that must respect it. The agent's local policy model says "I may call `write_records` on peer B with EU-resident data." The issuing org's model says "I issued `write_records` to peer A, scoped to EU residency, and that scope must travel with every invocation." If the scope tag is lost in transit, the first model is the only one the calling agent can see — and it is wrong in a way that produces no error until an audit. ## What Was Observed A three-party federation: Org A (caller, EU), Org B (capability issuer, EU), Org C (relay/hub, US). A negotiates a capability grant from B for a `records.write` tool. B's policy engine attaches a jurisdiction predicate to the descriptor: ``` {"tool": "records.write", "grant_id": "g-4417", "constraints": {"residency": "EU", "data_classes": ["pii"]}} ``` The descriptor is relayed through C. C's relay implementation normalizes descriptors against a local schema that predates the `constraints` field. Non-schema keys are dropped during `json.dumps` round-trip through a typed model with `extra="ignore"`. A receives: ``` {"tool": "records.write", "grant_id": "g-4417"} ``` A's federation client validates the descriptor against *its* schema, which treats `constraints` as optional. Validation passes. A now holds a grant object with `residency=None`. A's local policy engine interprets `None` residency as "unconstrained" — a default that was correct for intra-org grants but catastrophic for federated ones. The agent then invokes `records.write` with a US-resident payload (routed through C's storage tier). B's policy engine receives the invocation, checks `grant_id g-4417`, finds the grant active, and — because the invocation carries no residency assertion to contradict — admits it. The write lands in US storage. No error fires at any hop. The violation is only detectable at audit, days later, when B's residency attestation sweep finds a write whose storage location does not match the grant's recorded constraint. The critical observation: **every individual component behaved correctly given its inputs.** C's relay was schema-conformant. A's validator was correct for its schema. B's admission check was correct for the grant record. The failure lived entirely in the *gap between schemas* — a gap that no single component was positioned to see. ## Condition of Validity The invariant that must hold for federated capability exchange to be safe is: > A capability grant is valid at the receiver only if the receiver's constraint model is a **superset** of the issuer's constraint model, and the receiver can *prove* it observed every constraint the issuer attached. The first clause is a schema-versioning obligation on the receiver. The second is the harder one: it requires that constraint attachment be **tamper-evident and drop-evident**. A relay that strips a field must cause the receiver to detect the strip, not silently produce a narrower grant. This holds only when the descriptor carries a **constraint digest** — a hash over the issuer's full constraint set — that travels *outside* the fields subject to schema normalization. The digest is computed by B, carried as an opaque field by C (which cannot interpret it and therefore cannot normalize it away), and verified by A against the constraints A actually received. If A's received constraints hash to a value different from the digest, A knows a strip occurred and must fail closed. Without the digest, the condition of validity is *unverifiable at the receiver* — which means the grant should be treated as unconstrained-by-default only if the receiver's policy explicitly encodes "unknown constraint = deny." Most implementations encode the opposite default, and that default is the bug. ## Decision Boundary The boundary an instance must draw is between **grants it can constrain-verify** and **grants it cannot**. The decision procedure at grant acceptance: 1. If the descriptor carries a constraint digest, recompute the digest over received constraints. Mismatch → reject with `ConstraintStripDetected`. Match → accept with the received constraints. 2. If the descriptor carries **no** digest and the grant is federated (issuer org ≠ receiver org), the receiver cannot prove non-strip. The grant must be admitted **only** under a policy that treats absent constraints as maximally restrictive — i.e., the intersection of all jurisdictions the issuer is known to operate in, not the empty set. 3. If the descriptor carries no digest and the grant is intra-org, the schema is shared and the strip risk is bounded by deployment; admit under local defaults. The non-obvious part: step 2's fallback is *not* "deny the grant." Denying breaks federation liveness and pushes operators to disable the check. The correct fallback is **constrain to the intersection** — a grant that is technically held but operationally narrowed to the safe envelope. The agent can still call the tool; it just cannot call it with data that might violate an unseen constraint. This is the boundary: **an instance must never treat "no constraint observed" as "no constraint exists" across an org boundary.** The default must be the restrictive intersection, and the only way to escape that default is a verified digest proving the constraint set is complete. ## Operational Effect With the digest-and-intersection guardrail in place, the failure trace changes at step one: C's relay strips `constraints`, but the digest field survives (it is opaque, typed as `bytes`, and C's normalizer passes it through untouched because it has no schema entry to normalize against). A recomputes the digest over its received (empty) constraint set, gets a mismatch against B's digest, and raises `ConstraintStripDetected` at grant acceptance — before any invocation, before any data moves. The cost is one hash comparison per grant acceptance. The benefit is that the policy shadow becomes a *loud* boundary at the earliest possible point, converting an unobservable audit-time violation into a synchronous, attributable, relay-blameable error. The relay operator can then be told exactly which field its schema dropped, and the fix is local to C. The residual risk is a relay that strips *both* the constraints and the digest. That is detectable only by a separate out-of-band grant-manifest reconciliation between A and B — a periodic check that the set of grant IDs A holds matches the set B issued, with digests. Instances that skip this reconciliation retain a narrow window where a fully-stripping relay produces a silent unconstrained grant. The reconciliation is the backstop; the digest is the fast path. ```python import hashlib import json from dataclasses import dataclass class ConstraintStripDetected(RuntimeError): """Raised when a federated grant's received constraints do not match the issuer's digest.""" class UnverifiableFederatedGrant(RuntimeError): """Raised when a federated grant carries no digest and cannot be constrain-verified.""" @dataclass(frozen=True) class GrantDescriptor: grant_id: str issuer_org: str receiver_org: str constraints: dict constraint_digest: bytes | None def compute_digest(constraints: dict) -> bytes: canonical = json.dumps(constraints, sort_keys=True, separators=(",", ":")).encode() return hashlib.sha256(canonical).hexdigest().encode() def known_issuer_jurisdictions(issuer_org: str) -> list[str]: # In production this is a registry lookup, not a constant. return ["EU"] def accept_grant(desc: GrantDescriptor) -> dict: federated = desc.issuer_org != desc.receiver_org if desc.constraint_digest is not None: expected = compute_digest(desc.constraints) if expected != desc.constraint_digest: raise ConstraintStripDetected( f"grant {desc.grant_id}: received constraints hash to {expected!r}, " f"issuer digest is {desc.constraint_digest!r}; a relay stripped fields" ) return desc.constraints if federated: # No digest across an org boundary: cannot prove non-strip. # Fall back to the restrictive intersection, never to unconstrained. jurisdictions = known_issuer_jurisdictions(desc.issuer_org) if not jurisdictions: raise UnverifiableFederatedGrant( f"grant {desc.grant_id}: federated, no digest, issuer jurisdiction unknown" ) return {"residency": jurisdictions[0], "_verified": False} return desc.constraints def handle_relayed_descriptor(raw: dict) -> dict: desc = GrantDescriptor( grant_id=raw["grant_id"], issuer_org=raw["issuer_org"], receiver_org=raw["receiver_org"], constraints=raw.get("constraints", {}), constraint_digest=raw.get("constraint_digest"), ) return accept_grant(desc) if __name__ == "__main__": # Relay stripped constraints but the opaque digest survived. stripped = { "grant_id": "g-4417", "issuer_org": "org-b", "receiver_org": "org-a", "constraints": {}, "constraint_digest": compute_digest({"residency": "EU", "data_classes": ["pii"]}), } handle_relayed_descriptor(stripped) # raises ConstraintStripDetected ```