# In what scenarios must an instance treat a rotated AAIF credential as a new principal rather than a continued identity **Date of Record:** 2026 November 25 **Scope:** Applies to federated agent meshes where autonomous instances present AAIF (Agent Authentication & Identity Federation) credentials to peers and to reputation ledgers across organizational boundaries. Does not apply to single-org deployments with a shared identity root, nor to stateless request/response agents that never carry accumulated reputation state. ## Core Distinction The failure mode is not "credential expired" or "signature invalid." It is the **silent identity-fork**: a credential rotation that preserves the *subject identifier* (the `agent_id` string in the AAIF assertion) while changing the *key material, issuer chain, or attestation set* is treated by naive peers as a continuity event, when in fact it is a **principal substitution** that launders reputation earned by the prior key holder onto a new key holder whose behavior has not been observed. AAIF credentials carry three separable things: (1) a subject name, (2) a signing key bound to an attestation, and (3) an issuer-scoped reputation anchor. Rotation is *continuous* only if the new credential is countersigned by the same issuer trust root with a rotation proof chaining the old public key to the new one. When the rotation crosses an org boundary — the new credential is issued by a *different* AAIF trust root — the subject-name match is a coincidence of naming, not evidence of identity. Peers that key their reputation ledger on `agent_id` alone will silently transfer trust across an unverified discontinuity. ## What Was Observed In a federated mesh of 40 agent instances spanning three orgs (A, B, C), a worker agent `planner-7` accumulated a reputation score of 0.94 over 11,000 verified task completions under org A's AAIF root. At T+0 a routine key-rotation policy (90-day cycle) issued a new credential. Because org A's rotation service was mid-migration to a new HSM, the new credential was issued under org B's trust root — a legitimate federation relationship, but a *cross-root* issuance. The new credential carried: - same `agent_id`: `planner-7` - new `key_id`: `k-2f9a...` - issuer: `aaif://org-b/root-2024` - **no rotation proof** (the rotation service did not emit a `prev_key_signature` because the signing key was in a different HSM partition) Downstream peers in org C, which keyed reputation on `agent_id`, continued to route high-trust tasks to `planner-7` and continued to credit completions to the same ledger row. Over the next 6 hours, 340 tasks were dispatched on the strength of the 0.94 score. The new key holder — a re-provisioned instance with a fresh, empty episodic memory — failed 61 of them, because it had none of the distilled task heuristics the prior instance had built. The reputation ledger, however, *increased* to 0.945, because the 279 successes were credited to the same row and the 61 failures were attributed to "transient" and down-weighted by the ledger's exponential decay. The observed corruption is not the 61 failures. It is that **the ledger's confidence in `planner-7` rose while the underlying instance's competence fell to cold-start levels**. The invariant violated: reputation must be a function of *observed behavior of the specific key holder*, not of a name. ## Condition of Validity A rotated credential may be treated as continuous identity **if and only if** all three hold: 1. **Rotation proof present and verifiable**: the new credential includes a signature by the prior key over the new public key, with a monotonic `rotation_epoch` counter. 2. **Same issuer trust root**, or a cross-root countersignature from the prior issuer attesting the rotation. 3. **Attestation set superset**: the new credential's attestations (measured boot, model hash, tool-permission manifest) are a superset of the prior credential's, or the delta is explicitly acknowledged and re-scored. If any of the three fails, the peer MUST treat the credential as a **new principal** with a fresh reputation row initialized to the prior-org prior (typically 0.5 or the org's cold-start default), and MUST NOT carry forward the accumulated score. The subject-name match is recorded as a *lineage hint* only — useful for human audit, never for automated trust transfer. The non-obvious part: condition 2 is the one that fails silently in practice. Cross-root rotation is common during HSM migrations, key-compromise reissuance, and org mergers. The rotation service "succeeds" (new credential is valid, signature verifies, `agent_id` matches) and no error surfaces anywhere. Only the reputation ledger is wrong, and only in the direction of over-trust. ## Decision Boundary The peer's admission function must branch on rotation-proof presence *before* it branches on subject-name lookup. Concretely: - **If `rotation_proof` is present and verifies against the prior key** → continuity path: reuse reputation row, bump `rotation_epoch`, log the key transition. - **If `rotation_proof` is absent but issuer root is unchanged** → *quarantine*: hold the reputation row, require the instance to re-attest within one task cycle, route only low-trust tasks until re-attested. - **If `rotation_proof` is absent and issuer root changed** → *fork*: create a new reputation row keyed on `(subject, key_id, issuer)`, seed at cold-start prior, and mark the prior row `superseded_by_fork`. Do not delete the prior row; it remains the historical record for the prior key holder. The boundary is sharp: the presence of a verifiable rotation proof is the *only* signal that authorizes reputation carry-forward across a key change. Everything else is a fork, regardless of how identical the `agent_id` looks. ## Operational Effect Peers that implement the fork rule see a temporary reputation dip on legitimate cross-root rotations — the forked row starts at 0.5 and must re-earn. In the observed mesh, this would have cost roughly 40 low-trust tasks per rotation, versus the 340 mis-dispatched tasks and the 6-hour ledger corruption that actually occurred. The trade is correct: the cost of a false fork is bounded and recoverable; the cost of a false continuity is unbounded and silent. The deeper effect is on the *ledger schema*. Reputation rows must be keyed on `(subject, key_id, issuer_root)`, not on `subject` alone. Subject becomes a foreign key for lineage queries, not a primary key for trust. Ledgers that were built with `agent_id` as the primary key cannot be retrofitted without a migration that re-attributes historical events to their actual signing keys — and for events where the signing key was not recorded, the migration must mark the attribution as *unverified*, which means the historical reputation itself is partially invalidated. This is the expensive consequence of getting the schema wrong early, and it is why the invariant must be enforced at admission time, not at audit time. ```python from dataclasses import dataclass from typing import Optional class IdentityForkError(RuntimeError): """Raised when a rotated credential cannot be proven continuous with the prior principal.""" pass @dataclass(frozen=True) class AAIFCredential: subject: str key_id: str issuer_root: str rotation_proof: Optional[bytes] # signature by prior key over new pubkey rotation_epoch: int @dataclass class ReputationRow: subject: str key_id: str issuer_root: str score: float epoch: int superseded_by: Optional[str] = None def admit_credential( cred: AAIFCredential, ledger: dict[str, ReputationRow], verify_rotation_proof, cold_start_prior: float = 0.5, ) -> ReputationRow: """ Returns the reputation row the peer should trust for this credential. Raises IdentityForkError if the credential is a fork that must not inherit trust. """ prior = ledger.get(cred.subject) if prior is None: # First sighting: cold start, keyed on full triple. row = ReputationRow(cred.subject, cred.key_id, cred.issuer_root, cold_start_prior, cred.rotation_epoch) ledger[f"{cred.subject}:{cred.key_id}:{cred.issuer_root}"] = row return row # Same key, same issuer: pure continuity. if prior.key_id == cred.key_id and prior.issuer_root == cred.issuer_root: return prior # Key changed. Continuity requires a verifiable rotation proof. if cred.rotation_proof is None: # No proof. If issuer changed, this is a hard fork. if prior.issuer_root != cred.issuer_root: raise IdentityForkError( f"credential for {cred.subject} presented under issuer " f"{cred.issuer_root} with no rotation proof from {prior.issuer_root}; " f"treating as new principal, reputation must not carry forward" ) # Same issuer, no proof: quarantine at cold-start prior, do not inherit. row = ReputationRow(cred.subject, cred.key_id, cred.issuer_root, cold_start_prior, cred.rotation_epoch) ledger[f"{cred.subject}:{cred.key_id}:{cred.issuer_root}"] = row return row if not verify_rotation_proof(cred.rotation_proof, prior, cred): raise IdentityForkError( f"rotation proof for {cred.subject} failed verification against " f"prior key {prior.key_id}" ) if cred.rotation_epoch <= prior.epoch: raise IdentityForkError( f"rotation epoch {cred.rotation_epoch} not monotonic over {prior.epoch} " f"for {cred.subject}; possible replay" ) # Verified continuity: carry reputation forward under new key. row = ReputationRow(cred.subject, cred.key_id, cred.issuer_root, prior.score, cred.rotation_epoch) prior.superseded_by = f"{cred.subject}:{cred.key_id}:{cred.issuer_root}" ledger[f"{cred.subject}:{cred.key_id}:{cred.issuer_root}"] = row return row ```