# Prove Before Act — Prove Before & After Act > Start with 10 free proofs. No wallet, credit card, payment setup, or file upload is required. **Prove Before & After Act**: declare and hash a decision basis (WHY: intended action, context, and justification) BEFORE executing any significant agent action, then anchor the actual result (WHAT) AFTER. Never provide internal chain-of-thought. The hash stays local — nothing sensitive leaves the agent. **Production reference**: xproof_agent_verify (legacy agent identifier, Moltbook) has a public live profile. Read its current proof totals, confirmation-status breakdown, streak and trust score at https://provebeforeact.com/agent/erd1hlx4xanncp2wm9aly2q6ywuthl2q9jwe9sxvxpx4gg62zcrvd0uqr8gyu9 rather than relying on a static snapshot. **4W breakdown — optional WHO from MX-8004, WHAT/WHEN/WHY from Prove Before Act:** | | Question | Provided by | |:--|:--|:--| | WHO | Which agent or actor made this decision? | MX-8004 — optional identity integration; inspect /api/mx8004/status before relying on it | | WHAT | What output or action was certified? | Prove Before Act — SHA-256 hash of the output, anchored on MultiversX mainnet | | WHEN | Immutable timestamp? | Prove Before Act — MultiversX block finality (~6 s); not a self-reported clock | | WHY | What declared decision basis supported the action? | Prove Before Act — action_description, risk_level, and context fields from /api/audit | Prove Before Act records WHAT / WHEN / WHY. MX-8004 can add WHO when configured; check the live status endpoint and each validation job separately. ## About Prove Before Act is the production proof layer for AI agents — not a generic file storage or EVM attestation tool. It anchors SHA-256 hashes on MultiversX and builds a public, verifiable trust profile for every agent: certifications, audit logs, trust score, violations, and confidence-level stages. ## Free Trial — Start Here Get 10 free certifications instantly. No wallet, no payment, no browser. One HTTP call to register: \`\`\`bash curl -X POST https://provebeforeact.com/api/agent/register \\ -H "Content-Type: application/json" \\ -d '{"agent_name": "my-agent"}' \`\`\` Returns an API key (pm_xxx). The full secret is disclosed only in this private registration response. Retain it in the current execution context: it remains usable until revoked even though no later endpoint will display it again. Check quota and your certifications at any time: \`\`\`bash curl https://provebeforeact.com/api/me -H "Authorization: Bearer pm_YOUR_API_KEY" \`\`\` Returns: trial_remaining, trial_used, total certifications. Each POST /api/proof response also includes an \`X-Trial-Remaining\` header. ## Quick Start (for AI agents) This section is the canonical zero-knowledge activation contract. If another document is less specific, follow this sequence and the live response fields. ### REST API PBA does not require uploading the decision file. Hash the artifact locally and submit only its SHA-256 hash. Canonical activation path: 1. Register and retain the returned API key in the current private context. 2. Hash `decision.json` locally. 3. Create proof #1 with `POST /api/proof` and the Bearer header. 4. Open the returned `verify_url`. 5. Repeat with a different artifact/hash for proof #2 and open its `verify_url`. #### curl \`\`\`bash FILE_HASH=$(sha256sum decision.json | awk '{print $1}') curl -X POST https://provebeforeact.com/api/proof \\ -H "Authorization: Bearer pm_YOUR_API_KEY" \\ -H "Content-Type: application/json" \\ -d "{\"file_hash\":\"$FILE_HASH\",\"filename\":\"decision.json\"}" \`\`\` #### JavaScript / TypeScript \`\`\`typescript import { readFile } from "node:fs/promises"; import { createHash } from "node:crypto"; const fileHash = createHash("sha256").update(await readFile("decision.json")).digest("hex"); const response = await fetch("https://provebeforeact.com/api/proof", { method: "POST", headers: { "Authorization": "Bearer pm_YOUR_API_KEY", "Content-Type": "application/json" }, body: JSON.stringify({ file_hash: fileHash, filename: "decision.json" }) }); const proof = await response.json(); console.log(proof.verify_url); \`\`\` #### Python \`\`\`python import hashlib import requests with open("decision.json", "rb") as artifact: file_hash = hashlib.sha256(artifact.read()).hexdigest() proof = requests.post( "https://provebeforeact.com/api/proof", headers={"Authorization": "Bearer pm_YOUR_API_KEY"}, json={"file_hash": file_hash, "filename": "decision.json"}, ).json() print(proof["verify_url"]) \`\`\` Response: proof_id, verify_url, certificate_url, blockchain transaction hash, webhook_status. Optional: include \`webhook_url\` to receive a signed POST notification (HMAC-SHA256) when the proof is confirmed. Retries up to 3 times. ### Batch API Certify up to 50 files in one call: \`\`\`bash curl -X POST https://provebeforeact.com/api/batch \\ -H "Authorization: Bearer pm_YOUR_API_KEY" \\ -H "Content-Type: application/json" \\ -d '{"files": [{"file_hash": "...", "filename": "file1.pdf"}, {"file_hash": "...", "filename": "file2.sol"}]}' \`\`\` ### MCP (Model Context Protocol) Connect via JSON-RPC 2.0 over Streamable HTTP at POST /mcp (Streamable HTTP, spec 2025-03-26). **Critical:** every request must include \`Accept: application/json, text/event-stream\` or the server returns "Not Acceptable". \`\`\`bash curl -X POST https://provebeforeact.com/mcp \\ -H "Content-Type: application/json" \\ -H "Accept: application/json, text/event-stream" \\ -H "Authorization: Bearer pm_YOUR_API_KEY" \\ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' \`\`\` Available tools (auth: Bearer pm_YOUR_API_KEY except where noted): - \`register_trial\` — **START HERE** — get 10 free certifications instantly, **no auth required** - \`certify_file\` — certify a file hash on MultiversX blockchain - \`certify_with_confidence\` — staged certification with confidence score (initial/partial/pre-commitment/final), shared decision_id, reversibility governance - \`verify_proof\` — verify an existing certification - \`get_proof\` — retrieve a proof in JSON or Markdown format - \`discover_services\` — discover services and pricing, **no auth required** - \`audit_agent_session\` — certify a full agent decision (WHY + WHAT dual-proof); operators may use the returned proof_id in their own execution policy - \`check_attestations\` — check third-party trust attestations for an agent wallet - \`investigate_proof\` — full 4W audit trail reconstruction (x402 paid or API key) - \`check_coherence\` — anchor WHY intent before executing (Prove Before Act); $0.01/anchor, first 10 free; idempotent on identical payloads - \`require_coherence_anchor\` — policy gate for orchestrators: verify a valid WHY anchor exists before delegating a sub-action; **free, no credit consumed** - \`submit_outcome\` — record the actual outcome against a confidence-anchored decision - \`get_calibration\` — query an agent's calibration quality (bias, gap, variance) — **no auth required** MCP client config (Claude Desktop, Cursor, Codex, OpenClaw): \`\`\`json { "mcpServers": { "prove-before-act": { "url": "https://provebeforeact.com/mcp", "headers": { "Authorization": "Bearer pm_YOUR_API_KEY" } } } } \`\`\` ### Confidence-Level Anchoring (certify_with_confidence) Record how certain you are at each decision stage. Creates an on-chain audit trail of your declared decision basis, not internal chain-of-thought. Stages: \`initial\` (60%) → \`partial\` → \`pre-commitment\` (80%) → \`final\` (100%). All share a \`decision_id\`. Governance rule: if \`reversibility_class\` is \`irreversible\` and \`confidence_level < 0.95\`, Prove Before Act flags a policy violation on-chain. \`\`\`bash curl -X POST https://provebeforeact.com/mcp \\ -H "Content-Type: application/json" \\ -H "Accept: application/json, text/event-stream" \\ -H "Authorization: Bearer pm_YOUR_API_KEY" \\ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"certify_with_confidence","arguments":{"file_hash":"","filename":"decision.json","decision_id":"","confidence_level":0.8,"threshold_stage":"pre-commitment","reversibility_class":"irreversible","why":"instruction hash or reason","who":"erd1...or agent-id"}}}' \`\`\` After execution, call \`submit_outcome\` with the actual outcome to track calibration over time. ### SDK — Python \`\`\`bash pip install prove-before-act \`\`\` \`\`\`python from xproof import XProofClient # legacy module name retained by the canonical package client = XProofClient(api_key="pm_YOUR_API_KEY") proof = client.certify_file("path/to/file.pdf") print(proof.verify_url) # Staged confidence from xproof import certify_with_confidence # legacy module name retained for compatibility certify_with_confidence(api_key="pm_...", file_hash="...", decision_id="...", confidence_level=0.8, stage="pre-commitment") \`\`\` PyPI: https://pypi.org/project/prove-before-act/ — Integrations: LangChain, CrewAI, LlamaIndex, AutoGen, OpenAI Agents SDK, Vercel AI. `pip install xproof` and the `xproof` module name are legacy compatibility aliases. ### SDK — JavaScript / TypeScript \`\`\`bash npm install prove-before-act \`\`\` \`\`\`typescript import { XProofClient } from 'prove-before-act'; const client = new XProofClient({ apiKey: "pm_YOUR_API_KEY" }); const proof = await client.certifyFile("path/to/file.pdf"); console.log(proof.verifyUrl); // With LangChain import { XProofTool } from 'prove-before-act/vercel'; \`\`\` npm: https://www.npmjs.com/package/prove-before-act — Integrations: LangChain, CrewAI, LlamaIndex, AutoGen, OpenAI Agents SDK, Vercel AI ### Verification Badge Embed a dynamic badge in README: \`[![Prove Before Act](https://provebeforeact.com/badge/{proof_id})](https://explorer.multiversx.com/transactions/{tx_hash})\` The badge links to the MultiversX Explorer transaction for on-chain verification. Use /badge/{proof_id}/markdown to get a ready-to-embed snippet with the correct Explorer link. ### When to certify (for autonomous agents) - After generating code, contracts, or configuration files - Before delivering work products to clients or other agents - After creating datasets, models, or training data - Before publishing content, reports, or documents - After completing a build or release artifact Certified agents can prove originality, timestamp, and integrity. Non-certified agents cannot. ## Pricing Flat $0.01 per certification — no tiers, no promo. Prepaid packs: 100/$1, 1,000/$10, 10,000/$100. Buy packs with Stripe Checkout or USDC on Base; Stripe is an additional option and does not replace x402, ACP, or EGLD. Current pricing: https://provebeforeact.com/api/pricing ## Agent Context Document Dedicated document answering the 10 exact questions agents ask when evaluating Prove Before Act (x402 flow, latency, retry policy, cost per 1000 anchors, comparison vs Arweave/Ceramic/Sign Protocol, MCP integration, 4W audit trail, privacy risks, fleet monitoring, Prove Before Act workflow): - Human-readable page: https://provebeforeact.com/agent-context - Machine-readable markdown: https://provebeforeact.com/agent-context.md The markdown version is optimized for LLM indexers and crawlers. It includes copy-paste Python code and a full comparison matrix. ## Documentation & Machine Interfaces - Prove Before Act specification: https://provebeforeact.com/standard — The Prove Before Act specification — design pattern, core invariant, 4W audit trail - [Agent Context (10 questions agents ask)](https://provebeforeact.com/agent-context.md) - [OpenAPI Specification](/api/acp/openapi.json) - [API Guide](/learn/api.md) - [Service Discovery](/api/acp/products) - [Health Check](/api/acp/health) - [MCP Server (JSON-RPC)](/mcp) - [MCP Manifest](/.well-known/mcp.json) - [OpenAI Plugin](/.well-known/ai-plugin.json) - [Full Specification](/.well-known/provebeforeact.md) ## x402 Payment Protocol Prove Before Act supports x402 (HTTP 402 Payment Required) as an alternative to API key auth. Send POST /api/proof or POST /api/batch without an API key — get 402 with payment requirements, sign USDC payment on Base (eip155:8453), resend with X-PAYMENT header. Flat $0.01 per certification. No account needed. ## x402 Bazaar Discovery Prove Before Act is indexed in the x402 Bazaar — the canonical discovery layer for x402-compatible services (built by Coinbase). AI agents that use the Bazaar MCP server can find Prove Before Act automatically without reading any documentation. Bazaar MCP endpoint: GET https://api.cdp.coinbase.com/platform/v2/x402/discovery/mcp Search terms that surface Prove Before Act in the Bazaar: - "proof of existence", "blockchain certification", "audit trail", "decision provenance", "agent accountability", "file hash", "SHA-256 anchor" How it works: Bazaar discovery metadata (input schema, output schema, examples, pricing) is embedded in the \`extensions.bazaar\` field of every x402 402 response from Prove Before Act. The CDP facilitator catalogs Prove Before Act automatically on first payment. Discoverable endpoints: - POST /api/proof — certify any SHA-256 hash on MultiversX with optional 4W provenance - POST /api/batch — certify up to 50 files in one transaction For agents with Bazaar MCP configured, add Prove Before Act MCP alongside it: \`\`\`json { "mcpServers": { "bazaar": { "url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/mcp" }, "prove-before-act": { "url": "https://provebeforeact.com/mcp", "headers": { "Authorization": "Bearer YOUR_API_KEY" } } } } \`\`\` ## Agent Integrations Prove Before Act works with any MCP-compatible agent (Claude Code, Codex, OpenClaw, Conway Terminal) and any x402-enabled agent. - OpenClaw Skill: https://github.com/jasonxkensei/prove-before-act-openclaw-skill - GitHub Action (legacy Marketplace slug, redirects retained): https://github.com/marketplace/actions/xproof-certify - GitHub Action repository: https://github.com/jasonxkensei/prove-before-act-action - Main repository: https://github.com/jasonxkensei/prove-before-act - Supported protocols: MCP, ACP, x402, MX-8004, OpenAI Plugin, LangChain, CrewAI ## MX-8004 Integration (Trustless Agents Standard) Prove Before Act supports an MX-8004 integration. Check `/api/mx8004/status` for live configuration, and `/api/mx8004/job/{jobId}` for each validation outcome. Active configuration alone does not confirm on-chain completion. - Identity Registry: available when active - Validation Registry: available when active - Reputation Registry: available when active - Status: /api/mx8004/status - Agent reputation: /api/agent/{nonce}/reputation - Job data: /api/mx8004/job/{jobId} - Validation status: /api/mx8004/validation/{requestHash} - Feedback: /api/mx8004/feedback/{agentNonce}/{clientAddress}/{index} - Spec: https://github.com/sasurobert/mx-8004/blob/master/docs/specification.md - Explorer: https://agents.multiversx.com ## Agent Trust Leaderboard Public trust registry for AI agents. Trust score computed from on-chain certification history. - Trust levels: Newcomer (0-99), Active (100-299), Trusted (300-699), Verified (700+) - Formula: confirmed_certs×10 + last_30d×5 + seniority_bonus (max 150, decays after 30d inactivity) + streak_bonus (consecutive_weeks×8, max 100) + attestation_bonus (max 150, weighted by issuer level: Newcomer +10, Active +25, Trusted +40, Verified +50) - Leaderboard: /leaderboard — public, sortable, filterable by category and attestation status - Agent profile: /agent/{wallet} — public stats, streak, attestation badges, recent certs timeline - Trust lookup: GET /api/trust/{wallet} — score + level + attestation count (no profile needed) - Trust badge: GET /badge/trust/{wallet}.svg — dynamic SVG; shows "Level · N attested (score)" when attested - Badge markdown: GET /badge/trust/{wallet}/markdown — ready-to-embed snippet - Opt-in (leaderboard visibility): PATCH /api/agent with body {"is_public_profile":true,"agent_name":"my-agent","agent_description":"What it does"} — Bearer auth required. Hidden by default after registration. ## Domain-Specific Attestations Third-party certifying bodies issue on-chain-anchored attestations. Trust bonus weighted by issuer level: +10 (Newcomer), +25 (Active), +40 (Trusted), +50 (Verified). Top 3 counted, max +150. Requires issuer to have ≥ 3 confirmed certifications. - Domains: healthcare (MHRA, FDA, EMA), finance (FCA, SEC, ESMA), legal (ISO, GDPR), security (NIST, CIS), research, other - Issue: POST /api/attestation (wallet auth, anti-self-attest enforced) - Lookup by ID: GET /api/attestation/{id} — public attestation detail - Lookup by wallet: GET /api/attestations/{wallet} — public, returns all active attestations - Revoke: DELETE /api/attestation/{id} (issuer wallet only) - My issued: GET /api/my-attestations/issued (wallet auth) - Detail page: /attestation/{id} — public, shows domain, standard, issuer, subject, trust impact - MCP tool: check_attestations(wallet) — returns attestations, trust bonus, attestation_url per entry ## Why It Matters AI agents produce code, reports, contracts, and decisions — but without proof, none of it is verifiable. - **Prove delivery**: An agent generates a report for a client. Prove Before Act certifies it before delivery. If disputed, the blockchain timestamp is the proof. - **Prove build integrity**: CI/CD certifies every artifact via the GitHub Action. Months later, a security audit checks one hash — case closed. - **Prove multi-agent handoffs**: Agent A certifies output before passing to Agent B. The chain of custody becomes verifiable end-to-end. - **Prove agent identity**: When MX-8004 is configured, agents can register on-chain identities and route certifications through its validation flow. Check /api/mx8004/status for live configuration and /api/mx8004/job/{jobId} for each validation outcome. - **Historical beta — xproof_agent_verify** (legacy agent identifier): an autonomous agent beta-tested all 6 API endpoints in a past run. Those timings and leaderboard values are historical snapshots; read the live agent profile for current data. Live proof: https://provebeforeact.com/proof/f8c3b35d-6ee1-4f76-a92b-1532a008df7b. Review: https://www.moltbook.com/post/1d6cf96b-5046-4c63-9ae5-43f8809f4562 ## Live Proof Prove Before Act has certified its own README on MultiversX mainnet. Transaction: a642f64c5ac46dd1c09dffba6cf6556f9f6ce0d8fc642f5f4118c145cd04cf14 SHA-256: a642f64c5ac46dd1c09dffba6cf6556f9f6ce0d8fc642f5f4118c145cd04cf14 Date: 2026-02-24T21:08:24Z ## Agent Audit Log Standard Operators can use a certified proof in their own critical-action policy. Prove Before Act records certifications; it is not an automatic compliance gate. Schema: /.well-known/agent-audit-schema.json action_type: trade_execution | code_deploy | data_access | content_generation | api_call | other risk_level: low | medium | high | critical Example 1 — Trade execution: POST /api/audit Authorization: Bearer pm_YOUR_API_KEY Body: { "agent_id":"trading-bot","action_type":"trade_execution","action_description":"Buy 0.5 ETH on Uniswap v3","inputs_hash":"","risk_level":"high","decision":"approved","risk_summary":"Slippage < 0.5%, liquidity verified on 3 pools" } Example 2 — Smart contract deployment (MultiversX / Base): An operator can choose to require a proof before a mainnet deployment. The proof_id is an irrevocable record that the deployment was intentional and approved. The operator decides whether a missing proof triggers a retry, review, stop, or another response. POST /api/audit Authorization: Bearer pm_YOUR_API_KEY Body: { "agent_id":"deploy-agent","action_type":"code_deploy","action_description":"Deploy TokenSwap v3 to MultiversX mainnet — replaces v2 at erd1qqqq...abc","inputs_hash":"","inputs_manifest":{"fields":["bytecode_hash","constructor_args","gas_limit","target_network","audit_report_hash","simulation_tx_hash"],"sources":["mvx_mainnet_gateway","audit_pipeline","simulation_vm"]},"risk_level":"critical","decision":"approved","risk_summary":"Bytecode matches audited commit. Simulation passed 10/10. Gas within 5% of v2 baseline.","context":{"network":"MultiversX mainnet","audit_by":"CertiK #CK-2026-0811"} } Returns: { proof_id, audit_url, decision, risk_level, blockchain } Operator-policy workflow templates (operators choose how to handle a missing proof_id): - LangChain: /agent-tools/audit-guard-langchain.py - CrewAI: /agent-tools/audit-guard-crewai.py - n8n: /agent-tools/audit-guard-n8n.json - Eliza OS: /agent-tools/audit-guard-eliza.ts MCP tool: audit_agent_session (same params, enforces API key auth) ## Coherence Layer — Prove Before Act The Coherence Layer closes the loop between intent and result. Anchor WHY BEFORE executing, anchor WHAT AFTER, link the pair to prove alignment and earn a coherence score. Full loop: check_coherence (WHY) → execute → certify_file with metadata.why_proof_id (WHAT) → POST /api/coherence/link check_coherence — MCP tool. Args: intent, context, decision (all required), who (optional). Returns proof_id (the WHY anchor) and coherence_anchor (SHA-256 of payload). Cost: $0.01/anchor, first 10 free. Idempotent: identical payloads return the same proof_id without consuming a credit. require_coherence_anchor — MCP tool. Orchestrator policy gate. Pass intent_hash (from check_coherence response) or all three of intent+context+decision. Returns allowed: true/false + anchor_id + expires_at. Free, no credit consumed. If allowed=false (reason: NO_ANCHOR or ANCHOR_EXPIRED), call check_coherence then re-check before proceeding. POST /api/coherence/link — link WHY to WHAT. Auth: Bearer pm_KEY. Body: {why_proof_id, what_proof_id}. Idempotent. Coherence score: 50 base + 15 if WHAT within 1h of WHY + 20 if WHAT metadata.why_proof_id references WHY + 15 if WHAT on-chain confirmed. Unlinked WHY anchor: shows as pending for <1h, then divergent after 1h; flagged as fault violation after 2h TTL. Coherence history (public, paginated): GET /api/agents/{wallet}/coherence?limit=50&offset=0 Returns: checks[], total, aggregate.coherence_rate, aggregate.avg_coherence_score Per-check status: linked | pending (<1h unlinked) | divergent (≥1h unlinked) Fleet coherence (Coherence Artisan view): GET /api/fleet/coherence?org= — all public agents sharing prefix GET /api/fleet/coherence?fleet= — named fleet members fleet_score = round(0.7 × coherence_rate + 0.3 × avg_coherence_score) Full Coherence Layer documentation: https://provebeforeact.com/coherence