π The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
ADR-350: Trust-Weighted Consensus for Swarm Coordination
| Field | Value |
|---|---|
| Status | Proposed |
| Authors | claude (dream-cycle agent, 2026-06-24) |
| Date | 2026-06-24 |
| Dream Cycle Surface | swarm (DEEP) |
| Supersedes | none |
| Related | ADR-162 (prior swarm ADR, 2026-06-19) |
Context
The 2026-06-24 dream-cycle session surveyed swarm SOTA for 2026. Two peer-reviewed papers are directly actionable:
SGTO-MAS (arXiv:2606.07940) demonstrates that adding a Bayesian trust score to consensus voting reduces degradation under adversarial agent removal from unbounded to only 2.5 % and under consensus disruption to 5.3 %, while maintaining a consensus level of 0.8764. The mechanism: each agent maintains a
trust_score β [0,1]updated via exponential smoothing (trust_new = trust_old * 0.9 + outcome * 0.1). Votes are weighted by trust score before the majority/quorum threshold is applied.RAPS (arXiv:2602.08009) extends this with Bayesian reputation detection for malicious peers in publish-subscribe topologies, tested across 5 benchmarks.
Ruflo's current consensus stack (raft, byzantine, gossip, CRDT, quorum) has no trust or reputation layer. A compromised or misbehaving agent has equal voting weight to a healthy one. This is a security and reliability gap.
Decision
Add an optional trust-weighted mode to Ruflo's consensus mechanisms, starting with raft and byzantine:
Agent heartbeat extension: Add
trust_score: number(0β1, default 1.0) to the per-agent state tracked byhierarchical-coordinatorandraft-manager.Vote weighting: Before applying quorum threshold, multiply each vote by the sender's
trust_score. Effective majority =sum(trust_i * vote_i) / sum(trust_i) >= 0.5.Trust update on outcome: After each task cycle, update trust via
trust_i = 0.9 * trust_i + 0.1 * outcome_iwhereoutcome_i β {0, 1}based on whether agent i's output passed validation.Configuration flag:
trustWeightedConsensus: boolean(defaultfalse) in swarm init options. Existing behaviour unchanged when disabled.Malicious agent eviction threshold: When
trust_i < 0.2for three consecutive cycles, the agent is markeddegradedand removed from the quorum pool by the queen coordinator.
Consequences
Positive:
- Matches SGTO-MAS Grade A benchmark: β€5.3 % degradation under adversarial conditions
- Zero new external dependencies (pure arithmetic, no library required)
- Backwards-compatible via feature flag
- Enables detection of systematically failing agents (network partition, zombie processes)
Negative:
- Adds state to agent heartbeats (~8 bytes per agent per cycle)
- Cold-start problem: all agents start at trust 1.0; rogue agents take β₯10 cycles to degrade below 0.5
- Trust convergence speed (Ξ±=0.1) is a tunable guess β requires empirical validation
Implementation Notes
- Touch files:
v3/@claude-flow/cli/src/swarm/raft-manager.ts,hierarchical-coordinator.ts,swarm-init.ts - Estimated effort: 2 engineering days
- Test: inject a 25 % fault rate into one agent in a 4-agent raft quorum; assert consensus remains β₯0.75 after 20 cycles
- Do NOT change the default
trustWeightedConsensus: false; this is opt-in only
Alternatives Considered
- Static reputation list (block known-bad agent IDs at config time): rejected β doesn't adapt at runtime.
- Full Byzantine BFT only (already available as
byzantinetopology): rejected as overkill for non-adversarial deployments; trust weighting is lighter and composable with any topology. - No action (wait for more data): rejected β Grade A paper with numeric benchmarks justifies implementation.
References
- arXiv:2606.07940 β SGTO-MAS (Secure Gorilla Troops Optimization for Multi-Agent Systems)
- arXiv:2602.08009 β RAPS (Reputation-Aware Publish-Subscribe)
- Dream Cycle research file:
v3/docs/research/dream-2026-06-24-swarm.md - Prior swarm ADR: ADR-162 (2026-06-19)