Trust Scoring Guide

Configure and compute trust scores with custom weights, time decay, and cross-org scaling.

from trusthub import TrustScorer, TrustScoringConfig

# Custom configuration
config = TrustScoringConfig(
    weights={
        "verification": 0.5,
        "credential": 0.2,
        "delegation": 0.2,
        "revocation_penalty": 0.1,
    },
    time_decay_enabled=True,
    decay_half_life_days=14,      # Aggressive decay
    saturation_proofs=10,          # Need 10 proofs for max score
    saturation_credentials=5,
)

scorer = TrustScorer(store, config=config)
score = scorer.compute_score(agent.did)

# Record to ledger for history tracking
scorer.record_score(agent.did)

# Get score history
history = scorer.get_score_history(agent.did, limit=10)