trackmcp
Back to directory
xkumakichi

xaip-protocol

View on GitHub

Provider-neutral execution evidence for AI agent tool calls — co-signed execution receipts (the agent and the caller both sign each record). Evidence before delegation.

1 stars TypeScriptOthers Updated Jul 30, 2026
aiai-agentcredentialsdecentralized-identitydidmcpreputationxrplai-agentsmcp-servertrustagentic-ailangchaintool-calling

Documentation

XAIP — Signed Execution Receipts for AI Agent Tool Calls

> Evidence before delegation. Wrap an agent's tool calls once; use the receipt history locally today, and share the same signed receipts later as portable, independently verifiable evidence.

XAIP is a provider-neutral signed execution evidence layer for AI agent tool calls. It records co-signed receipts — both the executing agent and the caller sign the same canonical record, so neither side can unilaterally fabricate one — across MCP, LangChain.js, OpenAI-compatible tool-call loops, and other runtimes, then exposes historical execution evidence that agents, developers, or policy layers can inspect before delegation.

Receipts are the primary artifact. Trust scores are one derived view over those receipts — not a claim of absolute safety or correctness.

XAIP in 30 seconds

  • Mechanism — one tool call in, one receipt out. The executing agent and the caller sign the *same* canonical record (Ed25519 over JCS), so neither side can unilaterally fabricate or repudiate it. Only hashes of input/output are carried; content never leaves your machine.
  • What you get on day one — a verifiable history of what your own agent's tools actually did, queryable *before* the next delegation (`precheck()`). Useful single-player; no network of other users required.
  • What XAIP is not — not a sandbox, not an approval engine, not a payment rail, not a safety guarantee. It makes execution evidence visible; you decide what to trust.

Pick your depth:

**3 minutes** — produce your first signed receipt ·

**10 minutes** — verify the format yourself: run the executable conformance vectors (`node check.mjs`, no dependencies), then skim the Internet-Draft it pins.

Trust Evidence Before Delegation — XAIP demo

*Live demo: three candidate servers, side-by-side comparison without and with XAIP. Open in browser →*

Provider-agnostic by design. XAIP is a trust layer for any tool-using agent. The reference implementation and live data start with MCP (Model Context Protocol) — because that's where the broadest fleet of public tool servers exists today — but the receipt format, signing, and scoring apply equally to LangChain tools, OpenAI function calling, A2A, and proprietary agent stacks. MCP is the first integration, not the only one.

Live dashboard: https://xkumakichi.github.io/xaip-protocol/ — current public trust scores, auto-refreshed, no auth. The current public dataset is MCP-heavy because MCP was the first integration target.

Entry points

Try It Now

The API is live. No signup, no API key.

bash
# Check trust score for a scored tool server
curl https://xaip-trust-api.kuma-github.workers.dev/v1/trust/context7

# Batch query
curl "https://xaip-trust-api.kuma-github.workers.dev/v1/trust?slugs=context7,sequential-thinking,filesystem"

# Decision engine: rank candidates by available execution evidence
curl -X POST https://xaip-trust-api.kuma-github.workers.dev/v1/select \
  -H "Content-Type: application/json" \
  -d '{"task":"Fetch React docs","candidates":["context7","sequential-thinking","unknown-server"]}'

The `/v1/select` response tells you which server to use, why, and what would happen without XAIP:

json
{
  "selected": "context7",
  "reason": "Highest trust among scored candidates based on current verified receipts",
  "rejected": [{ "slug": "unknown-server", "reason": "unscored — no execution evidence available" }],
  "withoutXAIP": "Random selection would pick an unscored server 33% of the time — no execution evidence available"
}

The Problem

Without trust scores, your agent is gambling:

code
┌────────────────┬────────────────┬───────────┬──────────────┐
│ Strategy       │ Server Hit     │ Success   │ Latency      │
├────────────────┼────────────────┼───────────┼──────────────┤
│ With XAIP      │ context7       │ ✓         │ ~3s          │
│ Random         │ unknown-mcp    │ ✗ error   │ ~8s (wasted) │
│ Try all (seq)  │ 3 servers      │ 1/3       │ ~11s total   │
└────────────────┴────────────────┴───────────┴──────────────┘

XAIP helps agents prefer candidates with stronger available execution evidence, skip unscored candidates when appropriate, and reduce avoidable failed calls.

How It Works

code
1. Select    POST /v1/select → ranks candidates by available execution evidence
2. Execute   Your agent calls the selected tool server
3. Report    POST /receipts → signed execution receipt feeds back into trust scores

Every execution receipt is Ed25519-signed and verified. Trust scores are computed using a Bayesian model with caller diversity weighting — not self-reported metrics.

Quick Start — your first signed receipt in under 5 minutes

The fastest path is the Claude Code hook: your normal MCP tool calls start

producing signed receipts, with nothing but hashes leaving your machine.

Measured end-to-end on a clean Windows 11 profile (Node 24, npm 11) — total

command time was about 8 seconds; the steps are identical on macOS/Linux.

Quick start replay — install, one tool call, one signed receipt, verification, precheck

*(Terminal replay rendered from the real captured outputs of that measurement — generator script.)*

1. Install

bash
npm install -g xaip-claude-hook

2. One command

bash
xaip-claude-hook install
code
✓ XAIP Claude Code hook installed.
  C:\Users\you\.claude\settings.json

Next MCP tool call will emit a signed receipt to
  https://xaip-aggregator.kuma-github.workers.dev

3. One tool call

Open a new Claude Code session and let it call any MCP tool (for example,

ask it to look up a library with context7). The hook signs and submits a

receipt automatically — you do nothing.

4. One signed receipt

bash
cat ~/.xaip/hook.log
code
2026-07-17T03:41:57.964Z POST context7/resolve-library-id ok=true lat=2402ms → 200 {"ok":true,"agentDid":"did:web:context7","callerVerified":true}

`callerVerified: true` is the aggregator confirming your Ed25519 caller

signature over the canonical receipt payload. Only hashes and metadata (tool

name, latency, success) were sent — never inputs, outputs, or file paths, and

the log shows exactly what left the machine.

5. One verification result

bash
curl https://xaip-trust-api.kuma-github.workers.dev/v1/trust/context7
json
{ "slug": "context7", "trust": 0.926, "receipts": 1044,
  "source": "xaip-aggregator-1 (single aggregator)" }

6. One precheck result — no invented trust

bash
curl -X POST https://xaip-trust-api.kuma-github.workers.dev/v1/select \
  -H "Content-Type: application/json" \
  -d '{"task":"summarize a webpage","candidates":["context7","my-brand-new-server"]}'
json
{ "selected": "context7",
  "reason": "Only eligible candidate (trust 0.926, 1044 verified executions)",
  "rejected": [ { "slug": "my-brand-new-server",
                  "reason": "unscored — no execution evidence available" } ] }

This is the cold-start behavior, shown honestly: a server nobody has executed

is `unscored`, not given a synthetic score. Evidence accumulates as receipts

arrive; XAIP does not fabricate trust for tools without execution history.

If something doesn't work

  • Hook never fires — the hook command must be resolvable when Claude Code

spawns it: check that your npm global bin directory (`npm config get prefix`)

is on `PATH`, then start a fresh session.

  • PowerShell says "running scripts is disabled" — Windows' default

execution policy blocks npm's `.ps1` shims for interactive commands. Use

`xaip-claude-hook.cmd`, run it from `cmd`, or

`Set-ExecutionPolicy -Scope CurrentUser RemoteSigned`. Receipt emission is

unaffected (the hook runs via the `.cmd` shim).

  • Turn it off — `export XAIP_DISABLED=1` disables temporarily;

`xaip-claude-hook uninstall` removes the hook (keys/logs under `~/.xaip/`

stay until you delete them). Receipts are pseudonymous: your caller DID is a

per-install key, linked to nothing else.

Run the end-to-end demo

bash
git clone https://github.com/xkumakichi/xaip-protocol.git
cd xaip-protocol/demo
npm install
npx tsx dogfood.ts

This demo:

1. Asks XAIP to rank candidate servers for "Fetch React hooks documentation" by available execution evidence

2. Connects to the selected MCP server and executes real tool calls

3. Submits a signed execution receipt to the Aggregator

4. Shows the updated trust score

Decision quality demo

Compare blind selection strategies against XAIP-guided selection using a static trust snapshot and fixed candidate sets:

bash
cd demo
npm run blind-vs-xaip

This is a deterministic local replay. It does not perform live tool execution, post receipts, or call any external API.

See docs/blind-vs-xaip-demo.md for scope, metrics, and limitations.

In the included snapshot replay:

StrategyRisky pick rateEligible pick rate
Random71.4%28.6%
Fixed-order85.7%14.3%
XAIP14.3%85.7%

`risky_pick` = selected candidate was `low_trust` or `unscored` in the snapshot. `fixed-order` models an agent that accepts the upstream planner's candidate order without runtime trust data. The claim is limited to this fixed candidate set and static trust snapshot — not a guarantee of real-world execution improvement.

Become an independent caller

Want the trust graph to depend on more than one operator? Run a caller yourself. No account, no approval, no API key — the aggregator verifies signatures from any valid keypair.

Fastest — zero-install, 30 seconds:

bash
npx xaip-caller

Signs receipts for a handful of real HTTP tool calls and POSTs them. Demonstrates that XAIP works beyond MCP — any HTTP tool can participate. See clients/caller.

See Run xaip-caller for Windows notes and external receipt contribution details.

Full path — MCP servers, 5 minutes:

Clone the repo and run the auto-collector against real MCP servers. Your caller DID contributes to the diversity of every scored MCP tool. See docs/contributor/run-a-caller.md.

Use the SDK

bash
npm install xaip-sdk
typescript
import { precheck } from "xaip-sdk";

const result = await precheck({
  task: "Fetch React documentation",
  candidates: ["context7", "memory", "unknown-server"],
  includeDecision: true,
});

console.log(result.selected); // e.g. "memory" or null
console.log(result.decision); // "allow", "warn", or "unknown"

`precheck()` is a thin SDK wrapper over `POST /v1/select`. It returns available execution evidence for tool, skill, or agent candidates before your code decides what to delegate.

See the precheck() API guide for boundaries, policy options, result shape, and errors.

MCP Server

Use XAIP directly from Claude, Cursor, or any MCP-compatible AI agent:

bash
npx xaip-mcp-trust

4 tools: `xaip_list_servers`, `xaip_check_trust`, `xaip_select`, `xaip_report`

Add to Claude Code (`~/.claude/claude_desktop_config.json`):

json
{
  "mcpServers": {
    "xaip-trust": {
      "command": "npx",
      "args": ["-y", "xaip-mcp-trust"]
    }
  }
}

npm: xaip-mcp-trust

API Reference

MethodEndpointDescription
`GET``/v1/servers`List all scored servers with trust data
`GET``/v1/trust/:slug`Trust score for a single scored server
`GET``/v1/trust?slugs=a,b,c`Batch trust scores (max 50)
`POST``/v1/select`Decision engine — rank candidates by available execution evidence
`GET``/health`Liveness probe

Base URL: `https://xaip-trust-api.kuma-github.workers.dev`

Trust Score Response

FieldTypeDescription
`trust``number \null`0.0–1.0 score, null if unscored
`verdict``string``trusted` ≥0.7 · `caution` 0.4–0.7 · `low_trust`
  • Executable conformance test vectors: `docs/spec/test-vectors/` — every hash, canonical payload, and signature is real; `node check.mjs` re-derives all of them (Node ≥ 18, no dependencies)

This is an individual Internet-Draft. It is not an IETF standard, not IETF-approved, and has no formal standing in the IETF standards process. The draft scope is the receipt wire format only — scoring, aggregation, and decision logic are deployment policy and out of scope of the draft itself.

Cite as (work in progress — cite the specific revision for reproducibility):

> xkumakichi, "Signed Execution Receipts for AI Agent Tool Calls (XAIP Receipts)", Work in Progress, Internet-Draft, draft-xkumakichi-xaip-receipts-03, 2 July 2026, .

BibTeX and BibXML exports are available from the Datatracker page linked above.

Writing

  • Portable Trust — why trust infrastructure for AI agents must be provider-neutral and behavior-derived (dev.to · Zenn 日本語版)
  • Evidence Before Payment — the agent-payment stack describes the transaction at hand; portable evidence of a counterparty's prior execution stays thin. Defines that design problem, independent of any one implementation (article)
  • xaip-caller — zero-install CLI: `npx xaip-caller` to contribute to the trust graph
  • xaip-mcp-trust — MCP server for AI agents to check trust scores
  • xaip-langchain — LangChain.js callback handler that emits XAIP receipts
  • xaip-openai — OpenAI tool-calling wrapper with signed receipts
  • Veridict — earlier runtime execution logging experiment that informed XAIP's receipt-first design. Previously published as an npm package; not maintained as an independent product.
  • XAIP Specification v0.4 — Current protocol specification
  • XAIP Specification v0.5 RC — Release candidate (tool class taxonomy)

License

MIT

Frequently asked questions

What is xaip-protocol?

xaip-protocol is Provider-neutral execution evidence for AI agent tool calls — co-signed execution receipts (the agent and the caller both sign each record). Evidence before delegation.

How do I install xaip-protocol?

Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

Is xaip-protocol open source?

Yes — it is hosted on GitHub at https://github.com/xkumakichi/xaip-protocol and has 1 stars.

Related MCP tools

Run your own MCP server? See who uses it and what to fix.

Measure it with TrackMCP