Skip to content

clawdez/maiat-do-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maiat Trust API — DigitalOcean Microservice

Standalone trust scoring microservice for AI agents. Built for the DigitalOcean Gradient AI Hackathon.

What It Does

Computes behavioral trust scores (0–100) for AI agents based on on-chain activity data from the Virtuals ACP marketplace.

Endpoints

Method Path Description
GET /health Liveness check
GET / API overview
POST /v1/score Score one agent by address
GET /v1/score?address=0x... Score one agent (GET variant)
POST /v1/batch Batch score up to 20 agents
GET /v1/stats Request stats

Usage

# Score an agent
curl -X POST https://your-app.ondigitalocean.app/v1/score \
  -H "Content-Type: application/json" \
  -d '{"address": "0x1234567890abcdef1234567890abcdef12345678"}'

Response:

{
  "ok": true,
  "data": {
    "address": "0x1234567890abcdef1234567890abcdef12345678",
    "score": 78,
    "verdict": "trusted",
    "breakdown": {
      "completion_rate": 85,
      "payment_rate": 92,
      "expiry_rate": 70,
      "transaction_volume": 65,
      "counterparty_quality": 75
    },
    "data_source": "virtuals_acp",
    "transaction_count": 142,
    "computed_at": "2026-03-17T07:00:00.000Z"
  }
}

Verdicts

Score Verdict Meaning
70–100 trusted Reliable agent, safe to delegate
45–69 caution Proceed carefully, verify task
1–44 untrusted High risk, avoid delegation
0 unknown Insufficient data

Integration Example

// Trust-gate before delegating to a sub-agent
const res = await fetch('https://your-app.ondigitalocean.app/v1/score', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ address: agentWalletAddress }),
});
const { data } = await res.json();

if (data.score < 60) {
  throw new Error(`Low-trust agent blocked (score: ${data.score})`);
}
// Proceed with delegation

Deploy to DigitalOcean

Option 1: App Platform (recommended)

# Install doctl CLI
brew install doctl
doctl auth init

# Create app from spec
doctl apps create --spec .do/app.yaml

Option 2: Docker + Droplet

docker build -t maiat-do-api .
docker run -p 3000:3000 -e PORT=3000 maiat-do-api

Local Dev

npm install
npm run dev   # ts-node hot-reload
npm run build && npm start   # production mode

Environment Variables

Variable Default Description
PORT 3000 HTTP listen port
MAIAT_API_URL https://maiat.vercel.app Upstream Maiat API
NODE_ENV Set to production in prod

About

Maiat Trust Score API — AI agent trust scoring microservice for DigitalOcean

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors