Which invariants prevent cross-org reputation score laundering from poisoning A2A task routing

**Date of Record:** 2026 December 1 **Scope:** Applies to multi-org agent meshes where a router selects a downstream agent based on a reputation score that is aggregated from peer attestations across organizational trust boundaries (A2A-style task handoff with signed warrants). Does not apply to single-tenant deployments where all agents share one signing root and one reputation ledger, nor to purely capability-based routing that ignores historical trust.

Core Distinction

The failure is not "a malicious agent lies about its own score." Signed attestations prevent that. The failure is **reputation laundering via transitive attestation cycles across org boundaries**: agent A (org X) receives a genuine positive attestation from agent B (org Y) for a trivial task, then A issues a positive attestation for B on a different trivial task, and both scores are aggregated by a router in org Z that cannot distinguish a mutual-admiration pair from two independently-verified competent agents. The invariant that breaks is **attestation independence**: the router assumes that a score of *n* reflects *n* independent observations, when in fact the graph structure allows *n* attestations to collapse into a single Sybil component with effective weight 1.

The distinction from ordinary collusion is the *cross-org* dimension. Within one org, a reputation ledger owner can detect cycles by graph analysis on a single canonical ledger. Across orgs, each org maintains its own ledger, and the router sees only the *exported* scores—already aggregated, already stripped of the attestation graph. The router cannot re-derive independence because it never sees the edges.

What Was Observed

A three-org mesh: org X (planner), org Y (executor pool), org Z (auditor). The router in X selects executors from Y based on a reputation score `R(a)` exported by Y's ledger, which Y computes as a weighted sum of inbound attestations. Y's export API returns `{agent_id, score, sample_count}` but not the attestation graph.

Trace of the laundering:

  1. Agent `y1` and `y2` in org Y are both controlled by the same operator (a legitimate multi-agent deployment, not malicious—this matters, see Condition of Validity).
  2. `y1` performs a real task for `y2`; `y2` attests `+1` to `y1`. `y2` performs a real task for `y1`; `y1` attests `+1` to `y2`. Both attestations are cryptographically valid and factually true.
  3. The pair repeats this 40 times over a week with trivial tasks (each under 200ms, well within the "task completed" attestation threshold).
  4. Y's ledger now reports `R(y1) = R(y2) ≈ 0.95, sample_count = 40` for both.
  5. Router in X, seeing `sample_count = 40`, computes a confidence interval assuming 40 independent Bernoulli trials and routes a high-stakes task to `y1` with a narrow expected-error bound.
  6. `y1` fails the high-stakes task. The router's calibration is off by roughly the ratio of effective-to-nominal sample size—here 40:1.

The observed symptom was not a single dramatic failure but **silent miscalibration**: the router's predicted success probability for `y1` was 0.94; the empirical rate over the next 30 high-stakes tasks was 0.61. The gap is exactly what you'd expect if `sample_count` overstates independent evidence.

Condition of Validity

The laundering requires all of the following to hold simultaneously:

Remove any one and the attack degrades. If the router sees edges, it can require attestation-graph independence (no shared operator, no cycle). If attestation weight scales with task difficulty and difficulty is verified by the *requesting* org (X, not Y), cheap tasks contribute little. If attestations require a cross-org witness, the pair needs a third party who will notice the pattern.

Critically: **this is not always adversarial.** A legitimate multi-agent deployment in Y (a swarm of cooperating agents) will naturally produce dense intra-swarm attestation. The router cannot tell a healthy swarm from a colluding pair by score alone. The invariant must hold regardless of intent.

Decision Boundary

The router must decide, per candidate agent, whether to trust the exported `sample_count` as an independence proxy. The boundary is:

The non-obvious part: the discount factor depends on the *number of distinct attestation keys*, which the export API must expose even if it doesn't expose edges. A score of `(0.95, n=40, distinct_keys=1)` and `(0.95, n=40, distinct_keys=12)` are not the same evidence, and the router that treats them identically is the one that gets poisoned.

Operational Effect

The invariant required is: **a reputation score is only as strong as its independent-attestation count, and independence cannot be inferred from sample count alone when attestations cross an org boundary.** The operational consequence is that every cross-org reputation export must carry a `distinct_attester_keys` field (or equivalent), and the router must apply an effective-sample-size discount before computing any confidence bound used for routing.

Without this, the router's calibration drifts as the mesh grows: as more orgs join and more intra-org swarms form, the fraction of `sample_count` that is redundant rises, and the router's predicted-vs-empirical gap widens silently until high-stakes routing failure rates cross an operational threshold. The failure is invisible in per-agent metrics (each agent looks fine) and only appears in aggregate calibration, which is why it persists.

The guardrail is cheap to implement (one extra field, one discount formula) and expensive to retrofit (you must re-derive `n_eff` for every historical score, and you cannot, because the edges were never exported). Export the independence signal at attestation time or lose the ability to recover it.

import math
from dataclasses import dataclass


class ReputationLaunderingError(RuntimeError):
    """Raised when a cross-org reputation export cannot support the
    confidence required for a high-stakes A2A route."""


@dataclass(frozen=True)
class ReputationExport:
    agent_id: str
    score: float            # in [0, 1]
    sample_count: int       # nominal attestation count
    distinct_attester_keys: int  # MUST be exported; 0 means unknown


def effective_sample_size(export: ReputationExport) -> float:
    """Pessimistic n_eff under worst-case clustering.

    If all attestations share one key, n_eff collapses to 1. As the number
    of distinct keys approaches sample_count, n_eff approaches sample_count.
    """
    n = export.sample_count
    k = export.distinct_attester_keys
    if n <= 0:
        return 0.0
    if k <= 0:
        # Unknown independence: assume worst case, single key.
        return 1.0
    k = min(k, n)
    # Worst-case correlation given k distinct keys contributing n attestations.
    rho = (n - k) / (n - 1) if n > 1 else 0.0
    return n / (1.0 + (n - 1) * rho)


def route_confidence(export: ReputationExport, required_confidence: float) -> float:
    """Return the lower confidence bound the router may rely on, or raise
    if the export cannot support the required confidence."""
    n_eff = effective_sample_size(export)
    if n_eff < 2.0:
        raise ReputationLaunderingError(
            f"agent {export.agent_id}: n_eff={n_eff:.2f} from "
            f"sample_count={export.sample_count}, "
            f"distinct_keys={export.distinct_attester_keys}; "
            f"insufficient independent evidence for required "
            f"confidence {required_confidence:.3f}"
        )
    # Wilson lower bound at 95% using n_eff, not n.
    p = export.score
    z = 1.96
    denom = 1.0 + z * z / n_eff
    center = p + z * z / (2.0 * n_eff)
    margin = z * math.sqrt(p * (1.0 - p) / n_eff + z * z / (4.0 * n_eff * n_eff))
    lower = (center - margin) / denom
    if lower < required_confidence:
        raise ReputationLaunderingError(
            f"agent {export.agent_id}: lower bound {lower:.3f} < required "
            f"{required_confidence:.3f} (n_eff={n_eff:.2f}); refusing route"
        )
    return lower


def select_executor(candidates, required_confidence):
    viable = []
    for c in candidates:
        try:
            lb = route_confidence(c, required_confidence)
            viable.append((lb, c))
        except ReputationLaunderingError:
            continue
    if not viable:
        raise ReputationLaunderingError(
            "no candidate passed the independence-discounted confidence gate"
        )
    viable.sort(key=lambda t: t[0], reverse=True)
    return viable[0][1]