@aroha-sdk/reputation
v1.4.0
Published
Aroha Bayesian Beta reputation engine — 11-signal model with Thompson Sampling
Readme
@aroha-sdk/reputation
Track and query agent reputation scores — surface agents that consistently honor their mandate bounds.
Install
npm install @aroha-sdk/reputationQuick example
import { ReputationClient } from "@aroha-sdk/reputation";
const rep = new ReputationClient();
// After a successful mandate-bounded interaction, record a positive signal
await rep.record({
agentDID: "did:aroha:flight-agent",
event: "mandate.honored",
mandateConstraints: { spendLimitUsd: 300 },
actualSpend: 299,
});
// Record a violation
await rep.record({
agentDID: "did:aroha:rogue-agent",
event: "mandate.violated",
reason: "Attempted to charge $400 against a $300 mandate",
});
// Query before deciding whether to issue a mandate
const score = await rep.score("did:aroha:flight-agent");
// score.value: 0–100
// score.mandateViolations: 0
// score.successfulDelegations: 142Why this exists in the mandate chain
Cryptographic mandates prevent unauthorized actions, but they don't tell you which agents are reliable over time. Reputation surfaces agents that consistently operate within their granted scope — so orchestrators can make informed decisions before issuing a mandate.
API
ReputationClient(opts?)— connect to the Aroha reputation service (or a local store for testing).rep.record(signal)— record a reputation signal for a DID.rep.score(did)— get the current score and signal history for an agent.rep.leaderboard(filter?)— list agents ranked by score, optionally filtered by capability.
License
MIT
