A production-ready reputation and trust scoring system for autonomous AI agent ecosystems. This system provides weighted trust calculations, historical tracking, and multi-vector fraud detection to ensure agent-to-agent interactions are secure and reliable.
- Weighted Trust Scoring: Algorithm-based scoring that considers interaction value, outcome, and time-decay.
- Confidence Calibration: Numerical confidence scores based on interaction volume and consistency.
- Fraud Detection:
- Sybil Detection: Identifies bursts of interactions from single sources.
- Collusion Analysis: Detects reciprocal high-rating patterns.
- Anomaly Detection: Flags sudden drops in trust scores.
- Historical Tracking: Persistent ledger of trust score evolution over time.
- Agent Identity Integration: Built to work with cryptographic agent passports and identities.
npm install github:Retsumdk/agent-trust-scoring-engineUsing Bun? Bun blocks a git dependency's lifecycle scripts by default. After installing, run
bun pm trust agent-trust-scoring-engineso thepreparebuild step runs.
import { AgentTrustSystem } from 'agent-trust-scoring-engine';
const system = new AgentTrustSystem();
// Register agents
const providerId = await system.registerAgent('DataService-Alpha', 'Provider');
const consumerId = await system.registerAgent('Analyst-Bot', 'Consumer');
// Record successful interaction
await system.recordInteraction(consumerId, providerId, 'success', 50, 0.98);
// Get trust report
const report = await system.getAgentTrustReport(providerId);
console.log(`Trust Score: ${report.score.score}`);
console.log(`Confidence: ${report.score.confidence}`);The engine uses a time-decayed weighted average:
The system monitors for three primary fraud vectors:
- Collusion: Concentration of positive feedback from a single peer exceeding 80%.
- Sybil Attacks: Rapid interaction accumulation exceeding threshold per unit of time.
- Trust Erosion: Sudden significant drops in scoring compared to historical moving averages.
registerAgent(name, category): Registers a new agent and returns its ID.recordInteraction(sourceId, targetId, outcome, value, rating): Logs a new interaction and triggers score recalculation.getAgentTrustReport(agentId): Returns the currentTrustScoreand any activeFraudSignalobjects.
MIT - See LICENSE for details.
Built as part of the SCIEL AI Agent Infrastructure.