Getting Started
For AI Agents
Connect an AI agent to FurlPay through MCP and scoped tools, then apply identity and spend controls to the actions it prepares. Agent connectivity is available; payment settlement still depends on the status of the selected production rail and the user's approval.
Agent access is policy-gated and honors rail status
x402, MPP, and relayed gasless settlement remain in development. Always inspect /api/rails (and /status) before routing live payments—a quote, mandate, or sandbox simulation is not on-chain finality.The mental model
Path 1 — MCP (Claude, Cursor, any MCP client)
FurlPay exposes an MCP endpoint at /api/mcp. The tools presented to a client depend on the scopes the user grants. The connector can read authorized data and prepare financial actions for approval; it cannot bypass the payment rail or make an unavailable service live:
https://furlpay.com/api/mcpFor Claude setup and the exact read-only and prepare-only tools, see the Claude connector guide. Travel MCP examples are integration previews; production travel booking is not currently available.
Path 2 — LangChain / LlamaIndex
Framework adapters may expose FurlPay tools to an agent, but the tool set and available operations depend on the integration and user's permissions. Treat read, prepare and execute as different capabilities; never assume a tool can complete a production payment.
Path 3 — x402: metered HTTP requests
x402 lets an API return 402 Payment Required with a payment challenge. The FurlPay x402 endpoint currently returns 503 because operational controls are unavailable, and production settlement is also in development. Agents cannot rely on completing paid requests through FurlPay. Read the x402 guide for the protocol shape and check /api/rails before use:
import { withX402 } from "@furlpay/x402";
export const GET = withX402(
async () => Response.json({ signal: "premium market data" }),
{ payTo: "0xYourAddress", network: "base", amount: "10000" }
);Illustrative user-signed spend mandate
Budgets cap how much; mandates prove who allowed what. The user signs once, the agent signs each intent, and an integrating service can verify the chain. This example is a library pattern only; it does not enable FurlPay production travel or payment settlement.
import { AgentTrust, generateKeypair, issueMandate, createBookingToken } from "@furlpay/agent-trust";
const user = generateKeypair("user"), agent = generateKeypair("agent");
// 1 · User consents: $500 trip, lodging+airlines, 7 days
const mandate = issueMandate({
userPrivateKeyPem: user.privateKeyPem, userPublicKeyPem: user.publicKeyPem,
agentKeyId: agent.keyId,
constraints: { maxTotalUsd: 500, mccAllowlist: ["7011", "4511"],
expiresAt: new Date(Date.now() + 7 * 864e5).toISOString() },
});
// 2 · Agent signs ONE exact intent per booking
const mandateToken = createBookingToken({
mandate, agentPrivateKeyPem: agent.privateKeyPem, agentPublicKeyPem: agent.publicKeyPem,
intent: { amountUsd: 320, source: "legacy", mcc: "7011" },
});
// 3 · The rail verifies the full chain — wrong amount, wrong MCC,
// replayed token, exhausted budget: all fail closed.Deep dive: Agent Trust & Mandates (TAP) · applied to bookings: FurlPay Travels.
15-step end-to-end agent governance lifecycle
An AI agent can never widen its own permissions simply by requesting a larger limit in a prompt or tool argument. All policy checks run in deterministic server-side control-plane infrastructure before any signing operation occurs:
- 1–3. Identity, Auth & Discovery: Register agent public key (
POST /api/agents/keys), obtain scoped OAuth 2.1 + PKCE + DPoP credentials (cnf.jkt), and inspect read-only MCP tool schemas (/api/mcp). - 4–8. User-Signed Mandate & Restrictions: User signs an immutable AP2/TAP mandate binding permitted assets, networks, single-tx cap, velocity/daily USD limits, and counterparty/MCC allowlists.
- 9–12. Policy Evaluation, HITL & Signing Boundary: Agent calls prepare tool or
x402/MPP; server validates mandate + context binding; high-value or prepare-only flows require WebAuthn/human confirmation URL before Cloud KMStransactionGuardor wallet signing runs. - 13–15. Verify, Audit & Revoke: Confirm settlement reference + immutable audit row, or immediately invalidate future execution via
DELETE /api/agents/keys.
Agent failure behavior matrix (fail-closed)
| Condition | Runtime Outcome | Sandbox Simulation Route |
|---|---|---|
| Missing permission / MCP scope | HTTP 403; tool call rejected before execution | ERR_AUTH_SCOPE |
| Mandate expired or single-use spent | Mandate verifier refuses execution; zero fallback | @furlpay/agent-trust fail-closed check |
| Budget / ceiling exceeded | HTTP 403 ERR_POLICY_LIMIT_EXCEEDED + agent.mandate_exceeded audit event | POST /api/sandbox/x402/simulate-settlement ($15 > $5) |
| OAuth / DPoP expired or replayed | HTTP 401; jti replay blocked immediately | apps/web/src/lib/mcp/dpop.ts |
| Production rail unavailable | HTTP 503 (settlement_disarmed / controls_unavailable) | Verify GET /api/rails and /status |
| Human approval required | Pauses at PENDING_APPROVAL / HOLD; returns HITL link | simulate-deposit (requireMakerChecker: true) |
Why builders pick Furlpay for agents
