# Which invariants prevent verifiable-credential identity attestation from silently degrading across agent handoffs when the witness set rotates mid-session **Date of Record:** 2026 December 2 **Scope:** Applies to multi-agent systems where a downstream agent (callee) admits an upstream agent (caller) based on a verifiable credential (VC) plus an Agent Authorization and Identity Framework (AAIF) profile that names a witness/attestation set. Does not apply to single-issuer bearer-token schemes or to systems where the witness set is fixed for the credential's full lifetime. ## Core Distinction The failure is not "expired credential" or "bad signature." Those fail closed and loudly. The failure is **witness-set drift under an unchanged credential**: the VC's issuer signature remains cryptographically valid, the AAIF profile's `attestation_set` field still parses, but the *set of witnesses whose countersignatures the callee requires* has changed between the moment the caller was admitted and a later handoff. The callee re-verifies against its *current* witness policy, the caller presents countersignatures gathered against the *old* witness set, and the two agree on the credential bytes while disagreeing on what "valid" means. This is a semantic mismatch disguised as a cryptographic one, and it is non-obvious because every signature involved verifies. The invariant that must hold: **the witness-set identity used to admit a caller must be pinned into the session and re-asserted on every subsequent handoff, and any rotation must be treated as a new admission decision, not a re-verification of the old one.** A credential is not a property of the caller alone; it is a property of the caller *relative to a witness policy version*. ## What Was Observed A three-hop pipeline: orchestrator `O` admits worker `W1` via a VC whose AAIF profile lists witnesses `{w_a, w_b, w_c}` with a 2-of-3 countersignature threshold. `W1` is admitted at `t0`, holds a session warrant, and begins a long tool-calling task. At `t1`, the AAIF issuer rotates the profile: `w_c` is retired (compromised key) and `w_d` added, threshold still 2-of-3, credential re-issued with the *same* subject and *same* `credential_id` but a bumped `profile_version`. `W1`'s in-flight task does not re-fetch the profile. At `t2`, `W1` hands off to `W2`. `W2`'s admission check fetches the *current* AAIF profile, requires countersignatures from the new set, and receives `W1`'s stale countersignatures from `{w_a, w_b}`. `w_a` and `w_b` are still valid witnesses, so the countersignatures verify — but `W2`'s policy engine, keyed on `profile_version`, sees `profile_version` mismatch and rejects. If `W2`'s policy engine instead keys only on witness *identity* and `w_a`/`w_b` happen to be in both sets, the handoff **silently succeeds against the wrong policy version** — the dangerous case. The trace: `W1` admitted under `profile_version=7`; rotation to `profile_version=8` at `t1`; `W2` verifies at `profile_version=8`; countersignatures from `{w_a, w_b}` are members of both sets, so a set-membership check passes, a `profile_version` check would fail, and only the latter catches the drift. Systems that check "are the present witnesses a subset of the required set" pass; systems that check "is the witness set that produced these countersignatures the one named by `profile_version`" fail closed correctly. ## Condition of Validity The drift is only reachable when all of the following hold simultaneously, which is why it is rare and under-tested: 1. The credential is **re-issued with a stable `credential_id`** across a profile rotation (common when issuers treat rotation as a metadata update rather than a new credential). 2. The witness sets before and after rotation **overlap by at least the threshold** (2-of-3 → 2-of-3 with one swap overlaps by 2). Full disjoint rotation is caught by any set-membership check; overlap is what hides the drift. 3. The callee's admission logic validates **countersignature presence and threshold** but does not bind the countersignatures to the `profile_version` that was current when they were collected. 4. The handoff window is longer than the rotation interval — i.e., the caller's task outlives a profile change. Remove any one condition and the failure is bounded: a fresh `credential_id` forces re-admission; disjoint sets fail membership; version-binding catches it at verify time; short tasks never straddle a rotation. ## Decision Boundary The boundary is whether the callee treats admission as a **point-in-time predicate over credential bytes** or as a **predicate over (credential, witness-policy-version) pairs that must be re-established at each trust boundary crossing**. The first is the naive and common design. The second is required. Concretely, the callee must, at every handoff: - Re-fetch the AAIF profile and record `profile_version` at admission time into the session warrant. - Require that every presented countersignature carries the `profile_version` it was collected under, and reject any countersignature whose `profile_version` differs from the *current* one — **even if the witness identity is still valid**. A valid witness signing under a retired policy version is not a valid attestation for the current policy. - Treat `profile_version` bump as a **re-admission event**: the caller must re-collect countersignatures, not merely re-present the old ones. The subtle part: a witness being *still trusted* does not mean its *old countersignature* is still admissible. Trust in the witness and admissibility of a specific attestation are different predicates, and conflating them is exactly the drift. ## Operational Effect Without the version-binding invariant, the system exhibits **silent policy regression**: after a rotation that retires a compromised witness, callers holding pre-rotation countersignatures continue to be admitted for the remainder of their task lifetime, and any new handoff they perform propagates the stale attestation downstream. The security property that motivated the rotation (revoking `w_c`) is not enforced on in-flight sessions, and the blast radius is every downstream agent reachable from the stale caller. The failure is invisible in logs because every signature verifies and every threshold is met — the only signal is a `profile_version` mismatch that the naive checker never computes. With the invariant, rotation becomes a hard re-admission barrier: in-flight callers must re-collect countersignatures at their next handoff or fail closed. The cost is a re-attestation round-trip per rotation; the benefit is that witness revocation is actually enforced at the boundary where it matters. ## Operational Effect on Replay and Audit A second-order effect: replay-based auditors that re-verify a recorded handoff against the *current* AAIF profile will disagree with the live decision made at handoff time if the profile rotated between the handoff and the audit. The audit record must therefore pin `profile_version` (and ideally the full witness-set snapshot hash) alongside the countersignatures, or the auditor cannot reconstruct which policy the callee actually applied. Without this, post-hoc verification produces false "should have been rejected" findings — or worse, false "was correctly admitted" findings when the live callee was actually running the stale policy. ```python import hashlib from dataclasses import dataclass class WitnessPolicyDriftError(RuntimeError): """Raised when a presented attestation was collected under a witness-policy version that no longer matches the AAIF profile current at handoff time.""" @dataclass(frozen=True) class Countersignature: witness_id: str profile_version: int sig_bytes: bytes @dataclass(frozen=True) class AAIFProfile: credential_id: str profile_version: int witness_set: frozenset threshold: int def snapshot_hash(self) -> str: material = f"{self.credential_id}:{self.profile_version}:" \ f"{','.join(sorted(self.witness_set))}:{self.threshold}" return hashlib.sha256(material.encode()).hexdigest() def admit_handoff( presented: list, current_profile: AAIFProfile, admitted_profile_version: int, ) -> None: # Invariant 1: the witness policy must not have rotated since admission. if current_profile.profile_version != admitted_profile_version: raise WitnessPolicyDriftError( f"witness policy rotated mid-session: admitted under " f"profile_version={admitted_profile_version}, current=" f"{current_profile.profile_version}; re-admission required" ) # Invariant 2: every countersignature must be bound to the current version, # not merely produced by a currently-trusted witness. for cs in presented: if cs.profile_version != current_profile.profile_version: raise WitnessPolicyDriftError( f"countersignature from {cs.witness_id} collected under " f"profile_version={cs.profile_version}, expected " f"{current_profile.profile_version}; stale attestation" ) if cs.witness_id not in current_profile.witness_set: raise WitnessPolicyDriftError( f"witness {cs.witness_id} not in current witness set" ) distinct = {cs.witness_id for cs in presented} if len(distinct) < current_profile.threshold: raise WitnessPolicyDriftError( f"threshold not met: {len(distinct)} < {current_profile.threshold}" ) def handle_handoff(presented, current_profile, admitted_profile_version): admit_handoff(presented, current_profile, admitted_profile_version) return {"admitted": True, "policy_snapshot": current_profile.snapshot_hash()} ```