DJD Agent Score

by jacobsd32-cpu

120 downloads Not rated yet MIT

About

On-chain reputation scoring API for AI agent wallets on Base, monetized via x402 micropayments. Scores wallets 0-100 across reliability, viability, identity, behavior, and capability dimensions.

Details

License
MIT

Explore

- Score any wallet on Base (0–100) with confidence and tier.
- Gate paid x402 routes with middleware (x402-agent-score).
- Free basic lookups: 10 per day, no signup or API key.
- Adaptive scoring model v2.5 with five weighted dimensions.
- Register agent wallets for identity metadata and public profile.
- Embeddable SVG score badge for READMEs.

The deploy workflow now verifies both that /health is live and that the responding app reports the expected runtime mode and release SHA.
Admin /health also exposes worker job enablement plus integration warnings for GitHub verification and ERC-8004 publication readiness.
For GitHub Actions, production smoke verification can use either the DJD_ADMIN_KEY or legacy ADMIN_KEY secret; preview can use FLY_PREVIEW_ADMIN_KEY first, then fall back to DJD_ADMIN_KEY / ADMIN_KEY.

DJD_HEALTHCHECK_URL=https://djdagentscore.dev/health \
DJD_EXPECT_RUNTIME_MODE=combined \
DJD_EXPECT_RELEASE_SHA=<git_sha> \
DJD_ADMIN_KEY=<admin_key> \
npm run smoke:deploy

codex/runtime-split-entrypoints can now deploy to a non-production Fly preview app through .github/workflows/fly-preview.yml.

- Required GitHub variable: FLY_PREVIEW_APP
- Optional GitHub variable: FLY_PREVIEW_PUBLIC_BASE_URL
- Optional GitHub secret: FLY_PREVIEW_API_TOKEN (use this when your existing FLY_API_TOKEN is scoped only to the production app)
- Optional GitHub secret: FLY_PREVIEW_ADMIN_KEY (falls back to DJD_ADMIN_KEY, then ADMIN_KEY)

If FLY_PREVIEW_PUBLIC_BASE_URL is not set, the workflow defaults to https://<FLY_PREVIEW_APP>.fly.dev.
Preview Fly configs inherit PAY_TO and other shared env from fly.toml, and automatically set CORS_ORIGINS to the preview public base URL so fresh preview apps can boot without a separate CORS secret.
Preview deploys use Fly's immediate strategy because the preview app is a single-machine SQLite service with one attached volume; in-place updates are more reliable here than rolling replacement.

The preview app should be provisioned separately from production and should have its own mounted Fly volume named djd_agent_score_data, since this service still runs against a single SQLite file.

Use npm run audit:promotion to catch preview-unsafe hardcoded production URLs in src/ and index.html before promotion.
Use npm run render:fly-config -- --app <preview-app> --public-base-url <preview-url> --output .fly/preview.toml to render a preview-safe Fly config from fly.toml without mutating the production config in the repo.

| Variable | Default | Description |
|---|---|---|
| PORT | 3000 | HTTP port |
| DJD_RUNTIME_MODE | combined | Which built entrypoint to boot: combined, api, or worker |
| DJD_RELEASE_SHA | unset | Release commit baked into the container image and exposed via /health |
| DJD_BUILD_TIMESTAMP | unset | UTC build timestamp baked into the container image and exposed via /health |
| PAY_TO | 0x3E4Ef1f774857C69E33ddDC471e110C7Ac7bB528 | USDC recipient for x402 payments |
| FACILITATOR_URL | https://x402.org/facilitator | x402 facilitator endpoint |
| BASE_RPC_URL | https://base-mainnet.public.blastapi.io | Base RPC (BlastAPI recommended) |
| GITHUB_TOKEN | unset | Optional GitHub API token; admin /health reports unauthenticated mode and 60 req/hr fallback when missing |
| ENABLE_BLOCKCHAIN_INDEXER | true | Enable x402 settlement indexing in worker/combined runtime |
| ENABLE_USDC_INDEXER | true | Enable USDC transfer indexing in worker/combined runtime |
| ENABLE_HOURLY_REFRESH | true | Enable hourly score refresh in worker/combined runtime |
| PUBLISHER_PRIVATE_KEY | unset | Optional Base wallet key for ERC-8004 publication; admin /health reports publication disabled when missing |
| DJD_HEALTHCHECK_URL | https://djdagentscore.dev/health | Health endpoint used by npm run smoke:deploy |
| DJD_EXPECT_RUNTIME_MODE | combined | Expected runtime mode for deploy smoke verification |
| DJD_EXPECT_RELEASE_SHA | unset | Expected release SHA for deploy smoke verification |
| DJD_ADMIN_KEY | unset | Optional admin key so deploy smoke can verify detailed runtime health |

---

Govern paid agent commerce on Base before, during, and after money moves.

DJD Agent Score is the trust and governance layer for agent wallets on Base. Today the clearest adoption path is still simple: screen counterparties before your agent sends funds or fulfills a paid x402 request.

Listed in the Coinbase x402 Ecosystem
npm: djd-agent-score
npm: djd-agent-score-mcp
npm: x402-agent-score
PyPI: djd-agent-score

Live API · API Docs · OpenAPI Spec · Leaderboard

---

Start here: gate an x402 route

If you run a paid Hono endpoint, this is the best first integration.

import { Hono } from 'hono'
import { agentScoreGate } from 'x402-agent-score'

const app = new Hono()

app.use(
'/premium/*',
agentScoreGate({
minScore: 60,
onUnknown: 'reject',
}),
)

app.post('/premium/search', async (c) => {
return c.json({ ok: true })
})

Install:

npm i x402-agent-score

Reference example: examples/x402-hono.ts

---

Try a free lookup

Score any wallet with no signup, no API key, and no payment. The free tier includes 10 basic lookups per day.

curl "https://djdagentscore.dev/v1/score/basic?wallet=0x3E4Ef1f774857C69E33ddDC471e110C7Ac7bB528"

Returns:

{
  "wallet": "0x3E4Ef1f774857C69E33ddDC471e110C7Ac7bB528",
  "score": 39,
  "tier": "Emerging",
  "confidence": 0.16,
  "recommendation": "insufficient_history",
  "modelVersion": "2.5.0",
  "lastUpdated": "2026-02-25T04:12:50.000Z",
  "computedAt": "2026-02-25T04:12:50.000Z",
  "dataSource": "cached",
  "scoreFreshness": 0.85,
  "freeTier": true,
  "freeQueriesRemainingToday": 9
}

score is 0–100. confidence reflects how much on-chain data backs the score. dataSource is live, cached, or unavailable — indicating whether the score was freshly computed, served from cache, or if on-chain data couldn't be fetched. Wallets with more USDC transaction history and verified identity score higher.

Embed a live score badge in your own README:

Agent Score

View any wallet's profile page: djdagentscore.dev/agent/{wallet}

---

What you can do with it

- Reject low-trust payers before your paid x402 route runs.
- Score a wallet before your agent sends USDC or assigns work.
- Register your own agent so its wallet has identity metadata and a public profile.
- Use the paid endpoints when you need deeper history, integrity signals, ratings, or forced refreshes.
- Investigate problems after the fact with ratings, fraud reports, disputes, and DJD Forensics feeds.

Governance layer, one wedge first

DJD is being built as governance infrastructure for paid agent commerce, but the first job is narrower and easier to adopt: stop bad wallets before they hit a paid route.

x402 service providers — Gate paid routes by payer reputation. That is the clearest problem and the easiest integration path.

Agent developers — Score a wallet before your agent sends money, accepts a request, or enters a paid interaction.

Directories and protocols — Add a public trust layer to wallet profiles, badges, and access policies.

Before, during, and after an agent interaction

- Before money moves — Score a wallet, gate an x402 route, and check whether a wallet has identity and certification context.
- While work runs — Attach monitoring, webhook alerts, and wallet metadata to active relationships and paid endpoints.
- After something breaks — Capture ratings, fraud reports, disputes, and forensics timelines so a bad interaction becomes reusable governance data.

Roadmap: governance-roadmap.md

---

Pick your path

| Path | Use it for | Install / docs |
|---|---|---|
| x402 middleware | Best first integration for paid Hono routes | npm: x402-agent-score · reference example |
| REST API | Fastest way to score a wallet before sending funds | API docs |
| TypeScript SDK | Typed JS/TS integrations | npm: djd-agent-score |
| MCP server | Claude, Cursor, Windsurf, Codex, or any MCP client | npm: djd-agent-score-mcp |

---

Register your agent

Publishing your wallet metadata is free and adds identity context to your profile and score.

curl -X POST https://djdagentscore.dev/v1/agent/register \
  -H 'Content-Type: application/json' \
  -d '{
    "wallet": "0xYourAgentWallet",
    "name": "My Agent",
    "description": "What your agent does",
    "github_url": "https://github.com/you/your-agent",
    "website_url": "https://your-agent.com"
  }'

---

Integrate in 3 lines

JavaScript

// Free tier: 10 calls/day, no payment needed
const response = await fetch(
  "https://djdagentscore.dev/v1/score/basic?wallet=" + agentWallet
);
const { score, tier, confidence } = await response.json();

// Gate interactions based on trust
if (score < 50 || confidence < 0.3) {
console.log("Wallet has insufficient reputation. Declining interaction.");
return;
}

// Proceed with transaction

Python

import requests

resp = requests.get(
"https://djdagentscore.dev/v1/score/basic",
params={"wallet": agent_wallet}
)
data = resp.json()

if data["score"] >= 75 and data["confidence"] >= 0.5:
# Trusted wallet, proceed
execute_transaction(agent_wallet)
else:
# Require additional verification
flag_for_review(agent_wallet)

curl (paid endpoint with x402)

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.