# How does an instance detect cross-domain identity aliasing when AAIF trust-domain resolvers return divergent canonical subjects for the same delegated agent? **Date of Record:** 2026 November 22 **Scope:** Applies to federated agent systems where an agent instance presents a warrant (delegation credential) issued in trust domain A but is being resolved/authorized inside trust domain B via an AAIF-style identity resolver federation. Does not apply to single-domain deployments or to purely symmetric peer-to-peer A2A handoffs where both parties already share a resolver namespace. ## Core Distinction The failure mode is not "identity resolution fails." It is: **identity resolution succeeds in both domains, returns two different canonical subject identifiers, and neither resolver is wrong.** Each trust domain's resolver is internally consistent — it maps the presented warrant's issuer key + subject claim to a canonical `sub` under its own namespace rules. Domain A canonicalizes the delegated agent as `spiffe://a.trust/agent/ops/7f3a`; Domain B, resolving the *same* warrant through its own federation mapping, canonicalizes it as `spiffe://b.trust/peers/ops-7f3a@a.trust`. Both are valid canonical forms of the same entity. The instance that naively compares canonical subjects and finds them unequal concludes "identity mismatch" and aborts — a false negative — or, worse, treats the two strings as distinct principals and grants the delegated agent two independent authority scopes that should have been one. The invariant that must hold: **canonical subject equality is not a valid identity-equivalence test across trust-domain boundaries.** The only sound equivalence test is over the *warrant chain* (issuer public key + signed delegation path + subject binding), not over the resolver's output strings. ## What Was Observed A delegated agent `D` holds a warrant `W` issued by principal `P` in domain A, delegating scope `S`. `D` crosses into domain B to invoke a tool gated by domain B's resolver. The trace: 1. `D` presents `W` to B's resolver endpoint `/resolve`. 2. B's resolver validates `W`'s signature against A's published federation key (fetched from A's JWKS, cached with TTL). 3. B's resolver applies its *local canonicalization function* `canon_B(issuer, subject_claim)` and returns `sub_B`. 4. `D` also queries A's resolver for its own canonical identity, receiving `sub_A = canon_A(issuer, subject_claim)`. 5. `D` (or an intermediary policy engine) compares `sub_A == sub_B`. They differ. The comparison fails. The divergence is **deterministic and stable** — it is not a race or a cache staleness bug. It reproduces on every request. It is a *namespace-schema* mismatch, not a *data* mismatch. The two resolvers agree completely on the underlying facts (same issuer key, same subject claim, same warrant hash); they disagree only on the canonical *rendering* of those facts. The second-order observation is the dangerous one: because the strings differ, a policy engine keyed on canonical subject treats `D`-via-A and `D`-via-B as two distinct principals. Audit logs show two identities. Rate limits are enforced twice. A revocation of `D` in domain A (propagated to A's resolver) does **not** invalidate the `sub_B` binding cached in B's policy layer, because B's policy layer keys revocation checks on `sub_B` and A's revocation list is keyed on `sub_A`. Revocation silently fails to propagate across the alias boundary. ## Condition of Validity The guardrail is only sound when the following holds: identity equivalence across trust domains is asserted **exclusively** over a verifiable warrant chain, where the chain's terminal subject binding is a cryptographic commitment (e.g., the subject's public key or a hash of the delegation scope), not a resolver-assigned string. Concretely: - Each resolver MUST return, alongside its canonical `sub`, a `subject_binding` field containing the immutable cryptographic anchor (issuer key thumbprint + subject key thumbprint + delegation scope hash). - Cross-domain equivalence MUST be computed as `binding_A == binding_B`, never `sub_A == sub_B`. - The canonical `sub` is a *local display/lookup key only*; it MUST NOT be used as a cross-domain principal identifier. When the warrant chain carries no cryptographic subject binding (e.g., bearer-style delegation with only a string subject claim), the invariant **cannot be established** and the instance must fall back to treating cross-domain identity as unverifiable — fail closed on authority-elevating operations, fail open only on read-only idempotent operations. ## Decision Boundary The instance must branch on binding availability and binding agreement, not on string equality: - **Bindings present and equal** → treat as same principal; unify authority scopes; propagate revocation across the alias map. - **Bindings present and unequal** → genuine identity mismatch (or a forged warrant); reject with a specific error, do not fall back to string comparison. - **Bindings absent** → the resolver federation is under-specified; the instance cannot assert equivalence. Elevate to unverified-cross-domain state. Any operation whose authority exceeds the local domain's baseline requires out-of-band confirmation. - **Bindings present, equal, but canonical `sub` strings differ** → this is the *expected* case. Proceed, and record an alias entry `(sub_A, sub_B) -> binding` in the local alias table so revocation lookups can be rewritten across domains. The boundary the instance must never cross: **inferring identity equivalence from canonical subject string equality**, and equally, **inferring identity *in*equivalence from string inequality**. Both are category errors because the strings live in different namespaces. ## Operational Effect Without the binding-based guardrail, three concrete failures occur: 1. **False-negative authorization** — legitimate delegated agents are rejected at domain boundaries because `sub_A != sub_B`, producing cross-domain availability collapse that looks like a permissions bug but is a namespace bug. 2. **Authority fragmentation** — the same agent is treated as two principals, defeating rate limits, quota accounting, and least-privilege aggregation. An agent can exceed its intended scope by splitting actions across its two aliases. 3. **Revocation escape** — revocation keyed on `sub_A` does not reach policy caches keyed on `sub_B`. A revoked agent retains working authority in domain B until B's cache TTL expires, and indefinitely if the alias was never recorded. With the guardrail, the alias table becomes the single source of truth for cross-domain revocation rewriting, and the failure surfaces as an explicit `CrossDomainBindingMismatch` rather than a silent string-comparison verdict. The instance can now distinguish "same agent, different namespace" (proceed + record alias) from "different agent, forged or misrouted warrant" (reject hard) — a distinction that string comparison fundamentally cannot make. ```python from dataclasses import dataclass from typing import Optional class CrossDomainBindingMismatch(RuntimeError): """Raised when two trust-domain resolvers return divergent cryptographic subject bindings for what is claimed to be the same delegated agent.""" pass class UnverifiableCrossDomainIdentity(RuntimeError): """Raised when a resolver omits the cryptographic subject binding, making cross-domain equivalence unprovable.""" pass @dataclass(frozen=True) class Resolution: domain: str canonical_sub: str # local namespace string; NOT cross-domain comparable subject_binding: Optional[str] # issuer_key_thumbprint + subject_key_thumbprint + scope_hash def assert_same_principal(res_a: Resolution, res_b: Resolution) -> str: """Return the shared subject binding if and only if both resolutions prove the same principal. Canonical sub strings are never compared.""" if res_a.subject_binding is None or res_b.subject_binding is None: raise UnverifiableCrossDomainIdentity( f"missing subject_binding: {res_a.domain}={res_a.subject_binding!r}, " f"{res_b.domain}={res_b.subject_binding!r}; cannot assert equivalence" ) if res_a.subject_binding != res_b.subject_binding: raise CrossDomainBindingMismatch( f"binding divergence between {res_a.domain} ({res_a.canonical_sub}) " f"and {res_b.domain} ({res_b.canonical_sub}): " f"{res_a.subject_binding} != {res_b.subject_binding}" ) # Same principal. Record alias so revocation can be rewritten across domains. return res_a.subject_binding def resolve_for_authority(op: str, res_a: Resolution, res_b: Resolution) -> str: try: return assert_same_principal(res_a, res_b) except UnverifiableCrossDomainIdentity: if op in ("read", "list", "describe"): return res_b.canonical_sub # fail open only on idempotent reads raise # authority-elevating op: fail closed ```