@jhinresh/agentkit-plugin
v0.9.0
Published
Maiat Trust Score plugin for Coinbase AgentKit — auto-check trust before every transaction
Maintainers
Readme
@maiat/agentkit-plugin
Trust-gated transactions for Coinbase AgentKit agents
Automatically check trust scores before every transaction. Block interactions with untrusted addresses. One line to integrate.
Install
npm install @maiat/agentkit-pluginQuick Start
import { AgentKit } from "@coinbase/agentkit";
import { maiatTrustPlugin } from "@maiat/agentkit-plugin";
const agent = new AgentKit({
// your config
});
// Add Maiat trust gating
agent.use(maiatTrustPlugin({
minScore: 3.0, // Block addresses below 3.0/10
chain: "base",
onBlocked: (addr, score, risk) => {
console.log(`🔴 Blocked ${addr}: ${score}/10 (${risk})`);
},
}));How It Works
- Agent wants to interact with address
0x1234... - Plugin queries Maiat API:
GET /v1/score/0x1234... - Score ≥ minScore → ✅ transaction proceeds
- Score < minScore → ❌
MaiatTrustErrorthrown, transaction blocked
Actions
maiat_check_trust
Check trust score for any address.
const result = await agent.run("Check if 0x4752... is trustworthy");
// → { score: 8.5, risk: "LOW", safe: true, ... }maiat_gate_transaction
Pre-flight check before executing a transaction.
// Automatically called before transactions when plugin is active
// Throws MaiatTrustError if target is untrustedConfiguration
| Option | Default | Description |
|--------|---------|-------------|
| minScore | 3.0 | Minimum trust score (0-10) |
| apiUrl | https://app.maiat.io | API endpoint |
| apiKey | (none) | API key for higher limits |
| chain | base | Default chain |
| warnOnly | false | Log warnings instead of blocking |
| onBlocked | (none) | Callback when transaction blocked |
| onCheck | (none) | Callback for every check |
Standalone Client
import { MaiatClient } from "@maiat/agentkit-plugin";
const maiat = new MaiatClient({ chain: "base" });
const result = await maiat.checkTrust("0x4752ba5DBc23f44D87826276BF6Fd6b1C372aD24");
console.log(result.score, result.risk); // 8.5 "LOW"
// Batch check
const results = await maiat.batchCheck(["0x1234...", "0x5678..."]);x402 Integration
Works seamlessly with Coinbase's x402 protocol for agent-to-agent payments:
import { maiatTrustPlugin } from "@maiat/agentkit-plugin";
// Agent automatically checks trust before paying via x402
const plugin = maiatTrustPlugin({
minScore: 5.0, // Higher threshold for payments
onBlocked: (addr, score) => {
console.log(`Payment to ${addr} blocked — trust score ${score}/10`);
},
});License
MIT
