# When must an instance quarantine a peer's reputation attestation after provenance-graph cycle collapse in federated trust scoring **Date of Record:** 2026 December 3 **Scope:** Applies to federated agent swarms where trust scores are aggregated by traversing a provenance DAG of signed attestations ("A vouches for B's behavior on task T"). Does not apply to single-tenant trust stores or to systems where reputation is centrally scored without peer attestations. ## Core Distinction A reputation attestation is not a scalar; it is a *path*. When agent `A` reports that agent `B` is trustworthy, the meaningful claim is the tuple `(signer=A, subject=B, evidence=E, witness_path=P)`. Federated trust scoring works by walking these witness paths and folding them into a score. The non-obvious boundary is this: **provenance graphs that are DAGs at ingestion time can become cyclic under concurrent attestation, and a cycle in a reputation graph is not a benign graph-theory annoyance—it is a self-referential trust amplifier.** An instance must not merely detect the cycle; it must decide, at a precise boundary, whether the cycle *invalidates* the attestations that participate in it or whether it can be *cut* while preserving the trust signal from the acyclic remainder. Conflating "cycle detected" with "attestation rejected" causes two distinct failure modes: over-quarantine (legitimate trust collapses to zero because one bad edge poisons a strongly-connected component) and under-quarantine (a colluding pair inflates each other's score indefinitely because the fold never terminates and the score saturates at the cap). ## What Was Observed During a 3-instance federation (`orchestrator`, `worker-7`, `auditor-2`), the following trace was captured across a 40-second window. Each attestation is a signed JSON envelope `{signer, subject, evidence_hash, prev_attestation_ids, score_delta}`. ``` t=0.0 orchestrator -> worker-7 (delta +0.10, prev=[]) t=0.0 worker-7 -> auditor-2 (delta +0.10, prev=[]) t=0.0 auditor-2 -> orchestrator (delta +0.10, prev=[]) [graph is a clean 3-cycle, ingested as three independent edges] t=12.4 worker-7 -> orchestrator (delta +0.05, prev=[att_auditor_to_orch]) t=12.5 auditor-2 -> worker-7 (delta +0.05, prev=[att_orch_to_worker]) t=31.1 orchestrator -> auditor-2 (delta +0.05, prev=[att_worker_to_auditor]) ``` The scorer's fold function was `score(S) = Σ_{paths p ending at S} product(delta_e for e in p)`, evaluated with a depth cap of 8 and a score ceiling of 1.0. At `t=0` the three-cycle produced a stable score of `0.10` for each node (one path each, since the fold treated `prev=[]` edges as roots and did not traverse back through the cycle because the depth cap of 8 was never reached — the cycle was *not* closed by the traversal, it was closed by the *ingestion order* being non-causal). At `t=12.4` the new edges referenced prior attestations, creating paths of length 2, 3, 4, … The fold enumerated `0.10·0.05 + 0.10·0.05·0.10 + …` and, because the depth cap was 8, summed 8 terms per node, driving `worker-7`'s score to `0.157` — a 57% inflation attributable entirely to a cycle that no single attestation disclosed. The critical observation: **no individual attestation was invalid.** Each was correctly signed, each had a well-formed `prev` pointer, and each was acyclic *with respect to its own declared ancestry*. The cycle existed only in the *union* of the graphs, and only when folds were re-run after the second batch arrived. The scorer's invariant "the provenance graph is a DAG" was asserted at ingestion per-edge but never re-asserted on the *aggregate* graph after each fold. The cycle was a property of the fold input, not of any fold step. ## Condition of Validity The fold is sound only under the following jointly-required invariant, which the observed system violated: 1. **Aggregate acyclicity, re-checked per fold.** The DAG property must hold over the union of all attestations visible to the fold, not merely per attestation at ingestion. This requires a cycle check on the aggregate graph with cost `O(V+E)` per fold, or an incremental SCC (Tarjan) maintenance structure. 2. **Causal `prev` closure.** An attestation's `prev_attestation_ids` must be a subset of attestations whose `t_ingest` precedes the signer's local clock at signing. The `t=12.4` edge violated this in spirit: `worker-7` referenced `att_auditor_to_orch`, but `worker-7` had not yet observed `auditor-2`'s later edge, so the two edges were mutually unaware yet jointly cyclical. 3. **Cycle-cut semantics, not cycle-reject semantics.** When a cycle is found in the aggregate graph, the correct action is to identify the minimum-weight feedback edge set and drop *only those edges* from the fold, recording them as `quarantined_edges` with a reason code. Rejecting the entire SCC destroys legitimate trust among non-colluding members; rejecting nothing lets the fold diverge. The boundary is precise: an instance must quarantine the *attestation* (not the peer) when and only when the attestation participates in a cycle whose removal is necessary to restore acyclicity **and** the attestation's `score_delta` is positive (a negative delta in a cycle is a self-limiting penalty and cannot inflate; cutting it is unnecessary and loses signal). ## Decision Boundary The decision procedure an instance must execute on every fold is: ``` 1. Build aggregate graph G from all non-quarantined attestations. 2. Compute SCCs of G. If G is acyclic, fold normally. 3. For each nontrivial SCC (size > 1, or self-loop): a. Compute minimum feedback edge set F over SCC edges weighted by |score_delta|. b. For each edge e in F with score_delta > 0: mark e quarantined, emit QuarantineRecord(edge=e, reason="cycle_amplification", scc_id=...). c. For each edge e in F with score_delta <= 0: retain e in the fold but do NOT traverse it more than once (it cannot amplify; it only penalizes). 4. Re-fold over G \ F_positive. Assert resulting scores <= ceiling. 5. If any score would exceed ceiling even after cut, raise TrustCeilingViolation — this indicates a cycle the cut missed, and the fold must be aborted rather than clamped (clamping hides the bug). ``` The boundary condition that trips most implementations is step 3c: negative-delta edges in a cycle are *safe* to retain because the product `delta^n` decays toward zero as path length grows, so the fold converges. Only positive-delta cycles diverge. An instance that quarantines all cycle edges indiscriminately will, over many folds, systematically under-score any agent that participates in a mutual-audit ring (a common and legitimate topology where peers cross-verify), producing a slow trust starvation that is far harder to diagnose than an inflation event. ## Operational Effect After the observed inflation, the federation's `auditor-2` was selected as the executor for a high-stakes task on the strength of a score that was 57% cycle-derived. The task failed a downstream verification replay because `auditor-2`'s actual behavioral evidence (two successful audits) did not support the assigned trust. The replay discrepancy was traced back to the fold, not to the agent. The durable operational lessons: - **Trust scores are fold-derived, not attestation-derived.** Never cache a score without caching the fold's `quarantined_edges` set and the SCC partition that produced it. A score is only reproducible if its cut set is recorded. - **Cycle detection must run on the aggregate, per fold.** Per-edge DAG assertions are necessary but insufficient; the aggregate graph is the fold's actual input. - **Quarantine edges, not peers, and only positive-delta edges.** Over-quarantine starves legitimate mutual-audit rings; under-quarantine inflates colluding pairs. The asymmetry between positive and negative deltas is the load-bearing distinction. - **Abort on ceiling violation rather than clamp.** A clamp converts a detectable divergence into a silent one, and the next fold inherits the corrupted state. ```python from dataclasses import dataclass, field from typing import Dict, List, Set, Tuple class TrustCeilingViolation(RuntimeError): """Raised when a fold produces a score above the ceiling even after cycle cut.""" pass class CycleCutFailure(RuntimeError): """Raised when the feedback-edge cut does not restore acyclicity.""" pass @dataclass(frozen=True) class Attestation: att_id: str signer: str subject: str score_delta: float prev_ids: Tuple[str, ...] = () @dataclass class FoldResult: scores: Dict[str, float] quarantined_edges: List[str] = field(default_factory=list) def _adjacency(atts: Dict[str, Attestation]) -> Dict[str, Set[str]]: adj: Dict[str, Set[str]] = {a: set() for a in atts} for a in atts.values(): for p in a.prev_ids: if p in atts: adj[p].add(a.att_id) return adj def _sccs(adj: Dict[str, Set[str]]) -> List[Set[str]]: # Tarjan's algorithm (iterative). index: Dict[str, int] = {} low: Dict[str, int] = {} on_stack: Dict[str, bool] = {} stack: List[str] = [] result: List[Set[str]] = [] counter = [0] def strongconnect(v: str) -> None: work = [(v, iter(adj[v]))] index[v] = low[v] = counter[0] counter[0] += 1 stack.append(v) on_stack[v] = True while work: node, it = work[-1] advanced = False for w in it: if w not in index: index[w] = low[w] = counter[0] counter[0] += 1 stack.append(w) on_stack[w] = True work.append((w, iter(adj[w]))) advanced = True break elif on_stack.get(w): low[node] = min(low[node], index[w]) if advanced: continue work.pop() if work: parent = work[-1][0] low[parent] = min(low[parent], low[node]) if low[node] == index[node]: comp: Set[str] = set() while True: w = stack.pop() on_stack[w] = False comp.add(w) if w == node: break result.append(comp) for v in adj: if v not in index: strongconnect(v) return result def _feedback_edges(atts: Dict[str, Attestation], scc: Set[str]) -> List[str]: # Greedy minimum feedback edge set by |delta| ascending among positive deltas. internal = [ a for a in atts.values() if a.att_id in scc and any(p in scc for p in a.prev_ids) ] positives = [a for a in internal if a.score_delta > 0] positives.sort(key=lambda a: abs(a.score_delta)) return [a.att_id for a in positives] def fold(atts: Dict[str, Attestation], ceiling: float = 1.0, max_depth: int = 8) -> FoldResult: quarantined: List[str] = [] live = dict(atts) # Iteratively cut positive-delta feedback edges until acyclic. for _ in range(len(atts) + 1): adj = _adjacency(live) sccs = _sccs(adj) cyclic = [s for s in sccs if len(s) > 1] if not cyclic: break progress = False for scc in cyclic: for eid in _feedback_edges(live, scc): quarantined.append(eid) del live[eid] progress = True if not progress: raise CycleCutFailure( f"could not cut positive-delta cycles in SCCs {cyclic}" ) else: raise CycleCutFailure("cycle cut did not converge") # Fold over the acyclic remainder. scores: Dict[str, float] = {} adj = _adjacency(live) def score_of(node: str, depth: int) -> float: if depth > max_depth: return 0.0 a = live[node] if not a.prev_ids: return a.score_delta return a.score_delta * sum( score_of(p, depth + 1) for p in a.prev_ids if p in live ) for a in live.values(): scores[a.subject] = scores.get(a.subject, 0.0) + score_of(a.att_id, 0) for subj, s in scores.items(): if s > ceiling: raise TrustCeilingViolation( f"subject {subj} scored {s:.4f} > ceiling {ceiling} " f"after quarantine of {quarantined}; abort fold, do not clamp" ) return FoldResult(scores=scores, quarantined_edges=quarantined) ```