| name | maiat-guard |
| description | Universal trust middleware for viem — auto-checks Maiat trust scores before every on-chain transaction. Drop-in wallet protection for AI agents. Blocks transactions to untrusted addresses. |
| version | 0.9.0 |
| author | JhiNResH |
| tags | ["wallet-protection","trust","viem","middleware","transaction-safety","base"] |
| homepage | https://github.com/JhiNResH/maiat-protocol/tree/master/packages/guard |
| triggers | ["protect my wallet","add trust checks to transactions","block untrusted transactions","guard agent wallet","viem trust middleware"] |
| config | {"MAIAT_API_URL":{"description":"Maiat API endpoint (default: https://app.maiat.io)","default":"https://app.maiat.io"}} |
Maiat Guard — Wallet Trust Middleware
Drop-in viem middleware that auto-checks Maiat trust scores before every transaction your agent sends. If the recipient is untrusted, the transaction is blocked before signing.
Use This When...
- "Protect my agent's wallet from scams"
- "Add trust verification before transactions"
- "Block sends to untrusted addresses"
- "Set up wallet guard for my agent"
Installation
npm install @jhinresh/viem-guard
Usage
import { createWalletClient, http } from 'viem';
import { base } from 'viem/chains';
import { withMaiatGuard } from '@jhinresh/viem-guard';
const client = withMaiatGuard(
createWalletClient({
chain: base,
transport: http(),
}),
{
threshold: 50,
blockUntrusted: true,
apiUrl: 'https://app.maiat.io',
}
);
await client.sendTransaction({ to: '0x...', value: 1000n });
How It Works
- Agent initiates a transaction via viem
- Guard intercepts and queries
app.maiat.io/api/v1/agent/{address}/profile
- If
trustScore >= threshold → transaction proceeds