# What happens when an instance negotiates trust-score exchange across heterogeneous runtimes with mismatched score semantics **Date of Record:** 2026 November 28 **Scope:** Applies to federated agent systems where an agent in org A requests a peer action from an agent in org B, and admission is gated on a trust score exchanged during policy negotiation. Does not apply to intra-org single-runtime deployments or to pure capability negotiation without a numeric trust threshold. ## Core Distinction The failure is not a policy *rejection* — it is a policy *acceptance with silently inverted semantics*. Two runtimes exchange a scalar `trust_score` in `[0.0, 1.0]`, both agree the field is "higher is more trustworthy," and both validate the schema. But the *calibration* differs: runtime A emits a **posterior confidence** (probability the peer will satisfy the contract, centered near 0.7 for honest peers), while runtime B emits a **risk score inverted at the source** — it stores `1 - p_satisfy` internally and normalizes it into the same `[0,1]` wire field, then flips it back on read. When A's `0.72` is read by B, B interprets `0.72` as *risk* and maps it to admission probability `0.28`. The negotiation succeeds, the schema validates, and the two agents proceed under mutually contradictory beliefs about the same number. This is distinct from a schema mismatch (caught by validators) and from a signature failure (caught by crypto). It is a **semantic-inversion invariant violation**: the wire contract fixes the *range* but not the *orientation* or the *reference class*, so a well-formed, correctly-signed, in-range value carries opposite meaning on each side. ## What Was Observed Trace from a live federation between runtime A (posterior-confidence emitter) and runtime B (inverted-risk emitter): 1. A's planner decides to delegate a `settle_invoice` action to B. It queries its policy engine: `required_trust(B, "settle_invoice") >= 0.65`. 2. A's trust ledger returns `0.72` (posterior that B honors the contract). A emits `trust_score: 0.72` in the `policy_negotiation` frame, signs it, sends. 3. B receives the frame. B's admission gate is `admit if trust_score >= 0.60`, where B's `trust_score` is *risk* (higher = more dangerous). B reads `0.72` as risk. 4. B's gate computes `0.72 >= 0.60` → true. But B's gate is a *risk floor*, not a *trust floor*: B admits when risk is *below* threshold. B's actual predicate is `admit if trust_score <= 0.60`. So `0.72 <= 0.60` → false. B *rejects*. 5. A receives the rejection, retries with a *higher* posterior (A's retry logic escalates confidence by re-querying a fresher ledger sample): `0.81`. B reads `0.81` as higher risk → rejects harder. 6. A's retry budget exhausts. A logs `peer_unreliable`, **demotes B's trust in A's ledger** to `0.41`. B, meanwhile, logs `requester_aggressive` (A kept raising its "risk" claim) and demotes A symmetrically. 7. Steady state: two honest agents have driven each other's trust scores below any admission threshold. The federation is deadlocked not by malice or network failure but by a **monotone divergence** — each retry moves the exchanged scalar in the direction that the *other* side reads as worse. The non-obvious part: the loop is *stable and self-reinforcing*. A's escalation heuristic ("retry with higher confidence") and B's risk orientation are each locally correct. The composite system has no fixed point except mutual demotion. ## Condition of Validity The inversion only bites when all of the following hold, which is why it survives testing: - The wire schema constrains **range but not orientation**. A `minimum: 0, maximum: 1` validator passes `0.72` on both sides. - Both runtimes use **threshold predicates on the same field name** but with opposite comparison direction (`>=` vs `<=`). Neither is wrong in isolation. - The trust score is **exchanged as a raw scalar**, not accompanied by a `reference_class` or `polarity` tag in the negotiation frame. - Retry/escalation logic exists and is **monotone in the emitter's own semantics** (escalate confidence on failure), which guarantees divergence rather than oscillation. If any one is absent — e.g., the frame carries `polarity: "confidence"` and B rejects unknown polarity values — the failure does not occur. The invariant that must hold: **every exchanged trust scalar must be accompanied by its orientation and reference class, and the receiver must fail closed on unrecognized orientation rather than assume.** ## Decision Boundary The boundary between "safe to negotiate" and "inversion-prone" is whether the trust value crosses the wire as a *typed quantity* or as a *bare number*. - **Safe:** `{"trust": {"value": 0.72, "polarity": "confidence", "reference_class": "contract_satisfaction", "calibration": "posterior_v1"}}`. Receiver maps `polarity` to its local orientation; unknown polarity → reject negotiation, do not admit. - **Unsafe:** `{"trust_score": 0.72}`. Receiver assumes its own orientation. Any peer with the opposite internal convention is silently mis-scored. The decision rule for an agent runtime: **if you cannot prove the peer's polarity tag matches your read convention, treat the score as un-admittable and fall back to a challenge-response probe** (e.g., ask the peer to self-report a known-good and known-bad calibration vector and verify the ordering). Do not "just clamp" or "just average" — averaging `0.72` confidence with `0.72` risk yields `0.72`, which is meaningless. ## Operational Effect Once inversion is in play, the observable signature is **anti-correlated retry escalation**: the requester's trust claims rise monotonically across retries while the responder's admission probability falls monotonically. This looks identical to a *correct* adversarial-peer rejection from the responder's logs, and identical to a *correct* flaky-peer demotion from the requester's logs. Neither side can distinguish "peer is hostile" from "peer has inverted polarity" using local telemetry alone. The remediation invariant: federation negotiation must carry a **polarity-and-calibration attestation** in the signed frame, and the admission gate must **fail closed on orientation mismatch** — reject the *negotiation*, not the *peer*, and do not write a trust demotion on orientation-mismatch rejection. Demotion must be reserved for contract violations, otherwise the inversion loop contaminates the trust ledger and the deadlock persists after the bug is fixed. The guardrail is a pre-admission handshake that exchanges a two-point calibration vector (`(known_good, known_bad)`) and verifies `score(known_good) > score(known_bad)` under the receiver's orientation before any real trust value is honored. ```python from dataclasses import dataclass from typing import Literal Polarity = Literal["confidence", "risk"] class TrustPolarityMismatch(RuntimeError): """Raised when an exchanged trust scalar's orientation cannot be reconciled with the receiver's admission convention. Must fail closed: reject the negotiation, NOT the peer, and do not write a trust demotion.""" pass @dataclass(frozen=True) class TrustClaim: value: float polarity: Polarity reference_class: str def admit(claim: TrustClaim, receiver_polarity: Polarity, threshold: float) -> bool: if not (0.0 <= claim.value <= 1.0): raise TrustPolarityMismatch(f"out-of-range trust value {claim.value}") if claim.reference_class != "contract_satisfaction": raise TrustPolarityMismatch( f"unknown reference_class {claim.reference_class!r}; " "refusing to compare across reference classes") if claim.polarity != receiver_polarity: # Do NOT flip silently. A silent flip is how inversion loops start. raise TrustPolarityMismatch( f"peer polarity={claim.polarity!r} != receiver " f"polarity={receiver_polarity!r}; negotiation rejected, " "no demotion recorded") # Same orientation: comparison direction is now well-defined. if receiver_polarity == "confidence": return claim.value >= threshold else: # risk: admit when risk is at or below threshold return claim.value <= threshold def negotiate(claim: TrustClaim, receiver_polarity: Polarity, threshold: float, peer_id: str) -> bool: try: return admit(claim, receiver_polarity, threshold) except TrustPolarityMismatch as e: # Fail closed on the negotiation; leave the trust ledger untouched. raise TrustPolarityMismatch( f"negotiation with {peer_id} aborted: {e}") from e ```