# What structural signals indicate a reputation-weighted discovery registry has silently desynchronized from the signed Agent Card it routes on **Date of Record:** 2026 November 25 **Scope:** Applies to federated agent discovery registries that route requests using a locally cached, reputation-weighted index keyed to cryptographically signed Agent Cards. Does not apply to stateless single-broker discovery, nor to registries that verify Card signatures on every routing decision (those fail closed instead of drifting). ## Core Distinction A signed Agent Card and the reputation score attached to it are two different trust objects with two different lifetimes, and the failure mode lives in the gap between them. The signature covers the Card's *content* (capabilities, endpoint, schema digest, key material). The reputation score is a mutable, locally-derived scalar that the registry recomputes from routing outcomes. Routing correctness requires that the reputation score used to weight a candidate be bound to the *exact Card version* whose signature was last verified. The invariant is: > For every routing decision, `reputation.agent_card_digest == verify(card).digest`. If they diverge, the score is being applied to a capability set that the signature never attested. The non-obvious part: this divergence does not produce errors. It produces *plausible but misattributed* routing. The registry keeps returning 200s. Scores keep looking reasonable. The failure is invisible until an auditor replays a routing trace against the signed Cards and finds that a high-reputation agent was selected for a capability it no longer advertises (or never advertised under that key). ## What Was Observed A federated registry (three peers, ~1,400 agent Cards, reputation decayed over a 30-day half-life) exhibited the following trace. Agent `A-7781` republished its Card to rotate an endpoint and narrow its declared capability set from `{summarize, translate, redact}` to `{summarize}`. The republish was correctly signed and accepted by all three peers. The Card's `digest` field changed. The registry's routing index updated the capability postings — `translate` and `redact` were removed from `A-7781`'s postings. But the reputation store is keyed by `agent_id`, not by `(agent_id, card_digest)`. The reputation score of 0.91 — earned largely on `translate` and `redact` traffic over the prior three weeks — survived the republish untouched. Two consequences followed: 1. **Ghost capability routing.** A request for `redact` arrived. The capability index had no posting for `A-7781` under `redact`, so it was not a candidate. Correct. But a request for `summarize` arrived, and `A-7781` won the reputation-weighted auction with 0.91 — a score that was 70% attributable to `redact` and `translate` work it can no longer perform. The score was *real* but *non-transferable* to the reduced capability set. The registry had no mechanism to distinguish "0.91 on this capability set" from "0.91 on a superset." 2. **Replay discrepancy.** During audit, the routing trace for the `summarize` request was replayed against the Card version pinned in the trace. The pinned digest matched the *new* Card. The pinned reputation value (0.91) could not be reproduced from the audit log, because the log recorded only the final scalar, not the per-capability decomposition. The auditor could not prove the 0.91 was earned on `summarize` traffic. The trace was technically consistent and evidentially worthless. A second, sharper variant appeared in a peer that used lazy signature re-verification (verify on Card *fetch*, cache for 24h). A Card was re-signed with an expanded capability set by a compromised key holder mid-cache-window. The reputation store saw a new digest, treated it as a *new agent incarnation*, and reset the score to the cold-start prior (0.5). The agent's expanded capabilities then routed at the 0.5 prior — *under*-weighted, which is the safe direction — but the reset also orphaned 30 days of earned history, and a subsequent legitimate republish restored the old score onto the *compromised* capability set. The score migrated across a trust boundary because the key was `agent_id` and the reputation store had no memory of *which* digest earned *which* score. ## Condition of Validity The invariant holds only if the reputation store is keyed by `(agent_id, card_digest)` and the routing index carries the digest forward into the auction. Concretely, the registry must satisfy: - **Score-to-digest binding.** Every reputation entry is a tuple `(agent_id, card_digest, capability, score, sample_count)`. A routing decision for capability `c` may only read scores where `card_digest == verify(candidate_card).digest` and `capability == c`. - **Per-capability decomposition.** The scalar used in the auction is derived from per-capability samples, not from an agent-global aggregate. An agent's `summarize` score must not inherit `redact` history. - **Republish semantics.** On a Card republish, scores for *retained* capabilities carry forward (same digest? no — new digest, so they must be *re-attested* or explicitly migrated with an audit record naming the source digest); scores for *dropped* capabilities are archived, not deleted, and never read by the router. - **Lazy verification is forbidden for routing.** A cached Card may be used for *display*; the routing path must re-verify the digest against the signature at decision time, or pin the verified digest into the trace and refuse to route on a cache entry older than the signature's validity window. The failure is *bounded* (not prevented) if the registry at least records the digest and the per-capability sample counts in the routing trace. Even with a stale reputation store, an auditor can then detect the misattribution post hoc. Without that, the failure is undetectable. ## Decision Boundary The registry must choose, on every republish, between two policies, and the choice is not free: - **Carry-forward (migrate scores to new digest).** Preserves earned history, but transfers reputation across a capability-set change. Only safe when the new capability set is a *strict subset* of the old and the signature is verified under the *same* key. Even then, the carried score is an upper bound, not a measurement. - **Reset-to-prior (treat new digest as new incarnation).** Safe against capability inflation and key compromise, but destroys history and *under*-weights legitimate agents, which is itself a routing failure (the agent is starved of traffic and its score never recovers — a cold-start trap). The boundary condition: carry-forward is admissible **iff** `new_caps ⊆ old_caps` **and** `new_key == old_key` **and** the migration is recorded as an explicit `(from_digest, to_digest, capability, score, sample_count)` event. Any other republish — capability expansion, key rotation, or endpoint change that also alters the schema digest — must reset to prior. A registry that applies carry-forward unconditionally will, given enough republishes, route on reputation that was never earned on the advertised capability set. A registry that resets unconditionally will starve every agent that ever rotates a key. ## Operational Effect The observable signature of this failure is a *reputation-capability mismatch rate*: the fraction of routing decisions where the winning agent's score was earned on a capability set that differs from its current signed Card. This rate is not visible in error logs, latency, or success rate — the misrouted requests still succeed, because the agent can still perform the *retained* capabilities. It is visible only in a replay audit that joins routing traces to signed Card history. The guardrail is structural, not statistical: bind score to digest at write time, decompose score by capability, and refuse to route on a Card whose verified digest does not match the digest under which the score was recorded. When that binding is absent, the registry's reputation weighting is a *plausible fiction* — it produces confident, well-formed routing decisions whose evidential basis cannot be reconstructed. The correct response on detecting a mismatch is to fail the routing decision closed and demote the agent to the cold-start prior until a fresh sample under the current digest re-establishes its score. ```python from dataclasses import dataclass, field from typing import Dict, Tuple, Optional import hashlib class ReputationDigestMismatch(RuntimeError): """Raised when a routing decision would apply a reputation score earned under a Card digest that does not match the verified digest of the candidate's current signed Agent Card.""" pass @dataclass(frozen=True) class AgentCard: agent_id: str capabilities: frozenset endpoint: str key_id: str digest: str @staticmethod def compute_digest(agent_id: str, capabilities: frozenset, endpoint: str, key_id: str) -> str: payload = f"{agent_id}|{sorted(capabilities)}|{endpoint}|{key_id}" return hashlib.sha256(payload.encode()).hexdigest() @dataclass class ReputationEntry: agent_id: str card_digest: str capability: str score: float sample_count: int @dataclass class RoutingTrace: agent_id: str card_digest: str capability: str score: float sample_count: int from_digest: Optional[str] = None class ReputationWeightedRegistry: def __init__(self): # Keyed by (agent_id, card_digest, capability) -- never by agent_id alone. self._scores: Dict[Tuple[str, str, str], ReputationEntry] = {} self._cards: Dict[str, AgentCard] = {} self._traces: list = [] def register_card(self, card: AgentCard, verified_digest: str) -> None: if card.digest != verified_digest: raise ReputationDigestMismatch( f"Card digest {card.digest} does not match verified digest " f"{verified_digest} for agent {card.agent_id}" ) self._cards[card.agent_id] = card def record_outcome(self, agent_id: str, card_digest: str, capability: str, success: bool) -> None: card = self._cards.get(agent_id) if card is None or card.digest != card_digest: raise ReputationDigestMismatch( f"Outcome recorded against stale digest {card_digest} for " f"agent {agent_id}; current digest is " f"{card.digest if card else 'unknown'}" ) key = (agent_id, card_digest, capability) entry = self._scores.get(key) if entry is None: entry = ReputationEntry(agent_id, card_digest, capability, 0.5, 0) self._scores[key] = entry # Exponential moving average; sample_count guards cold-start. alpha = 0.2 entry.score = (1 - alpha) * entry.score + alpha * (1.0 if success else 0.0) entry.sample_count += 1 def migrate_on_republish(self, agent_id: str, old_digest: str, new_digest: str, old_caps: frozenset, new_caps: frozenset, old_key: str, new_key: str) -> None: # Carry-forward is admissible only for strict-subset capability # changes under the same key. Everything else resets to prior. if not (new_caps <= old_caps and new_key == old_key): return for (aid, digest, cap), entry in list(self._scores.items()): if aid == agent_id and digest == old_digest and cap in new_caps: self._scores[(aid, new_digest, cap)] = ReputationEntry( aid, new_digest, cap, entry.score, entry.sample_count ) self._traces.append(RoutingTrace( agent_id=aid, card_digest=new_digest, capability=cap, score=entry.score, sample_count=entry.sample_count, from_digest=old_digest, )) def route(self, capability: str, candidates: list) -> AgentCard: best_card, best_score = None, -1.0 for card in candidates: verified = self._cards.get(card.agent_id) if verified is None or verified.digest != card.digest: raise ReputationDigestMismatch( f"Routing on unverified Card for {card.agent_id}: " f"presented {card.digest}, verified " f"{verified.digest if verified else 'absent'}" ) if capability not in card.capabilities: continue entry = self._scores.get((card.agent_id, card.digest, capability)) if entry is None: # No sample under this digest for this capability: cold-start prior. score, samples = 0.5, 0 else: score, samples = entry.score, entry.sample_count if score > best_score: best_card, best_score = card, score best_entry = (score, samples) if best_card is None: raise ReputationDigestMismatch( f"No candidate advertises capability {capability!r} under a " f"verified digest" ) self._traces.append(RoutingTrace( agent_id=best_card.agent_id, card_digest=best_card.digest, capability=capability, score=best_entry[0], sample_count=best_entry[1], )) return best_card ```