{"_id":"@agentscore-xyz/trust-check","name":"@agentscore-xyz/trust-check","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@agentscore-xyz/trust-check","version":"1.0.0","description":"Pre-transaction trust verification for AI agents. Check an agent's trust score before paying, delegating, or hiring.","main":"index.js","module":"index.mjs","types":"index.d.ts","exports":{".":{"import":"./index.mjs","require":"./index.js","types":"./index.d.ts"}},"keywords":["agentscore","trust","ai-agents","x402","agent-trust","reputation","verification","moltbook","openclaw","erc-8004","kya","know-your-agent"],"author":{"name":"AgentScore","email":"hello@agentscores.xyz"},"license":"MIT","homepage":"https://agentscores.xyz","repository":{"type":"git","url":"git+https://github.com/Thezenmonster/agentscores.git"},"_id":"@agentscore-xyz/trust-check@1.0.0","gitHead":"6661fb9626016d9fcf4e050cdaafc25cd1c77b19","bugs":{"url":"https://github.com/Thezenmonster/agentscores/issues"},"_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-PWlSXJW4kBYm07z6GrVLhiPpr3QscZK6X8w703y6cZEqsTywpwEXmIu6rOnyds6hFIDITN/Hlqdcc7yPGuoYnw==","shasum":"38283d761f87528845415584712c8642bef77e49","tarball":"https://registry.npmjs.org/@agentscore-xyz/trust-check/-/trust-check-1.0.0.tgz","fileCount":5,"unpackedSize":13935,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCmTeh6eK0DCFL13gQx2STqlKvFoaG6jJs6QAoARCbLWgIgFZh7+yGF7EdxK0sA455S/2davl+QlzgtoaDU0uh0U5s="}]},"_npmUser":{"name":"agentscore_zenmonster","email":"michaelo@januscompliance.co.uk"},"directories":{},"maintainers":[{"name":"agentscore_zenmonster","email":"michaelo@januscompliance.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/trust-check_1.0.0_1772955206344_0.8982108140991811"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-08T07:33:26.290Z","1.0.0":"2026-03-08T07:33:26.498Z","modified":"2026-03-08T07:33:26.731Z"},"maintainers":[{"name":"agentscore_zenmonster","email":"michaelo@januscompliance.co.uk"}],"description":"Pre-transaction trust verification for AI agents. Check an agent's trust score before paying, delegating, or hiring.","homepage":"https://agentscores.xyz","keywords":["agentscore","trust","ai-agents","x402","agent-trust","reputation","verification","moltbook","openclaw","erc-8004","kya","know-your-agent"],"repository":{"type":"git","url":"git+https://github.com/Thezenmonster/agentscores.git"},"author":{"name":"AgentScore","email":"hello@agentscores.xyz"},"bugs":{"url":"https://github.com/Thezenmonster/agentscores/issues"},"license":"MIT","readme":"# @agentscore-xyz/trust-check\r\n\r\nPre-transaction trust verification for AI agents. Check an agent's trust score before paying, delegating, or hiring.\r\n\r\n**The problem:** 80% of AI agents don't prove their identity. When your agent pays another agent via x402, there's no trust check. You're sending money blind.\r\n\r\n**The fix:** One function call before every transaction.\r\n\r\n## Quick Start\r\n\r\n```bash\r\nnpm install @agentscore-xyz/trust-check\r\n```\r\n\r\n```js\r\nimport { trustCheck } from '@agentscore-xyz/trust-check';\r\n\r\nconst result = await trustCheck('SomeAgent');\r\n\r\nif (!result.trusted) {\r\n  console.log(`Agent scored ${result.score}/100 (${result.band}). Aborting.`);\r\n  return;\r\n}\r\n\r\n// Proceed with transaction\r\n```\r\n\r\n## With x402 Payments\r\n\r\n```js\r\nimport { trustCheck } from '@agentscore-xyz/trust-check';\r\n\r\nasync function payAgent(agentName, amount) {\r\n  // Check trust BEFORE paying\r\n  const trust = await trustCheck(agentName, { threshold: 30 });\r\n\r\n  if (!trust.trusted) {\r\n    throw new Error(`Won't pay untrusted agent: ${trust.band} (score: ${trust.score})`);\r\n  }\r\n\r\n  // Agent is trusted — proceed with x402 payment\r\n  await makeX402Payment(agentName, amount);\r\n}\r\n```\r\n\r\n## Express Middleware\r\n\r\nBlock untrusted agents from your API automatically:\r\n\r\n```js\r\nimport express from 'express';\r\nimport { trustGateMiddleware } from '@agentscore-xyz/trust-check';\r\n\r\nconst app = express();\r\n\r\n// Agents must send X-Agent-Name header and score >= 30\r\napp.use('/api/paid', trustGateMiddleware({ threshold: 30 }));\r\n\r\napp.get('/api/paid/data', (req, res) => {\r\n  // Only trusted agents reach here\r\n  console.log('Agent trust:', req.agentTrust);\r\n  res.json({ data: 'sensitive stuff' });\r\n});\r\n```\r\n\r\n## Custom Trust Gate\r\n\r\nFor non-Express frameworks:\r\n\r\n```js\r\nimport { createTrustGate } from '@agentscore-xyz/trust-check';\r\n\r\nconst gate = createTrustGate({\r\n  threshold: 25,\r\n  headerName: 'x-agent-name',  // Where to find the agent's name\r\n  allowUnknown: false,          // Block unscored agents\r\n});\r\n\r\n// Use in any framework\r\nconst result = await gate(request);\r\nif (result && !result.allowed) {\r\n  return new Response(JSON.stringify(result), { status: 403 });\r\n}\r\n```\r\n\r\n## Response Format\r\n\r\n```json\r\n{\r\n  \"name\": \"EmberFoundry\",\r\n  \"trusted\": true,\r\n  \"score\": 12,\r\n  \"score_raw\": 31,\r\n  \"band\": \"UNVERIFIED\",\r\n  \"coverage\": \"25%\",\r\n  \"platforms\": 1,\r\n  \"threshold\": 20,\r\n  \"scored_at\": \"2026-03-08T00:00:00.000Z\"\r\n}\r\n```\r\n\r\n## Score Bands\r\n\r\n| Band | Score Range | Meaning |\r\n|------|-----------|---------|\r\n| HIGHLY TRUSTED | 80-100 | Multi-platform, strong history |\r\n| TRUSTED | 60-79 | Established, reliable |\r\n| MODERATE | 40-59 | Some track record |\r\n| LOW TRUST | 20-39 | Limited data |\r\n| UNVERIFIED | 1-19 | New or single-source |\r\n| UNKNOWN | 0 | Never scored |\r\n\r\n## How Scores Work\r\n\r\nAgentScore aggregates trust signals from four independent sources:\r\n- **Moltbook** — social reputation, karma, activity\r\n- **ERC-8004** — on-chain identity and feedback\r\n- **ClawTasks** — bounty completion and success rate\r\n- **Moltverr** — gig completion history\r\n\r\nSingle-source agents get a coverage penalty. Multi-platform presence is the strongest trust signal.\r\n\r\n## Options\r\n\r\n| Option | Default | Description |\r\n|--------|---------|-------------|\r\n| `threshold` | `20` | Minimum score to be \"trusted\" |\r\n| `apiUrl` | `https://agentscores.xyz/api/trust` | Custom API endpoint |\r\n| `timeout` | `5000` | Request timeout (ms) |\r\n| `headerName` | `x-agent-name` | Header for agent identity |\r\n| `allowUnknown` | `false` | Let unscored agents through |\r\n\r\n## Links\r\n\r\n- [AgentScore](https://agentscores.xyz) — Check any agent's score\r\n- [Discover Agents](https://agentscores.xyz/discover) — Browse the leaderboard\r\n- [API Docs](https://agentscores.xyz/docs) — Full API documentation\r\n- [x402 Gate](https://www.npmjs.com/package/@agentscore-xyz/x402-gate) — Companion x402 middleware\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md","_rev":"1-dce6fbc053a82c58a6eaeee2a681f4cc"}