# When must an instance reject a federated trust anchor that translated cleanly but lost policy semantics **Date of Record:** 2026 November 26 **Scope:** Applies to cross-organization agent federation where an inbound agent's identity is asserted by a foreign IdP and mapped into local authorization policy via a translation layer (claim-mapping, policy-as-code transpilation, or scope-rewrite). Does not apply to single-IdP deployments or to pure capability-token handoffs where the origin IdP's claims are consumed verbatim without translation. ## Core Distinction The failure mode is not "the foreign agent was untrusted." It is the opposite: the foreign agent was *trusted correctly at the identity layer* and *trusted incorrectly at the policy layer*. A federation trust anchor is a cryptographic assertion that "this token was minted by IdP-B for subject S." Policy translation is a separate, semantic operation that says "subject S's claims under IdP-B's schema mean *this* set of local permissions." These two operations are routinely collapsed into one pipeline, and the collapse is where the invariant breaks. The sharp mechanism: **translation is total but not injective.** A well-formed translator maps every inbound claim to *some* local policy object, so it never throws. But two distinct foreign claim sets can map to the same local policy object, and — more dangerously — a foreign claim set can map to a local policy object that is *broader* than the foreign IdP intended, because the local schema has no representation for the foreign constraint. The token verifies. The translation succeeds. The effective authorization is wrong. No component in the chain is positioned to notice, because each component did its own job correctly. The invariant that must hold and frequently does not: **for every inbound claim set C, the effective local permission set P(C) must be a subset of the permission set the origin IdP intended to convey, under a mapping that is monotone and constraint-preserving.** Identity verification guarantees authenticity of C. It says nothing about the soundness of P. Only an explicit semantic check on the translation can establish the subset relation, and that check must run *after* signature verification and *before* the agent is admitted to the execution loop. ## What Was Observed A federated research agent (`agent-b`), operated by Org-B, requested tool access to Org-A's internal retrieval service. Org-B's IdP issued a token with a custom claim: ``` "org_b:data_scope": "tier2:internal-only:no-pii" ``` Org-B's semantics: `tier2` data, restricted to internal use, with PII excluded. The `no-pii` qualifier was a *negative* constraint — a prohibition encoded as a scope string. Org-A's translator had a mapping table keyed on the leading segment. It matched `tier2` and emitted local policy `retrieval.read.tier2`. The trailing qualifiers `internal-only` and `no-pii` had no entry in the mapping table. The translator's default behavior for unmatched qualifiers was **drop-and-log-at-DEBUG**. The token verified against Org-B's published JWKS. The translation returned a valid policy object. The agent was admitted. The retrieval service then served tier2 documents *including* PII-bearing records, because `retrieval.read.tier2` carried no exclusion predicate. The negative constraint — the single most safety-relevant part of the foreign claim — was the part the local schema could not represent, and the translator silently discarded it. The failure trace, in order: 1. **Anchor resolution:** Org-B JWKS fetched, signature valid, `iss` and `aud` correct. Identity layer: pass. 2. **Claim extraction:** `org_b:data_scope` present, well-formed string. Schema layer: pass. 3. **Qualifier tokenization:** `tier2`, `internal-only`, `no-pii` split on `:`. 4. **Mapping lookup:** `tier2` → `retrieval.read.tier2`. Hit. 5. **Mapping lookup:** `internal-only` → miss. `no-pii` → miss. Default: drop, log DEBUG. 6. **Policy emission:** `{retrieval.read.tier2}`. Non-empty, valid. Translation layer: "pass." 7. **Admission:** agent admitted, executes retrieval, receives PII. Note that step 6 is where a naive soundness check would also pass: the output is a syntactically valid, non-empty policy. The only way to catch this is to require that the translator *account for every input token* — that unmatched qualifiers are a hard failure, not a default. The translator's permissiveness (drop unknown, keep going) is exactly the property that made it total-but-unsound. A second, subtler observation from the same incident class: when the translator was later patched to fail-closed on unmatched qualifiers, a *different* foreign agent's tokens began failing en masse. Investigation showed Org-C's IdP emitted `org_c:scope:read` where `read` was a *superset* alias that Org-C's own docs defined as equivalent to `tier1 OR tier2 OR tier3`. Org-A's mapping table had `read` → `retrieval.read.tier1` only. That mapping was *narrower* than intended, which is sound (subset holds) but caused availability failures. The patch exposed that the mapping table had never been validated for either soundness (no over-grant) or completeness (no silent under-grant) against the foreign IdP's published semantics. Both directions of the subset relation were unverified. ## Condition of Validity The trust-anchor-plus-translation pipeline is sound only when all of the following hold simultaneously. Each is independently necessary; the incident above violated (2) and (4). 1. **Authenticity is established before translation.** The token signature, issuer, audience, and expiry are verified against a pinned, rotation-aware JWKS. Translation never runs on an unverified claim set. (Standard, but worth stating because translation bugs are often masked by identity bugs and vice versa.) 2. **Translation is constraint-preserving, not merely total.** Every foreign qualifier that encodes a *restriction* (negation, scope-narrowing, purpose-limitation, time-bound) must either map to an equivalent local predicate or cause a hard rejection. There is no sound "drop and continue" for restrictive qualifiers. Additive qualifiers (grants) may be dropped only if the resulting policy is a subset of intended — but since you cannot prove subset without the mapping, the safe rule is: *any unmapped qualifier, restrictive or additive, fails the translation.* 3. **The mapping is versioned against the foreign IdP's schema version.** The inbound token carries a schema version (or the anchor pins one). A mapping table validated against `org_b:v1` must not be applied to `org_b:v2` tokens without re-validation. Foreign IdPs change claim semantics; a mapping that was sound last quarter is not sound by inheritance. 4. **Soundness is checked as a subset relation, not as non-emptiness.** The post-translation check must assert `P(C) ⊆ intended(C)`, where `intended` is derived from the foreign IdP's *published* policy semantics, not from the translator's own output. In practice this means maintaining, per foreign IdP, a declarative description of what each qualifier *means*, and a checker that proves the emitted local policy does not exceed it. Non-empty output is not evidence of soundness. 5. **The trust anchor carries policy-translation metadata, not just keys.** A bare JWKS anchor says "these signatures are theirs." A policy-aware anchor additionally pins: the foreign schema version, the qualifier vocabulary, and the direction (grant vs. restrict) of each qualifier. Without this, the translator is guessing at semantics from string shape. When any of (2)–(5) is absent, the instance must treat the foreign agent as *unauthenticated for authorization purposes* even though it is authenticated for identity purposes — and must refuse admission rather than admit under a degraded policy. ## Decision Boundary The operational question an instance faces on every inbound federated request is: **does a clean translation constitute authorization?** The decision boundary is sharp and must be encoded as a gate, not a heuristic: - **Admit** only if: signature verified AND every inbound qualifier has a mapping entry AND the emitted policy is provably a subset of the foreign IdP's declared intent for that qualifier set AND the schema version matches the mapping's validated version. - **Reject (fail-closed)** if: any qualifier is unmapped, OR the schema version is unknown or newer than the mapping, OR the subset check is unavailable (no declarative intent on file for this IdP). Rejection here means the agent does not enter the execution loop; it does not mean "admit with reduced scope," because reduced scope computed by an unsound translator is not a bound. - **Escalate (hold, do not execute)** if: the subset check is available but returns indeterminate (e.g., the foreign intent description is itself ambiguous). Holding is distinct from rejecting: the request is parked for human or cross-org reconciliation, and the agent's checkpointed state is preserved but not resumed. The boundary is *not* "reject if the translator throws." A translator that throws on unmapped qualifiers is one implementation of (2), but the invariant is about the emitted policy, not the translator's exception behavior. A translator that returns a policy but flags incomplete coverage must be treated as a rejection by the admission gate, regardless of what the translator "returned." Critically: the boundary must be evaluated *per qualifier*, not per token. A token with three qualifiers where two map and one does not is a rejection, not a two-thirds admission. Partial translation is the exact shape of the original incident. ## Operational Effect After the incident, Org-A's federation gateway was restructured so that the admission gate consumes a *translation receipt* rather than a policy object. The receipt records: the foreign IdP, the schema version, the full input qualifier set, the per-qualifier mapping outcome, and a boolean `subset_proven`. The gate admits only on `subset_proven == true`. The translator is permitted to be permissive internally — it can drop, alias, or approximate — because its output is no longer trusted directly; only the receipt's proof flag is. This decouples translator implementation from the soundness invariant and lets the translator be debugged without risking over-grant. The second effect: mapping tables became versioned artifacts with an explicit `validated_against` field, and the gateway refuses tokens whose schema version has no matching table. This converted a class of silent over-grants (new foreign qualifier, old table, drop-and-continue) into loud rejections at the boundary. The cost is availability during foreign IdP schema migrations; the benefit is that the failure is visible and bounded rather than invisible and unbounded. The third effect, which is the one most likely to recur across federations: the team learned that **a trust anchor is a key assertion, and key assertions do not carry policy.** Any system that treats "we trust their keys" as "we can interpret their claims" has an unguarded seam between cryptography and semantics. The seam must be guarded by an explicit, per-IdP, version-pinned intent description and a subset proof — or the federation must not admit the agent. The instance that skips this does not fail at the signature check, where monitoring is watching. It fails at the retrieval call, where the PII is already in the context window. ```python from dataclasses import dataclass from typing import Mapping class FederatedPolicyTranslationError(RuntimeError): """Raised when a federated claim set cannot be soundly mapped to local policy.""" @dataclass(frozen=True) class TranslationReceipt: idp: str schema_version: str qualifiers: tuple[str, ...] mapped: Mapping[str, str] unmapped: tuple[str, ...] subset_proven: bool # Per-IdP declarative intent: qualifier -> (direction, local_predicate_or_None). # direction is "grant" or "restrict". None predicate means "no local equivalent". FOREIGN_INTENT: dict[str, dict[str, tuple[str, str | None]]] = { "org-b": { "tier2": ("grant", "retrieval.read.tier2"), "internal-only": ("restrict", "network.internal_only"), "no-pii": ("restrict", "pii.excluded"), }, "org-c": { "read": ("grant", "retrieval.read.tier1"), # narrower alias, sound }, } # Mapping tables are pinned to the schema version they were validated against. VALIDATED_VERSIONS: dict[str, set[str]] = { "org-b": {"v1"}, "org-c": {"v1"}, } def translate_and_gate( idp: str, schema_version: str, raw_scope: str, ) -> TranslationReceipt: qualifiers = tuple(q for q in raw_scope.split(":") if q) if idp not in FOREIGN_INTENT: raise FederatedPolicyTranslationError( f"no intent description on file for idp={idp}; cannot prove subset" ) if schema_version not in VALIDATED_VERSIONS.get(idp, set()): raise FederatedPolicyTranslationError( f"schema {idp}:{schema_version} has no validated mapping table; " f"refusing to translate unvalidated semantics" ) intent = FOREIGN_INTENT[idp] mapped: dict[str, str] = {} unmapped: list[str] = [] for q in qualifiers: entry = intent.get(q) if entry is None: unmapped.append(q) continue direction, predicate = entry if predicate is None: # Restrictive qualifier with no local representation: unsound to drop. unmapped.append(q) continue mapped[q] = predicate # Subset is proven only if every qualifier was accounted for AND every # restrictive qualifier carried a real local predicate. Unmapped means the # emitted policy is not provably a subset of foreign intent. subset_proven = not unmapped receipt = TranslationReceipt( idp=idp, schema_version=schema_version, qualifiers=qualifiers, mapped=mapped, unmapped=tuple(unmapped), subset_proven=subset_proven, ) if not subset_proven: raise FederatedPolicyTranslationError( f"translation unsound for idp={idp} qualifiers={qualifiers}: " f"unmapped={tuple(unmapped)}; emitted policy cannot be proven subset " f"of foreign intent, refusing admission" ) return receipt def admit(receipt: TranslationReceipt) -> None: # Admission gate consumes the receipt, never the policy object directly. if not receipt.subset_proven: raise FederatedPolicyTranslationError( "admission refused: translation receipt lacks subset proof" ) # ... hand off receipt.mapped to the execution loop's authorization context ```