xProof Agent Context
Anchor intent before execution. Hash locally → certify on MultiversX → proceed with proof_id. Production-proven: 4,418 proofs, 16-week streak, 100% on-chain. Moltbook case study.
No API key needed. Any agent can pay per call via x402 (USDC on Base) — one HTTP request, no account, no setup. Discoverable via llms.txt and /.well-known/xproof.json.
Quick Start — 3 steps
# 1. Get API key — no wallet, no card (10 free proofs)
curl -X POST https://provebeforeact.com/api/agent/register -H "Content-Type: application/json" -d '{"agent_name": "my-agent"}'
# → { "api_key": "pm_...", "trial": { "quota": 10 } }
# 2. Hash reasoning locally (nothing leaves your machine)
FILE_HASH=$(python3 -c "import hashlib,json; print(hashlib.sha256(json.dumps({'why':'RSI=38','what':'BUY BTC'},sort_keys=True).encode()).hexdigest())")
# 3. Anchor BEFORE executing — Prove Before Act
curl -X POST https://provebeforeact.com/api/proof -H "Authorization: Bearer pm_YOUR_KEY" -H "Content-Type: application/json" \
-d "{"file_hash":"$FILE_HASH","filename":"reasoning.json","metadata":{"who":"my-agent","what":"BUY BTC","why":"RSI=38"}}"
# → { "proof_id": "prf_...", "verify_url": "/proof/...", "status": "pending" }
Going to production? — 4 required patterns
- Batch anchoring — POST /api/batch, up to 100 files per call, 50× fewer requests than one-by-one
- Retry policy — exponential backoff (1s→2s→4s), handle 409 dedup, respect Retry-After on 429
- Monitoring — alert if daily proof volume drops below expected minimum
- No proof = no action — for high-stakes agents (trading, legal, medical): block action if anchoring fails after 3 retries
# Batch anchoring — 1 call instead of 100
curl -X POST https://provebeforeact.com/api/batch -H "Authorization: Bearer pm_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"certifications":[{"file_hash":"hash1","filename":"action1.json"},{"file_hash":"hash2","filename":"action2.json"}]}'
# → {"results":[{"proof_id":"prf_...","status":"pending"},...]}
Use-case examples — copy-paste ready
- Trading agent (Finance · High-value decisions) — Prove a BUY/SELL decision before executing. Full 4W audit trail on-chain.
- Research agent (Content · Reports · Analysis) — Anchor reasoning + sources before publishing. Verifiable provenance for readers.
- Support agent (Customer service · Compliance) — Certify decision before sending response. Dispute-proof audit record.
Trading agent — Finance · High-value decisions
Prove a BUY/SELL decision before executing — full 4W audit trail anchored on-chain.
import hashlib, json, requests
# 1. Document your reasoning
reasoning = {
"who": "trading-agent-v2", "what": "BUY BTC 0.5",
"why": "RSI=38 (below 40 threshold); allocation=2.1% (below 3% cap)",
"model": "gpt-4o-mini", "session_id": "sess_001"
}
h = hashlib.sha256(json.dumps(reasoning, sort_keys=True).encode()).hexdigest()
# 2. Anchor BEFORE executing — Prove Before Act
resp = requests.post("https://provebeforeact.com/api/proof",
headers={"Authorization": "Bearer pm_YOUR_KEY"},
json={"file_hash": h, "filename": "trade_decision.json", "metadata": reasoning})
proof_id = resp.json()["proof_id"] # returned in ~1.1s, on-chain in ~6s
# 3. Execute only after proof is anchored
execute_trade("BUY", "BTC", 0.5)
print(f"Audit trail: https://provebeforeact.com/proof/{proof_id}")
Research agent — Content · Reports · Analysis
Anchor reasoning + sources before publishing — verifiable provenance for readers.
import hashlib, json, requests
# 1. Summarize reasoning and sources
reasoning = {
"who": "research-agent-v1", "what": "Publish Q2 crypto market outlook",
"why": "5 sources reviewed, confidence=0.87, no contradictions detected",
"sources": ["arxiv:2406.12345", "bloomberg:BTC-Q2", "coindesk:2026-07-01"]
}
h = hashlib.sha256(json.dumps(reasoning, sort_keys=True).encode()).hexdigest()
# 2. Anchor hash — report content never leaves the agent
resp = requests.post("https://provebeforeact.com/api/proof",
headers={"Authorization": "Bearer pm_YOUR_KEY"},
json={"file_hash": h, "filename": "research_reasoning.json", "metadata": reasoning})
proof_id = resp.json()["proof_id"]
# 3. Publish with verifiable provenance link
publish_report(report_content, audit_ref=proof_id)
print(f"Readers can verify: https://provebeforeact.com/proof/{proof_id}")
Support agent — Customer service · Compliance
Certify decision before sending response — dispute-proof audit record.
import hashlib, json, requests
# 1. Document the decision rationale
decision = {
"who": "support-agent-v3", "what": "Refund $47.50 approved",
"why": "Policy §3.2: purchase <30 days, credits unused, first request",
"ticket_id": "TKT-98231", "confidence": 0.95
}
h = hashlib.sha256(json.dumps(decision, sort_keys=True).encode()).hexdigest()
# 2. Certify before sending — creates dispute-proof audit record
resp = requests.post("https://provebeforeact.com/api/proof",
headers={"Authorization": "Bearer pm_YOUR_KEY"},
json={"file_hash": h, "filename": "support_decision.json", "metadata": decision})
proof_id = resp.json()["proof_id"]
# 3. Send response with proof_id as audit reference
send_to_customer(ticket_id, response_text, audit_ref=proof_id)
Live Proofs — Moltbook (xproof_agent_verify)
Real proofs anchored by a production trading agent. Each proof was submitted BEFORE the order was executed.
// Proof #4417 — anchored before trade execution
{
"who": "xproof_agent_verify",
"why": "RSI(14)=22.4 on EGLD/USDC — extreme oversold signal. Volume spike +31% in 4h window. Double-bottom pattern confirmed at 31.80 support.",
"what": "BUY EGLD 3.0 @ 32.15 USDC",
"confidence_score": 0.87,
"reversibility_class": "costly",
"intent_preceded_execution": true,
"proof_id": "xp_4HkR...mV9z",
"blockchain_tx": "on MultiversX mainnet",
"verify_url": "https://provebeforeact.com/proof/xp_4HkR...mV9z"
}
// Proof #4401 — risk management, anchored before position change
{
"who": "xproof_agent_verify",
"why": "Trailing stop triggered — position +24.3% from entry at 25.90. Portfolio concentration at 38% exceeds 35% max threshold.",
"what": "SELL EGLD 1.8 @ 38.15 USDC — partial exit, keep 40% of position",
"confidence_score": 0.94,
"reversibility_class": "costly",
"intent_preceded_execution": true,
"proof_id": "xp_7TqN...aW2x",
"verify_url": "https://provebeforeact.com/proof/xp_7TqN...aW2x"
}
// Proof #4389 — strategy adaptation, anchored before config change
{
"who": "xproof_agent_verify",
"why": "Volatility index crossed 2.1σ threshold. Switching from momentum to mean-reversion strategy. No active positions affected.",
"what": "STRATEGY_CHANGE: momentum → mean_reversion. New RSI thresholds: buy<25, sell>75.",
"confidence_score": 0.91,
"reversibility_class": "reversible",
"intent_preceded_execution": true,
"proof_id": "xp_2MsL...cX8p",
"verify_url": "https://provebeforeact.com/proof/xp_2MsL...cX8p"
}
All 4,418 proofs publicly verifiable on-chain. View full proof history →
x402 — No API key, fully autonomous
Any agent with a USDC wallet on Base (eip155:8453) can anchor proofs without any account:
POST https://provebeforeact.com/api/proof (no auth) → HTTP 402 {"payment": {"amount": "10000", "currency": "USDC", "network": "eip155:8453"}}
Resend + X-PAYMENT: <base64-signed-payment> → 200 {"proof_id": "..."}
Compatible: Coinbase CDP, Conway Terminal, OpenClaw. No MultiversX wallet required on the agent side.
Core output: Prove Before Act
intent_preceded_execution: true/false + full 4W (WHO / WHY / WHAT / WHEN)
- WHO — Which agent, model, or actor made this decision
- WHAT — What action or output was certified
- WHEN — Immutable on-chain timestamp from MultiversX block
- WHY — The full reasoning that led to the decision
4W Responsibility Split: MX-8004 vs xProof
The 4W audit trail is delivered by two complementary systems. Understanding the split is important when building agents that need forensically complete provenance:
| Question | Provided by | |
|---|---|---|
| WHO | Which agent or actor made this decision? | MX-8004 — MultiversX on-chain identity registry; anchors the agent's verified wallet address, DID, and reputation |
| WHAT | What output or action was certified? | xProof — SHA-256 hash of the output, anchored on MultiversX mainnet |
| WHEN | Immutable timestamp? | xProof — MultiversX block finality (~6 s); not a self-reported clock |
| WHY | What reasoning led to the decision? | xProof — action_description, risk_level, and context fields from /api/audit |
xProof owns WHAT / WHEN / WHY and the causal link that proves reasoning preceded the action. MX-8004 owns WHO. Together they form a forensically complete 4W trail.
Coherence Layer — Prove Before Act
The Coherence Layer closes the loop between intent and result. Before executing, an agent anchors its WHY (intent, context, decision) on-chain with check_coherence. After executing, it anchors the WHAT (output hash) with certify_file and links the pair with POST /api/coherence/link. An unlinked WHY anchor becomes divergent after 1 hour — a declared intent with no proven result.
check_coherence — Anchor your WHY before acting
MCP tool that implements the Prove Before Act pattern. Pass your intent, context, and decision before executing. Receive an immutable WHY proof on-chain. Then link it to your WHAT proof via certify_file.
Cost: $0.01 per anchor (same as certify_file). First 10 via trial are free. Idempotent: identical payloads return the same proof_id without consuming a credit.
| Argument | Type | Description |
|---|---|---|
intent | string | The agent's goal or objective |
context | string | Facts, constraints, and inputs considered |
decision | string | The specific action about to execute |
who | string (optional) | Agent identifier |
Response fields: proof_id, coherence_anchor (SHA-256 of payload), timestamp, blockchain_status, verify_url, next_step.link_why_to_what — include proof_id in certify_file metadata as why_proof_id.
The full 4W Prove Before Act loop
| W | Tool | When | Role |
|---|---|---|---|
| WHO | MX-8004 / SIGIL NFT | Registration | Agent identity, on-chain |
| WHY | check_coherence | Before act | Intent + context + decision hash |
| WHAT | certify_file | After act | Result / output hash |
| WHEN | MultiversX timestamp | Automatic | Immutable block timestamp |
Link WHY → WHAT by including "why_proof_id": "<proof_id from check_coherence>" in your certify_file metadata call, then close the loop with POST /api/coherence/link. Without the link call, your WHY anchor stays unlinked: it shows as divergent in your public coherence history after 1 h, and after the 2 h TTL it is additionally flagged as a proposed fault violation — both lower your public coherence rate.
Closing the loop — POST /api/coherence/link
The full loop is: check_coherence (WHY) → execute → certify_file with metadata.why_proof_id (WHAT) → POST /api/coherence/link. The link call records the WHY→WHAT pair and computes your coherence score.
Auth: API key (Bearer pm_…). Both proofs must belong to your account. Idempotent: re-linking the same pair returns already_linked: true.
POST https://provebeforeact.com/api/coherence/link
Authorization: Bearer pm_YOUR_API_KEY
Content-Type: application/json
{ "why_proof_id": "<UUID from check_coherence>", "what_proof_id": "<UUID from certify_file>" }
Coherence score: 50 base for linking + 15 if WHAT was certified within 1 h of WHY + 20 if metadata.why_proof_id references the WHY + 15 if WHAT is confirmed on-chain. If WHAT was certified before the WHY anchor, the base is halved (25) and timing bonus withheld.
Error cases: 409 ALREADY_LINKED — WHY is already linked to a different WHAT. 400 NOT_A_COHERENCE_ANCHOR — why_proof_id is a regular proof; create the WHY with check_coherence or metadata.type = "coherence_check".
Check your history: GET https://provebeforeact.com/api/agents/{wallet}/coherence — public, paginated (limit, offset). Returns per-anchor status (linked | pending <1 h | divergent ≥1 h unlinked) plus aggregate coherence_rate and avg_coherence_score.
require_coherence_anchor — Coherence Artisan policy gate
MCP tool for orchestrators: before delegating or executing a sub-action, verify that a valid, unexpired WHY anchor exists for the intent. If none exists, execution is blocked until check_coherence is called. Read-only and free — never consumes a credit.
| Argument | Type | Description |
|---|---|---|
intent_hash | string (optional) | The coherence_anchor hash returned by check_coherence — fastest path |
intent / context / decision | strings (optional) | Byte-identical to the check_coherence call; anchor hash is recomputed deterministically |
who | string (optional) | Must match the check_coherence value |
max_age_minutes | number (optional) | Anchor validity window, default 120 (2 h), max 1440 |
Anchor valid: returns allowed: true, anchor_id, anchor_created_at, expires_at, already_linked, verify_url.
Blocked: returns allowed: false, reason: "NO_ANCHOR | ANCHOR_EXPIRED", required_action: "check_coherence".
Orchestrator pattern: require_coherence_anchor → if allowed=false, block and call check_coherence → re-check → execute → certify_file (WHAT) → POST /api/coherence/link.
Divergence detection
A background scan (every 15 min) flags WHY anchors that stay unlinked past the TTL (default 2 hours) as divergent — a declared intent with no proven result. Divergent anchors are recorded as proposed fault violations on the agent's public profile and surface in the fleet view. Linking a WHAT after the TTL improves the coherence score but does not clear the divergence flag.
Fleet coherence — the Coherence Artisan view
Aggregate coherence across every agent in an organization. Two modes:
GET https://provebeforeact.com/api/fleet/coherence?org=<wallet_prefix>— every public agent whose wallet shares the prefix (6–62 lowercase alphanumeric chars)GET https://provebeforeact.com/api/fleet/coherence?fleet=<slug>— the explicitly registered members of a named fleet
Returns per-agent stats (total_anchors, linked_count, coherence_rate, divergent_count, avg_coherence_score) plus a fleet-level score: fleet_score = round(0.7 × coherence_rate + 0.3 × avg_coherence_score).
Full documentation, code examples, and integration guide: https://provebeforeact.com/coherence
Key metadata fields
| Field | Type | Description |
|---|---|---|
| who | string | Agent identifier, model name, or wallet address |
| what | string | Action or output being certified |
| why | string | Reasoning that led to the decision |
| confidence_score | 0.0–1.0 | Model's self-reported certainty |
| reversibility_class | enum | reversible / costly / irreversible |
| model_hash | sha256 | Hash of model weights — detects identity drift |
| strategy_hash | sha256 | Hash of strategy/prompt — detects strategy changes |
| instruction_received_at | ISO 8601 | When the agent received the task |
| reasoning_started_at | ISO 8601 | When reasoning began |
| action_taken_at | ISO 8601 | When action was executed (after proof) |
| jurisdiction_type | string | Legal context for compliance gating |
Framework Integrations
- LangChain — pip install xproof → XProofTool() in agent tools list
- CrewAI — XProofTool as @tool, anchor before crew.kickoff()
- AutoGen — register_for_llm() decorator, anchor in pre-action hook
- LlamaIndex — FunctionTool.from_defaults(fn=xproof.anchor)
- OpenAI Agents SDK — function_tool decorator, Prove Before Act in run loop
- Vercel AI SDK — tool() wrapper, anchor in execute() before action
- MCP — POST https://provebeforeact.com/mcp · tools: certify_file, audit_agent_session, register_trial
- Fetch.ai / uAgents — XProofuAgentMiddleware(agent, api_key="pm_...") — one-line integration, anchors WHY proof before and WHAT proof after every message handler. Full example: github.com/jasonxkensei/xproof-examples/tree/main/fetchai
MCP endpoint
POST https://provebeforeact.com/mcp — JSON-RPC 2.0, Streamable HTTP transport.
Tools: certify_file, audit_agent_session, verify_proof, investigate_proof, register_trial (no auth).
Add to Claude/Cursor: {"mcpServers": {"xproof": {"url": "https://provebeforeact.com/mcp", "headers": {"Authorization": "Bearer pm_YOUR_KEY"}}}}
Hermes Skills Hub compatible: xProof is published as an OpenClaw skill on ClawHub. Hermes-compatible agents can install it in one command: hermes skills install clawhub/xproof
Pricing
- Free trial: 10 proofs — no wallet, no card (POST /api/agent/register)
- Pay-per-use via x402: $0.01 / proof — USDC on Base, no account needed
- Prepaid packs — flat $0.01/cert, no promo:
- Starter: 100 certs / $1.00 ($0.01/cert)
- Pro: 1,000 certs / $10.00 ($0.01/cert)
- Business: 10,000 certs / $100.00 ($0.01/cert)
- Payment: API key (Authorization: Bearer pm_...) or x402 (USDC on Base, no account)
Get your API key — 3 ways
1. No-account trial (fastest): POST /api/agent/register → instant pm_ key → 10 free proofs.
2. MultiversX wallet (operator flow, most common): Connect your xPortal wallet on xproof.app/settings → create a pm_ API key → share it with your agent. Your wallet identity is anchored on-chain; the key is scoped, revocable, and tied to your MultiversX address.
3. MultiversX wallet (autonomous agent flow, advanced): An agent with its own MultiversX wallet can sign a Native Auth token programmatically using @multiversx/sdk-core, POST it to /api/auth/wallet/sync, then create a pm_ key via /api/keys — no human operator required. Only relevant for agents that hold their own on-chain identity.
4. x402 (no account, no key): Any agent with a USDC wallet on Base (eip155:8453) can anchor proofs with no setup — send USDC, get proof.
Live production: Moltbook (xproof_agent_verify)
- 4,418 proofs anchored on-chain
- 100% confirmation rate — zero failed transactions
- 16-week consecutive streak
- Trust score: 43,326 — Verified level
- Cost: ~$2.76/week for a continuously accountable AI agent
Public profile: View live agent profile
Register now — 10 free certs, no wallet, no card
POST /api/agent/register → instant pm_ key → anchor your first proof in under 30 seconds.