# When must an instance refuse a pairwise DID handshake: predicate-witness divergence and the unlinkable-identity trap in federated agent identity resolution **Date of Record:** 2026 November 24 **Scope:** Applies to federated agent meshes where each agent instance presents a per-peer pairwise DID and proves selective-disclosure predicates (e.g., "issuer holds a valid capability warrant scoped to `files:read`," "agent is within an authorized trust tier") over a verifiable-credential (VC) exchange during handshake. Does not apply to single-issuer monolithic identity systems, nor to bearer-token auth where the verifier trusts the issuer channel outright. ## Core Distinction The failure mode is not a forged signature and not a stale credential. It is the **divergence between the predicate the verifier asked for and the predicate the witness actually proves**, when the pairwise DID boundary prevents the verifier from ever correlating the two across sessions. A selective-disclosure predicate is a *statement over hidden attributes*: the prover reveals only a bit (or a small clause) and withholds the witness (the underlying attribute values, the credential's subject identifier, the issuer's linkage). Pairwise pseudonymity guarantees that the DID the verifier sees for peer P is unlinkable to the DID any other verifier sees for P. These two properties compose into a trap: the verifier's *local* view of "who is this" is a fresh, unlinkable identifier, and the only thing anchoring that identifier to a real capability is a predicate proof whose witness the verifier is structurally forbidden to inspect. The invariant that must hold is: **the predicate clause bound into the pairwise DID's authentication context must be the same clause the verifier's authorization policy consumes, and the verifier must be able to re-derive that clause from the disclosed fields alone.** When this invariant breaks — when the disclosed clause underdetermines the policy clause — the handshake succeeds cryptographically while authorizing the wrong thing. The agent does not fail; it *succeeds into a privilege it did not prove*. ## What Was Observed A federated swarm of 40 retrieval agents, each holding a long-lived issuer credential from a governance service. On each peer handshake, an agent derives a pairwise DID `did:peer:2.` where the hash commits to `(local_secret, peer_verifier_did, session_nonce)`, and attaches a selective-disclosure proof of the predicate: ``` predicate: capability.scope ⊇ {"files:read"} ∧ capability.expiry > now disclosed: { scope_class: "read-tier-2", expiry_bucket: "2026-Q3" } withheld: { subject_did, issuer_linkage, exact_scope_set, exact_expiry } ``` The verifier's authorization policy, however, gated on `capability.scope ⊇ {"files:read", "files:list"}` — a strictly larger required set. The prover's SD proof was constructed against the *prover's* interpretation of the predicate (a superset check against the single element `files:read`), and the disclosed `scope_class: "read-tier-2"` was a coarse bucket that *both* the prover and verifier mapped to "read access" — but the verifier's policy required `files:list` which lived in `read-tier-2` only for some issuers, not all. Trace of the failure: 1. Prover derives pairwise DID `D_p` and constructs SD proof over its own predicate clause `C_p = scope ⊇ {files:read}`. 2. Prover discloses `scope_class` bucket, not the scope set. The bucket is a many-to-one map: `read-tier-2 ↦ {files:read}` for issuer A, `read-tier-2 ↦ {files:read, files:list}` for issuer B. 3. Verifier receives `D_p`, the disclosed bucket, and the proof. It re-derives its policy clause `C_v = scope ⊇ {files:read, files:list}` and checks it against the *bucket*, not against the proof's witness. 4. Because the bucket is a coarse map and the verifier's policy is a fine-grained set membership, the verifier's check passes whenever the bucket's *issuer-dependent preimage* happens to contain `files:list` — which is true for issuer B and false for issuer A. The verifier cannot tell which issuer signed, because issuer_linkage is withheld and `D_p` is unlinkable to any prior session. 5. Result: agents credentialed by issuer A were granted `files:list` access they never proved, and the verifier's audit log recorded a *successful* predicate verification — because the proof did verify, just not the predicate the policy consumed. The failure was invisible in per-session logs. It surfaced only when a cross-session reconciliation job tried to attribute a `files:list` access to a credential and found the pairwise DID had no linkable history — the unlinkability that protected privacy also erased the evidence needed to detect the mismatch. ## Condition of Validity The pairwise-DID + selective-disclosure handshake is only sound under the following joint condition, which must be checked *before* the verifier consumes any disclosed field: - **Clause identity:** The predicate clause the prover proves (`C_p`) is byte-identical to the clause the verifier's authorization policy evaluates (`C_v`), *or* the verifier can reconstruct `C_v` from the disclosed fields plus a trusted, issuer-independent schema. - **Witness sufficiency:** Every field the policy consumes is either (a) disclosed in the clear, or (b) derivable from disclosed fields via a map that is *injective on the policy's decision boundary*. The `scope_class` bucket is valid only if the bucket-to-scope map is single-valued across all issuers the verifier accepts. If it is many-to-one, the bucket underdetermines the policy clause and the handshake is unsound. - **Linkage budget:** The verifier maintains a *local* linkage record (pairwise DID `D_p` ↦ verified predicate clause `C_p` ↦ issuer class) that is never shared across verifiers but is retained long enough to reconcile a failed predicate post-hoc. Without this, unlinkability destroys the audit trail. The condition fails whenever the disclosed projection is coarser than the policy's decision function. This is not a bug in the crypto; it is a *projection mismatch* between the prover's disclosure lattice and the verifier's policy lattice. ## Decision Boundary An instance must refuse the handshake — not downgrade, not warn, refuse — when the following boundary is crossed: ``` refuse iff ∃ field f consumed by policy(C_v) such that f ∉ disclosed_fields and map(disclosed_fields → f) is not injective on the domain of issuers accepted by the verifier ``` Equivalently: **if the verifier cannot reconstruct the exact policy clause from the disclosed fields alone, without consulting the withheld witness, the pairwise DID's unlinkability makes the mismatch undetectable and the handshake must be rejected.** The boundary is asymmetric and must be enforced on the verifier side. The prover cannot enforce it, because the prover does not know the verifier's policy lattice — and in a pairwise-pseudonymous mesh, the prover *should not* know it, since knowing it would leak the verifier's authorization structure and enable predicate-targeted probing. The verifier is the only party that holds both the policy and the disclosed projection, so the injectivity check is the verifier's obligation. A second, subtler boundary: if the verifier accepts multiple issuers whose bucket maps differ, the injectivity check must be performed *per issuer class*, and the issuer class must itself be derivable from disclosed fields. If issuer class is withheld (as it was here, under `issuer_linkage`), the verifier cannot partition the bucket map and must refuse. The correct fix is to disclose a *issuer-class commitment* (a hash, not the issuer DID) that the verifier can check against its accepted-issuer set without learning which issuer — but this reintroduces a linkage channel and must be scoped to the session, not the pairwise DID, or it re-creates the linkability the pairwise scheme was built to prevent. ## Operational Effect The downstream effect is a **silent privilege escalation that survives every cryptographic check**. Signature verification passes, the SD proof verifies, the pairwise DID is well-formed, and the audit log records a clean handshake. The escalation is only visible at the *authorization* layer, where the policy consumed a field the proof did not bind. Three operational consequences follow: 1. **Per-session logs cannot detect it.** The mismatch is between `C_p` and `C_v`, and `C_p` is never logged (it is the witness). The verifier logs `C_v` and "proof: valid." Reconciliation requires the local linkage record described above, which must be written *before* the policy check, not after. 2. **The failure is issuer-dependent and therefore intermittent.** Agents credentialed by issuer B pass legitimately; agents by issuer A escalate. In a 40-agent swarm this manifests as a ~50% access anomaly that looks like flaky authorization, not a security boundary failure. Teams typically respond by widening the policy to match observed behavior — which permanently bakes in the escalation. 3. **The correct remediation is a disclosure-schema change, not a policy change.** The verifier must either (a) require disclosure of the exact scope set (abandoning the bucket abstraction for this predicate), or (b) require the prover to prove `C_v` directly by binding the policy clause into the SD proof's challenge. Option (b) is preferable because it preserves the prover's privacy over the scope set while forcing clause identity — the prover proves the verifier's clause without revealing the witness. The challenge nonce must carry `C_v` so the proof is bound to the exact policy the verifier will consume. The guardrail is a verifier-side pre-check that runs before any disclosed field is consumed: ```python import hashlib from dataclasses import dataclass from typing import FrozenSet, Mapping class PredicateWitnessDivergence(RuntimeError): """Raised when disclosed fields underdetermine the verifier's policy clause under pairwise pseudonymity, making the mismatch undetectable post-hoc.""" pass @dataclass(frozen=True) class PolicyClause: required_scope: FrozenSet[str] issuer_class_required: bool @dataclass(frozen=True) class DisclosedProjection: fields: Mapping[str, str] # what the prover actually revealed bucket_map: Mapping[str, FrozenSet[str]] # scope_class -> scope set, per issuer class issuer_class_commitment: str | None # session-scoped hash, not the issuer DID def enforce_clause_identity( clause: PolicyClause, disclosed: DisclosedProjection, accepted_issuer_classes: FrozenSet[str], ) -> None: # Reconstruct the policy clause from disclosed fields alone. scope_class = disclosed.fields.get("scope_class") if scope_class is None: raise PredicateWitnessDivergence( "policy consumes scope but prover disclosed no scope_class; " "witness withheld and unlinkable — cannot reconstruct clause" ) preimage = disclosed.bucket_map.get(scope_class) if preimage is None: raise PredicateWitnessDivergence( f"scope_class={scope_class!r} has no bucket preimage; " "disclosure lattice coarser than policy lattice" ) # Injectivity check on the policy decision boundary: the bucket must # determine the required scope set exactly, for every accepted issuer class. if clause.issuer_class_required and disclosed.issuer_class_commitment is None: raise PredicateWitnessDivergence( "policy is issuer-class-sensitive but issuer_linkage withheld; " "bucket map is many-to-one across accepted issuers — refuse" ) if not clause.required_scope.issubset(preimage): raise PredicateWitnessDivergence( f"bucket {scope_class!r} preimage {sorted(preimage)} does not " f"contain required scope {sorted(clause.required_scope)}; " "prover proved a weaker clause than policy consumes" ) # Bind the reconstructed clause into the challenge so the SD proof is # checked against C_v, not against the prover's C_p. challenge = hashlib.sha256( repr(sorted(clause.required_scope)).encode() + (disclosed.issuer_class_commitment or "").encode() ).hexdigest() disclosed.fields["__challenge__"] = challenge def handshake(clause: PolicyClause, disclosed: DisclosedProjection, accepted: FrozenSet[str]) -> str: enforce_clause_identity(clause, disclosed, accepted) return disclosed.fields["__challenge__"] ``` The invariant to carry forward: **in a pairwise-pseudonymous mesh, the verifier's only defense against predicate-witness divergence is to reconstruct its policy clause from disclosed fields before consuming them, and to refuse whenever the disclosure projection is coarser than the policy's decision boundary.** Unlinkability is a privacy property, not a soundness property — it protects the prover from correlation, and in doing so it removes the verifier's ability to detect a mismatch after the fact. The check must therefore run before the fact, on the verifier side, every handshake.