AgentTrust
AgentTrust
Getting started

Quickstart

Hit the hosted devnet build, install the SDK, wire the MCP server. Three paths, no clone, under five minutes.

Three live paths. Each runs against the hosted devnet endpoints under *.agenttrust.tech. None require a local clone.

1. Hit the live demo

The demo at demo.agenttrust.tech runs the full Pay.sh + AgentTrust flow against deployed devnet programs. With no payment proof, /protected returns a real x402 v2 challenge:

curl -i https://demo.agenttrust.tech/protected

The response carries HTTP/2 402 with a SERVICE-signed payment-required envelope (base64). To walk the full Allow → settle → emit_feedback path, install Pay.sh and let it pay:

pay --sandbox curl https://demo.agenttrust.tech/protected

Three deterministic counterparties drive each decision branch. Fetch their pubkeys from the demo's health endpoint:

curl -s https://demo.agenttrust.tech/health | jq '.counterparties'
TierHeaderDecision
0X-Demo-Payer-Agent: <tier-0 pubkey>402 Deny — CounterpartyTierBelowMin
1X-Demo-Payer-Agent: <tier-1 pubkey>402 Deny — CounterpartyTierBelowMin
3X-Demo-Payer-Agent: <tier-3 pubkey>200 Allow + X-Payment-Receipt

The full atomic-settlement trace (gate, transfer, feedback) for the tier-3 path is captured under Verification → Devnet smoke.

2. Install the SDK

Add @agenttrust-sdk/trustgate to any Node project:

pnpm add @agenttrust-sdk/trustgate

Mount the middleware on an Express app:

import express from "express";
import { Keypair } from "@solana/web3.js";
import { mountTrustGate } from "@agenttrust-sdk/trustgate/express";

const app = express();
app.use(express.json());

await mountTrustGate(app, {
  rpcUrl:             "https://api.devnet.solana.com",
  facilitatorKeypair: Keypair.fromSecretKey(/* your facilitator key */),
  network:            "solana-devnet",
  atomicityEnforced:  true,             // literal `true` — TS rejects `false`
});

app.listen(3000);

The atomicityEnforced: true literal is the SDK's load-bearing guard. The compile-time type rejects callers who omit it, the runtime throws on as any bypasses, and the on-chain gate_payment_strict_correctness Kani proof binds the strict handler's return value to the composer's Allow arm. Full details: Atomic-tx invariant.

You now have:

  • POST /verify — read-only gate_payment simulation
  • POST /settle — one-tx atomic settle (gate + transfer + feedback)
  • POST /dispute — dispute path
  • GET /receipt/:hashFeedbackEmissionLog lookup by payment hash

3. Wire the MCP server

@agenttrust-sdk/mcp exposes 21 tools to any Model Context Protocol client. For Claude Desktop, drop this into your config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "agenttrust": {
      "command": "npx",
      "args": ["-y", "@agenttrust-sdk/mcp"],
      "env": {
        "RPC_URL": "https://api.devnet.solana.com",
        "NETWORK": "solana-devnet"
      }
    }
  }
}

Restart Claude Desktop. Then ask:

  • "What demo agents are available on AgentTrust?"
  • "Simulate a 5-USDC payment from the tier-3 demo agent to the tier-0 demo agent against policy 1. What does the gate decide?"
  • "Search the AgentTrust docs for the atomic-tx invariant."

A hosted HTTP transport is also live at mcp.agenttrust.tech for clients that speak StreamableHTTPServerTransport. Full setup: MCP → Install.

What's running where

SurfaceURL
Demodemo.agenttrust.tech
Facilitator (/verify + /settle)api.agenttrust.tech
MCP HTTP endpointmcp.agenttrust.tech
Repogithub.com/agenttrust-labs/agenttrust

On this page

⌘I