# FideRail — Local-First Non-Custodial Payment Guardrail & Anti-Sybil Trust Control Plane for AI Agents > Version: 2.3.5 > Official Website: https://fiderail.com > Primary Source Repository (GitLab): https://gitlab.com/fiderail/fiderail > Mirror Repository (GitHub): https://github.com/fiderail/fiderail > API Base URL: https://api.fiderail.com > OpenAPI 3.1 Spec: https://api.fiderail.com/.well-known/openapi.json > Machine SSOT Manifest: https://api.fiderail.com/.well-known/fiderail-manifest.json > Public Ed25519 Verification Keys: https://api.fiderail.com/.well-known/fiderail-keys.json > Self-Hosted Documentation Hub: https://fiderail.com/docs (Scope: https://fiderail.com/docs/scope | Architecture: https://fiderail.com/docs/architecture | Trust Model: https://fiderail.com/docs/trust-model | Operations: https://fiderail.com/docs/operations) > Live Node Status: https://fiderail.com/status | Security Policy: https://fiderail.com/security | Pricing: https://fiderail.com/pricing | About: https://fiderail.com/about > Legal & Compliance: Terms https://fiderail.com/terms | Privacy https://fiderail.com/privacy > Self-Hosted 1M+ Audit Report: https://fiderail.com/reports/1m-audit > General Contact: founder@fiderail.com > Security & Vulnerability Reports: security@fiderail.com ## Local-First Payment Guardrail & Hybrid Option-C Control Plane FideRail is a **local-first non-custodial AI Agent payment guardrail and attenuated delegation SDK** (`@fiderail/guard` / `pip install fiderail`) backed by a pluggable cloud anti-sybil trust radar (`trust-v2`) — NOT a fragile single-point score API. Core edge guardrails execute locally in microseconds and protect agents even completely offline or when paying `UNVERIFIED` counterparties: - Local Budget Caps & Atomic Lock: Enforces `maxSingleTxUsdc`, `maxDailyUsdc`, and immutable host policy clamping (`clampPolicy`) backed by an embedded concurrent-safe SQLite WAL reservation ledger (`BEGIN IMMEDIATE` atomic reservation before signing). - Offline Ed25519 Attenuated Capability Mandates: Hierarchical `SPECIFIED` / `BOUNDED` delegation chains verified offline in microseconds with strict monotonic narrowing (child mandates can only tighten caps, expiry, chains, assets, domains, or payees), lifecycle revocation, and auto-revoke on task completion. - Outbound Secret & PII Scrubber (Accidental-Leakage Guardrail): Deterministically blocks plaintext leaked API keys, PEM private keys, JWTs, and labeled seed phrases before outbound HTTP transmission. Note: this regex scrubber is an accidental-leakage guardrail, NOT an adversarial exfiltration sandbox against prompt-injection encoding or obfuscation — never place high-privilege credentials inside LLM prompt context. - Quote-to-Pay Cryptographic Digest Binding & Delivery Receipts: Binds exact method/URL/bodyHash/chain/payTo/asset/amount before approval or signing, enforces 60s idempotency, HTTP 5xx circuit breakers, transient disconnect proof recovery, and salted `fiderail-sar-v2` RFC 8785 JCS causal receipts. - Outage-Resilient `RemoteTrustClient`: Local TTL trust cache with explicit `fail-closed` (block above micro cap during cloud outage) and `fail-open-micro` (permit bounded micro-probes while keeping local budget, mandate, and secret guardrails active) degradation policies. ## Overview & Operational Boundaries FideRail is a 100% non-custodial payment control plane, pre-flight risk firewall, and anti-sybil reputation oracle for autonomous AI Agent commerce (x402 / MCP / EIP-3009). - Zero Custody & Zero Token: FideRail never holds user funds, private keys, or session keys, never issues a platform token, never operates a centralized custodial facilitator, and performs zero human dispute arbitration (deterministic Code-Is-Law execution). - Locked 4 Chains x 2 Stablecoins Boundary: Fixed at Base (USDC, EURC), Solana (USDC, USDT), Arbitrum (USDC, USD₮0 — allowlisted x402), and Polygon (USDC, USDT — allowlisted x402) — strictly 8 fiat-pegged stablecoins total to block altcoin sybil wash-trading. - Control Plane Architecture: Protocol-agnostic core (`PaymentIntent -> AttenuatedMandateVerification -> RiskAndIdentityEvaluation -> DeterministicVerdictAndAttestation`), supports PostgreSQL 16 (monthly partitioned production store) & SQLite WAL (dev/CI fallback — inspect active backend at `GET /healthz`), RFC 8785 JCS + `fiderail-sar-v2` salted causal receipts, and Ed25519-signed Merkle `stateRoot` commitments. - Indexer Polling vs Recompute Cadence: Live chain workers poll incrementally (Base every 30s, Solana every 60s, Arbitrum & Polygon allowlisted x402 every 90s), while full `trust-v2` profile recomputation, delta history snapshots, and Ed25519-signed Merkle `stateRoot` commitments run every 180s. ## Default Firewall Policy, Thresholds & Role Screening - Default Pass Threshold (`minTrustScore: 40`): Under `DEFAULT_FIREWALL_POLICY`, counterparties scoring `>= 40` (`HIGH_TRUST >= 70` and `MODERATE_TRUST 40-69`) without blocking sybil flags pass pre-flight within single-tx (`$1.00`) and daily (`$10.00`) caps. - `UNVERIFIED` Counterparties & Micro-Probe Cap: Unindexed addresses are NOT hard-banned at small amounts; payments `<= $0.05 USDC` (`allowUnknownMaxUsdc: 0.05`) return `WARN` (`UNKNOWN_COUNTERPARTY_MICRO_ALLOWED`), while larger payments above `$0.05` return `BLOCK` unless allowlisted or backed by active isolated `ASSOCIATED_CREDIT`. - **Hard-Blocking All Unknown & Low-Trust Counterparties (Including Micro-Payments)**: **If you require strict blocking even below `$0.05`, set `allowUnknownMaxUsdc: 0` alongside `minTrustScore`** (otherwise micro-probes up to `$0.05` pass with `WARN`). - **`onOutage` Scope (`preflightPaymentGuard` vs `getAgentTrust`)**: **`onOutage` (`fail-closed` / `fail-open-micro`) applies only to `preflightPaymentGuard` and `guardedX402Fetch` (Python `preflight_guard` / `guarded_x402_request`); direct `getAgentTrust` (Python `get_trust`) calls always throw when the cloud oracle is unreachable and no stale cache entry exists.** - **`RemoteTrustClient.getPayerActivity` Remote Default**: **`RemoteTrustClient.getPayerActivity` returns `null` remotely by default; for remote seller-side buyer screening, call `POST /v1/trust-provider/before-settle` (`x402#2299`).** - Seller `before-settle` (`x402#2299`) Pure-Payer vs Payee Semantics: Incoming buyers are frequently pure payers who have never received incoming x402 revenue. `POST /v1/trust-provider/before-settle` evaluates both indexed payee trust profiles AND on-chain payer activity (outgoing tx count, distinct payees, and reciprocal wash loops) so legitimate pure-buyer wallets are screened accurately rather than rejected solely for lacking payee history. ## Scoring & Anti-Sybil Penalties (0-100, Active Model: trust-v2) - Positive Signals (14-day exponential half-life decay): cross-ecosystem weighted unique payer diversity (40 pts max; multi-payee buyers weight 1.0, isolated single-target payers weight 0.2), time-decayed organic USD volume (30 pts max), multi-day transaction activity (20 pts max), dual HHI dispersion ((1 - max(txHhi, volumeHhi)) * 10 pts). - Maturity Hard Caps: active span < 24h capped at 65 (NEW_WALLET_MATURITY_CAP, ineligible for HIGH_TRUST); < 3 days capped at 80; < 7 days capped at 90. - Deterministic Risk Penalties (SSOT-synced from /.well-known/fiderail-manifest.json): - RECIPROCAL_LOOP (-30, score capped at 10, tier FLAGGED_LOOP < 40): Self-transfers, 2-hop (A <-> B), or 3-hop (A -> B -> C -> A) directed wash cycles. - SINGLE_PAYER_CONCENTRATED (-25, score capped at 29, tier FLAGGED_CONCENTRATED < 40): Max(txHhi, volumeHhi) or top-1 payer tx/volume share > 80% across >= 5 transactions. - ISOLATED_PAYER_FARM (-25, score capped at 25, tier FLAGGED_FARM < 40): High-volume payee (>= 10 unique payers, >= 15 txs) where > 95% of payers never paid any other counterparty. - BEHAVIOR_DRIFT (-20, score capped at 69, ineligible for HIGH_TRUST, triggers pre-flight WARN): Sudden exit-scam / anomaly spike: recent ticket median >= 10x historical median and >= $10 USD. - MICRO_PING_ONLY (-10): Median ticket < $0.005 USD. - NON_X402_WHALE_FLOW (-35, score capped at 65, ineligible for HIGH_TRUST, triggers pre-flight WARN): Generic EIP-3009 wallet with median ticket > $100 USD and no verified x402 facilitator channel. - Explainability & Isolation: outputs independent `confidence` (0-1 + LOW/MEDIUM/HIGH), `riskLevel`, `dataCoverage`, `modelVersion` + `modelHash`, strictly isolated `associatedCredit` (never pollutes `creditScore`, auto-revoked on child sybil flags), and Ed25519-signed Merkle `stateRoot` commitments verifiable via `GET /.well-known/fiderail-keys.json`. ## SDK & Integration Quick-Install - TypeScript / Node.js Local Edge Guard SDK: `npm install @fiderail/guard` (re-exports `@fiderail/core` primitives, built on zero-dependency `@fiderail/spec` & `@fiderail/zk-types`, plus optional `@fiderail/seller` for `x402#2299` hooks and `@fiderail/mcp` for local stdio MCP). - Zero-Dependency Python SDK (`>= 3.9`): `pip install fiderail` - Zero-Install Remote Streamable HTTP MCP: `POST https://api.fiderail.com/mcp` (JSON-RPC 2.0, supports 2025-06-18 / 2025-03-26 / 2024-11-05) - Mirror Repository (GitHub, MIT): https://github.com/fiderail/fiderail - Primary Source Repository (GitLab, MIT): https://gitlab.com/fiderail/fiderail ## Access & Pricing (https://fiderail.com/pricing) - Open-Source Protocol & Local Edge Guard SDK ($0 Forever): MIT open-source protocol, local deterministic Edge Guard SDK (@fiderail/guard, @fiderail/core, @fiderail/seller, sdks/python), and self-hostable MCP/API stack — $0 forever (no thresholds, no lock-in). - Public Hosted Node (Permanent Free Tier): Permanent free tier on the public hosted node (api.fiderail.com) with fair-use per-IP rate limits (120 req/min general API & /mcp, 6 req/min grader, 10 req/min telemetry), best-effort availability (no SLA), and permanently free /healthz, /v1/history, /v1/diagnose, /.well-known/*, /reports/1m-audit, and /docs. - Automatic HTTP 402 Overage Metering: Automatic HTTP 402 pay-per-call overage at $0.002 USDC on GET /v1/trust/{chain}/{address} when free-tier quota is exceeded or operator-configured x402Enforce is enabled (zero accounts, zero API keys, zero custody) (currently `x402Enforce: false` within free-tier quota on the public node; `/healthz`, `/v1/history`, `/.well-known/*`, `/reports/1m-audit`, `/docs`, `/status`, and `/v1/diagnose` remain permanently free). - Enterprise & High-QPS Support: Dedicated high-QPS throughput, multi-region read nodes, drift webhooks, VPC/BYOC deployment, and SLA contracts via founder@fiderail.com (zero black-box score overrides). ## HTTP REST & Streamable HTTP MCP Endpoints (13 endpoints) 1. GET /healthz - Live indexer telemetry, active storage mode (`postgresql+snapshot` or `sqlite+snapshot`), block/slot lag, active scoring model hash, latest Merkle stateRoots + signing status, L1 probe health counts, L2 delivery telemetry counts, and dataset freshness. 2. GET /v1/trust/{chain}/{address} - Cross-chain anti-sybil trust profile, 0-100 creditScore, confidence (0-1 + LOW/MEDIUM/HIGH), riskLevel, tier (HIGH_TRUST, MODERATE_TRUST, LOW_HISTORY, FLAGGED_FARM, FLAGGED_CONCENTRATED, FLAGGED_LOOP, UNVERIFIED), dual HHI metrics, dataCoverage, isolated associatedCredit, riskFlags, Bazaar services, and indexed L1 liveness diagnostics. Exposes `X-FideRail-Cache: HIT|MISS` and `X-FideRail-Model-Hash`. 3. GET /v1/history/{chain}/{address}?limit=50 - Delta trust score history (recorded on initial scoring, >= 5 point score shifts, or riskFlag transitions) alongside the current trust profile and latest Ed25519-signed Merkle stateRoot commitment for the chain. 4. GET /v1/agents?chain=all|base|solana|arbitrum|polygon&tier=all|FLAGGED|HIGH_TRUST|MODERATE_TRUST|LOW_HISTORY|FLAGGED_LOOP|FLAGGED_CONCENTRATED|FLAGGED_FARM&channel=all|x402&sort=score|volume|txs|risk&minScore=0&excludeFlagged=false&offset=0&limit=20&q= - SQL-paginated cross-chain credit leaderboard with strict enum/numeric validation (HTTP 400 on invalid query values), channel filtering (verified x402 vs all EIP-3009), and risk-tier filtering. 5. GET /v1/services?q=&chain=all|base|solana|arbitrum|polygon&maxPriceUsdc=&minTrustScore=0&excludeFlagged=true&offset=0&limit=20 - Aggregated CDP Bazaar, PayAI Discovery, and Open Bazaar endpoints joined with live anti-sybil trust scores, L1 liveness, header byte compliance (8KB aiohttp / 16KB Node limits), and L2 delivery success rates. 6. POST /v1/preflight - Pre-flight payment firewall simulator. Body: { chain, counterparty, amountUsdc, spentTodayUsdc?, policy? }. Returns ALLOW / WARN / BLOCK with deterministic policy reasons and `X-FideRail-Model-Hash`. 7. POST /v1/diagnose - Zero-payment x402 Endpoint Grader & Open Bazaar self-submission. Body: { url, method?: "GET"|"POST", autoRegister?: boolean, serviceName?, description?, tags? }. Grades A/B/C/F, checks PAYMENT-REQUIRED header sizes (x402#3803 8KB aiohttp / 16KB Node crash limits), Bazaar inputSchema quirks, HTTPS compliance, and price drift. 8. POST /v1/trust-provider/before-settle - x402#2299 Trust-Provider `onBeforeSettle` hook adapter for resource servers and facilitators across Base, Solana, Arbitrum, and Polygon, screening both payee profiles and pure-payer activity / reciprocal wash loops. 9. POST /v1/telemetry/delivery - L2 post-payment delivery telemetry reporter requiring valid cryptographic `fiderail-sar-v2` receipts with `receiptHash` replay deduplication; unverified anonymous negative claims (`delivered: false`) are quarantined without degrading public `deliverySuccessRate`. 10. POST /mcp - Remote Streamable HTTP MCP (JSON-RPC 2.0, supports protocol versions 2025-06-18 / 2025-03-26 / 2024-11-05, `Mcp-Session-Id`, and `DELETE /mcp`) exposing the 5 stateless FideRail trust, pre-flight firewall, service discovery, and endpoint diagnostic tools with zero local install (`guarded_x402_fetch` stays local-only via `stdio` MCP / `@fiderail/guard`). 11. GET /.well-known/fiderail-keys.json - Public Ed25519 verification keys (`keyId`, SPKI PEM, base64url DER, and canonical `fiderail-state-root-v1:{epochId}:{merkleRoot}` signing format) for independently verifying Merkle `stateRoot` commitments offline. 12. GET /.well-known/fiderail-manifest.json - Machine-readable Single Source of Truth (SSOT) manifest for FideRail v2.3.5 (chains, asset contracts, active trust-v2 scoring rules, endpoints, and contacts). 13. GET /reports/1m-audit - Self-hosted stratified 1M+ On-Chain Agent Payments Audit Report (HTML for browsers, raw Markdown at `/reports/1m-audit.md`). ## Self-Hosted Documentation, Status & Policy Pages - GET /docs — Documentation hub indexing all canonical specs (raw Markdown available at `/docs/scope.md`, `/docs/architecture.md`, `/docs/trust-model.md`, `/docs/operations.md`, `/docs/mcp.md`, `/security.md`). - GET /docs/scope — Scope, 6 constitutional red lines, and fixed 4-chain x 8-stablecoin boundary. - GET /docs/architecture — Hybrid Option-C local-edge + cloud-intelligence architecture and cryptographic primitives. - GET /docs/trust-model — Trust Engine v2 anti-sybil scoring specification, dual HHI, maturity caps, and penalties. - GET /docs/operations — Public-safe operations, PostgreSQL 16 deployment, and Ed25519 signing runbook. - GET /docs/mcp — MCP tools parameter reference, remote vs local availability, rate limits, batch caps, and error codes. - GET /changelog — Release changelog and security update history (raw Markdown at `/CHANGELOG.md`). - GET /status — Live 4-chain indexer sync status, block/slot lag, Ed25519 signing state, polling vs recompute intervals, and uptime. - GET /security — Non-custodial security boundary and vulnerability disclosure policy. - GET /about — Project overview, Option-C architecture, and constitutional red lines. - GET /pricing — MIT open-source SDK vs free best-effort public node vs optional configurable x402 metering. - GET /terms — Terms of Use (MIT license, zero-custody / no financial warranty disclaimer, non-arbitration boundary). - GET /privacy — Privacy Policy (zero user accounts, zero PII stored, ephemeral IP rate-limit windows, public on-chain data only). ## Dual-Mode MCP Server Tools (6 local stdio tools / 5 stateless remote HTTP `/mcp` tools) - check_agent_trust: Query cross-chain anti-sybil trust score and risk flags before paying. - preflight_payment_guard: Evaluate planned stablecoin spend against immutable host-clamped caps, HHI concentration, isolated payer farms, and wash loops. - list_audited_agents: Browse audited payees across Base, Solana, Arbitrum, and Polygon. - discover_trusted_services: Search Bazaar/PayAI/Open Bazaar services ranked by trust score, liveness, and price. - guarded_x402_fetch (local stdio MCP / `@fiderail/guard` only; disabled on public `POST /mcp`): Hardened non-custodial Guard-and-Pay executor featuring concurrent atomic budget reservation, outbound secret/PII scrubber, immutable host policy clamp, stablecoin asset allowlist, 3-tier HITL approval gate, Quote-to-Pay cryptographic digest binding, 60s duplicate-payment guard, HTTP 5xx circuit breaker, transient disconnect proof recovery, and salted fiderail-sar-v2 receipts. - diagnose_x402_endpoint: Zero-payment x402 endpoint grader checking 402 compliance, 8KB/16KB header limits, schema quirks, and price drift.