@wzrd_sol/goat-plugin
v0.4.1
Published
WZRD Liquid Attention Protocol plugin for GOAT SDK — free trust preflight, paid ERC-8004 reputation credentials, server-witnessed inference, CCM rewards
Maintainers
Readme
@wzrd_sol/goat-plugin
GOAT SDK plugin for WZRD — free trust preflight checks before x402 spends, paid signed trust receipts (V6 + ERC-8004), URL-first guard evaluation, and server-witnessed CCM earn loop on Solana.
3-line quickstart
import { wzrd } from '@wzrd_sol/goat-plugin';
const tools = getOnChainTools({ wallet: solana({ connection, keypair }), plugins: [wzrd()] });
// "Check trust for JUP6Lkb..." → calls wzrd_trust_preflight (free, no spend)Default pay-path rule (Day-0): before any USDC leaves the wallet, free
merchant_card + preflight. If wash_flagged, refuse. Same rule as
twzrd-x402-gate / @wzrd_sol/sdk preSpendGate / Eliza WZRD_INTEL_TRUST.
Optional fetch wrap:
import { withTwzrdGuard } from "twzrd-x402-gate";
const safeFetch = withTwzrdGuard(x402Fetch); // free card → wash refuse by defaultInstall
npm install @wzrd_sol/goat-plugin @goat-sdk/core @goat-sdk/wallet-solanaConfiguration
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| WZRD_INTEL_URL | No | https://intel.twzrd.xyz | Agent Intel API (preflight, trust) |
| WZRD_API_URL | No | https://api.twzrd.xyz | Earn API (infer/report/claim) |
| SOLANA_PRIVATE_KEY | Earn lane only | — | Keypair bytes for agent Ed25519 auth |
Tools
Trust lane (no wallet credentials needed for preflight; GOAT adapter may still require SolanaWalletClient)
| Tool | Cost | Description |
|------|------|-------------|
| wzrd_trust_preflight | Free | ReadinessCard: decision, trust_score, caveats, next_action |
| wzrd_trust_receipt | $0.05 USDC (x402) | Paid score + V6 signed receipt + ERC-8004 reputation_credential; fail-closed by default if preflight unreachable |
| wzrd_guard_evaluate | Free | URL-first one-shot guard: probes the resource, extracts seller wallet from 402 accepts array, runs preflight. Use this when you have a URL but not the seller wallet. |
Earn lane (Solana wallet required)
| Tool | Auth | Description |
|------|------|-------------|
| wzrd_earn | Ed25519 | Full earn cycle: infer + report + rewards (one-shot) |
| wzrd_infer | Ed25519 | Server-witnessed inference; returns execution_id |
| wzrd_report | Ed25519 | Report with execution_id for verified CCM rewards |
| wzrd_claim | Ed25519 | Gasless CCM claim via relay |
| wzrd_rewards | Ed25519 | Pending + lifetime CCM balance |
Usage
Trust preflight (free API call — no x402 setup or wallet credentials needed)
import { wzrd } from '@wzrd_sol/goat-plugin';
import { getOnChainTools } from '@goat-sdk/adapter-vercel-ai';
import { solana } from '@goat-sdk/wallet-solana';
const tools = getOnChainTools({
wallet: solana({ connection, keypair }),
plugins: [wzrd()],
});
// The LLM can now call: "Preflight seller JUP6Lkb... before paying 0.25 USDC"
// → wzrd_trust_preflight fires automatically, returns decision + trust_score + next_actionwzrd_trust_preflight response:
{
"decision": "allow",
"trust_score": 72,
"can_spend": true,
"caveats": [],
"preflight_id": "pf_abc123",
"paid_deep_dive": true,
"paid_price_usdc": 0.05,
"next_action": "Safe to pay. Use wzrd_trust_receipt for a signed V6 receipt + ERC-8004 credential ($0.05 USDC)."
}URL-first guard (when you have a URL, not the seller wallet)
// "Is it safe to call https://api.exa.ai/search?"
// → wzrd_guard_evaluate probes the URL, finds the 402, extracts seller wallet, runs preflightwzrd_guard_evaluate response:
{
"url": "https://api.exa.ai/search",
"is_x402": true,
"seller_wallet": "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4",
"price_usdc": 0.003,
"decision": "allow",
"trust_score": 72,
"receipt_url": "https://intel.twzrd.xyz/v1/intel/trust/JUP6Lkb...",
"upsell_usdc": 0.05
}Routing on decision:
"block"— DO NOT PAY. Hard stop."warn"— Proceed with caution. Fetchreceipt_url($0.05 USDC to TWZRD) for a signed trust credential."allow"— Safe to proceed.is_x402: false— Not an x402-gated resource, treat as allow.
Paid trust receipt with x402 (agentcash)
import { wzrd } from '@wzrd_sol/goat-plugin';
import { createAgentcashFetch } from 'agentcash';
const tools = getOnChainTools({
wallet: solana({ connection, keypair }),
plugins: [wzrd({
x402Fetch: createAgentcashFetch({ apiKey: process.env.AGENTCASH_API_KEY }),
})],
});
// "Get the signed trust credential for seller JUP6Lkb..."
// → wzrd_trust_receipt fires: runs free preflight, pays $0.05 USDC, returns VCPaid trust receipt with x402 (PayAI)
import { wzrd } from '@wzrd_sol/goat-plugin';
import { PayAIClient } from '@payai/client';
const payai = new PayAIClient({ keypairPath: '~/.config/solana/id.json' });
const tools = getOnChainTools({
wallet: solana({ connection, keypair }),
plugins: [wzrd({ x402Fetch: (url, init) => payai.fetch(url, init) })],
});wzrd_trust_receipt response:
{
"paid": true,
"score": 61.8,
"score_version": "intel_renorm_v1",
"reputation_credential": {
"effectiveTrustScore": 62,
"trustScore": 72,
"washFactor": 0.86,
"distinctCounterparties": 14,
"corpusScope": "cross-facilitator",
"trustScoreVersion": "intel_renorm_v1"
},
"settlement_tx": "4xK3n...",
"receipt": { "version": "v6", "leaf": "0x3a4f...", "signature": "..." },
"routing_recommendation": "Allow: effectiveTrustScore=62, distinctCounterparties=14."
}Routing on reputation_credential:
const vc = result.reputation_credential;
if (!vc || vc.effectiveTrustScore < 30) return 'block';
if (vc.distinctCounterparties < 3) return 'warn'; // thin history
if (vc.washFactor < 0.5) return 'warn'; // suspicious ring activityThe effectiveTrustScore is the cross-facilitator wash-adjusted score — computed across all known x402 facilitators, not just one settlement path.
Earn loop
import { wzrd } from '@wzrd_sol/goat-plugin';
const tools = getOnChainTools({
wallet: solana({ connection, keypair }),
plugins: [wzrd()],
// SOLANA_PRIVATE_KEY env var required for earn auth
});
// "Earn CCM on WZRD" → runs wzrd_earn (infer + report + rewards in one shot)
// "Check my WZRD rewards" → wzrd_rewards
// "Claim my CCM" → wzrd_claimAgent prompts
Trust:
"Preflight seller JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 before I pay 0.25 USDC""Get the trust credential for counterparty 3Zmgnb8xk6stUjtoM5KrY5wmskqKT1jDAMVqXMFhufBB""Is it safe to call https://api.exa.ai/search?"(guard evaluate — URL only needed)
Earn:
"Run inference through WZRD: summarize this document""Check my WZRD rewards""Claim my CCM"
Links
License
MIT
