AgentPay by Legasi

AgentPay is a secure payment layer for AI agents. It lets you upgrade Claude, or any other major LLM, so it can make payments in RLUSD based on the rules you define, while keeping you in control.

Demo Video

Project Information

At a Glance

AgentPay is a secure payment layer for AI agents. It lets you upgrade Claude, or any other major LLM, so it can make payments in RLUSD based on the rules you define, while keeping you in control.

Description

Pitch Deck: https://docs.google.com/presentation/d/1dUhE2EIV6VcF5HBzYsSJyKcViFW_4v6c/edit?usp=sharing&ouid=106701869240902273611&rtpof=true&sd=true

AgentPay - A corporate card for AI agents, settled on XRPL.

AI agents are becoming autonomous workers: browsing, researching, executing tasks on behalf of humans. But every time an agent encounters a paid API or a paywalled article, it stops, HTTP 402 Payment Required. Agents don't have wallets, credit cards, or identities and handing over your private keys to an AI is a security nightmare.

Legasi AgentPay solves this by introducing a controlled spending layer between the AI agent and the XRPL ledger:

  1. The owner deposits RLUSD into a vault and defines spending rules (allowlisted merchants, per-request caps, total spending power).
  2. A policy engine validates every payment request before any transaction is signed, if the service isn't allowlisted or the amount exceeds the cap, the payment is blocked instantly.
  3. The agent operates autonomously within those boundaries. For example, when it hits a paywall, it detects the 402 response, triggers a payment in RLUSD on XRPL, receives a confirmed tx hash in seconds and delivers the unlocked content to the user.
  4. The agent never holds private keys. The vault signs transactions server-side, and the owner retains full control at all times.

We built this as an MCP server that plugs directly into Claude Desktop or Claude Code. The agent gets a single tool (legasi_fetch) and the entire payment flow is invisible to the end user. Ask Claude to read a paywalled report, and it just works: the agent pays, reads, and summarizes.

A real-time React dashboard gives the owner full visibility: vault balance, spending power bar, live event feed with XRPL explorer links, and Xaman wallet connect for funding the vault via QR code from a mobile phone.

Agent payments are high-frequency micropayments, $0.50 here, $0.02 there, potentially hundreds per day. XRPL offers near-zero fees, 3-5 second finality, and RLUSD as a regulated USD-denominated stablecoin. The entire payment rail uses native XRPL primitives (Payment, TrustSet, AccountSet), no smart contracts needed.

Legasi AgentPay is the infrastructure layer that turns XRPL into the settlement network for the agentic economy.

Technical Details

The stack is fully TypeScript.

The orchestrator is a Hono HTTP server exposing routes for /buy, /state, /fund-vault, and Xaman wallet integration.

The MCP server runs over stdio and exposes a single legasi_fetch tool to Claude. When the agent fetches a URL and receives HTTP 402 with JSON pricing metadata, the MCP server calls the orchestrator's /buy endpoint.

The policy engine checks an allowlist, a per-request cap, and a global power limit before approving. Approved payments are executed via xrpl.js on XRPL testnet. The vault wallet signs a Payment transaction sending RLUSD (issued currency with trustlines) to the payee. The tx hash is logged and the unlocked content is returned to the agent.

The React+Vite dashboard polls /state for real-time updates. Xaman integration uses REST API to generate QR payloads for TrustSet and Payment flows, enabling mobile wallet funding. The paywall site is a Vercel serverless function returning 402+JSON or HTML based on the request context.

Team

2
AG

Arthur Gaspard

AB

Arnaud Biju-Duval

Hackathon

HACK THE BLOCK 2026 Paris Blockchain Week XRPL Hackathon

Duration

Apr 11, 6:30 AM - Apr 12, 6:00 PM UTC

View Hackathon Details