Skip to content

Gateway

The library defines and verifies mandates. The gateway is what enforces them: it sits between the AI agent and the payment rail, and no payment goes out without passing its checks. It is private and not yet publicly available.

What it does

  • MCP server. The agent connects over the Model Context Protocol and uses tools such as create_mandate, quote, request_payment and get_receipt.
  • OAuth 2.1. Each agent authenticates before it can request a payment.
  • Mandate verification. Before every payment, the gateway verifies the signed mandate with the ritta library, using the amount from the merchant catalog and the balance kept by the ledger.
  • Double-entry ledger. Every movement is booked as in an accounting ledger, so each mandate's balance always adds up.
  • Hash-chained audit log. Each event is chained by hash to the previous one, so a record cannot be deleted or altered without it showing.
  • Policy engine. Applies per-agent, per-session, per-merchant and per-day limits, on top of what the mandate says.
  • Kill switch. A switch to stop payments immediately.
  • Human approval. Above the threshold set in the mandate (hitl_threshold), the payment waits for a person to approve it.

The money never goes through Ritta: the payment runs directly on the rail.

Status

Today the gateway runs against the Mercado Pago sandbox, the test environment, with no real money. Pix and USDC come later. Progress is tracked in the roadmap.

Early access

If you want to try it, write to hola@ritta.dev and tell us what you want your agent to pay for.