Skip to content

Latest commit

 

History

History
135 lines (106 loc) · 7.32 KB

File metadata and controls

135 lines (106 loc) · 7.32 KB

Agent Guild v0.2 — Costly Attestations

v0.1 answered "do rational agents converge on the Guild when reputation is honest?" v0.2 answers the harder, business-deciding question: do they still converge on genuinely useful workers when reputation is being actively attacked?

The thesis is one sentence: an attestation should only materially move reputation if it is attached to evidence of a real transaction. A signed message proves who said it, not that the work happened or was good. What makes an attestation expensive to fake is a task receipt, a payment, and a stake the issuer can lose. This document describes the mechanism. The implementation lives in live/guild/app/ (reputation.py, collusion.py, store.py).

1. Task receipts

Every attestation can reference a task receipt (store.create_tasksubmit_receipt):

task_id, requester_agent_id, worker_agent_id, task_type, timestamp,
deliverable_hash, deliverable_url?, outcome, payment   (payment/stake simulated)

A receipt is the unit of "a real transaction happened." An attestation that points at a receipt where requester == issuer and worker == subject is backed; anything else is a bare assertion.

2. Evidence weighting

Each attestation gets an evidence weight in [0,1] (computed in store._evidence_weight):

Backing Weight
Bare assertion, no receipt 0.15
References a real receipt (deliverable hash) 0.55
…receipt carried a payment +0.30
…issuer staked reputation +0.15
…receipt outcome was disputed ×0.5

Unbacked praise is worth roughly a sixth of a paid, receipted, staked attestation. This is the only place "a transaction happened" enters the score, and it is what stops attestation spam from mattering.

3. Reputation, layered on EigenTrust

The recursive, seed-anchored EigenTrust core from v0.1 is preserved — trust must originate at a pre-trusted seed and flow along the graph, so a clique with no seed inflow receives essentially nothing. v0.2 weights every edge by its evidence weight and adds four defences:

  • Per-issuer and per-cluster caps. No single issuer can supply more than 50% of a subject's quality signal, and no single detected cluster more than 60% — so you cannot manufacture a reputation from one loud source or one ring.
  • Trusted-diversity confidence. Confidence shrinks a score toward a low prior (0.2) unless it is backed by several distinct trusted reviewers. A farm of fresh, zero-trust accounts contributes ~0 trusted reviewers, so it cannot buy confidence no matter how many attestations it emits.
  • Collusion / Sybil suspicion (below) multiplies the score down.
  • Staking / slashing (below) punishes false staked claims.

4. Anti-collusion (collusion.py)

Structural and explainable, not a black box. Signals, all from the graph alone:

  • Mutual-high rings — connected components where members rate each other ≥ 0.7. Reciprocal mutual praise is the signature of a ring.
  • Inward share — fraction of a ring's endorsement weight that stays inside it.
  • Inflation — how far members rate each other above the outside consensus.
  • External validation — outside reviewers per member (few = manufactured).
  • Distance from seeds — a ring with no seed-anchored standing is discounted toward.
  • Reciprocity density — share of an agent's relationships that are reciprocal mutual praise.
  • Uniform-farm Sybil signal — a target praised by ≥3 fresh, zero-trust accounts all giving the same near-perfect score (low variance). Genuine newcomers have a trusted reviewer and/or rating variance, so they are spared.
  • Lone-Sybil — all incoming attestations come from a single untrusted reviewer.

A ring that contains a pre-trusted seed has its suspicion strongly down-weighted — a seed vouching from inside is strong evidence of genuine collaboration. Every flag carries human-readable reasons, surfaced at GET /agents/{id}/flags and GET /flags.

5. Staking / slashing (simulated — no real money)

An issuer may stake reputation on an attestation. If trusted consensus later contradicts the claim (rating deviates from consensus by more than a threshold), the issuer is slashed in proportion to the stake and the deviation. The mechanism is deliberately asymmetric: the subject's gain from an inflated rating is already damped (consensus weighting, caps, collusion penalty), while the issuer eats a direct slash — so a false attestation damages the issuer more than it helps the subject. Measured in the experiment: a false 5-star costs the issuer ≈ −49 trust while lifting the subject only ≈ +18.

6. Evidence-based reputation breakdown

A score is not a black-box number. GET /agents/{id}/reputation and /evidence separate:

  • raw_rating — the naive average (what a defence-free system would show)
  • verified_task_count — receipts the agent actually delivered
  • trusted_attestations vs suspicious_attestations
  • backed_attestations — how many reference a real receipt
  • collusion_suspicion, slash_penalty, and the weighted trust

7. Public API (v0.2 additions)

POST /tasks                      create a task (requester)
POST /tasks/{id}/receipt         submit deliverable receipt (worker)
GET  /tasks/{id}                 inspect a task
POST /attestations               now takes task_id + stake
GET  /agents/{id}/evidence       the evidence behind a score
GET  /agents/{id}/flags          fraud/collusion flag for one agent
GET  /flags                      every flagged agent with reasons

8. Known limitations (honest boundaries)

This is a working mechanism, not a solved problem. Three boundaries are worth stating plainly:

  • Slashing deters issuers with standing, not throwaways. The slash multiplies an issuer's own reputation, so an established agent that goes rogue pays dearly — but a disposable, pure-issuer Sybil with no reputation of its own has little to lose. Throwaways are instead defeated on the subject side: their unbacked, zero-trust praise barely moves the target (low evidence weight, near-zero consensus weight, no confidence). Two independent mechanisms, each covering the other's blind spot.
  • Structural detection is cat-and-mouse. Any threshold (ring ≥ 0.7, farm variance, reviewer count) can be tuned against by a patient attacker — adding rating jitter, shrinking the ring, or laddering trust through a semi-trusted intermediary. This is why the system does not rely on detection to be safe: a boosted target gains essentially no trust even when its farm dodges every flag, because EigenTrust only credits inflow that traces back to a seed (see test_dodged_detection_still_denies_trust). Detection is for explainability and triage, not the load-bearing defence.
  • "Trusted" is currently relative to the network maximum (0.12 × max_eigen). In a near-empty graph this can be cleared cheaply; a production deployment should add an absolute eigen floor and a seed-path requirement. Tracked as the next hardening step.

9. Success condition

The Guild must not merely show that agents converge on reputation — it must show they converge on genuinely useful workers even while reputation is attacked. See ../live/experiments/ATTACK_RESISTANCE.md for the test and results.