Formal Verification in Tamarin · NPCI UPI Circle Research

Agent Authorization for Indian Payments, Formally

What a UPI-Style Mandate Must Cryptographically Bind When an AI Agent Pays, and Which Defensive Checks Protect What

1. Executive Summary

As artificial intelligence agents transition from informational chat assistants to autonomous transactional actors, they are increasingly tasked with executing financial disbursements on behalf of human principals. In India, the Unified Payments Interface (UPI) ecosystem represents the global benchmark for retail payments. Through NPCI's UPI Circle initiative (introduced in circular OC 201 and expanded to IoT devices and software entities in addendum OC 201-B), India already possesses a production architecture for delegating payment authority from a primary account holder to a secondary delegate or autonomous software entity.

The core systems and cryptographic question is straightforward:

When an autonomous software agent executes payments under a delegated mandate, what mathematical guarantees ensure that every debit remains strictly within the bounds approved by the human principal?

To evaluate this question without relying on informal assertions, we developed a machine-checked formal protocol model in the Tamarin prover (models/05_agent_payment_mandate.spthy). The model formalizes the interaction between a human principal (payer), an authorization server (issuing bank / PSP), an autonomous software agent, a payment switch (NPCI UPI Switch and MMS), and an active Dolev-Yao network attacker who can intercept, alter, and inject network packets, alongside leaked payment request logs (consistent with the FAPI 2.0 attacker model A5).

The architecture formalizes four complementary cryptographic controls:

When all defensive controls are active, the Tamarin prover mathematically verifies three core security lemmas across every possible trace:

By systematically evaluating the complete 6-card ablation lattice across these checks, we demonstrate that these defensive mechanisms are orthogonal and non-redundant:

Security Property Required Cryptographic Controls Prover Outcome
P10 (Debit within intent) Principal OOB consent + Payee exact match + Amount cap + Server audience check Formally verified across all traces
P11 (No debit after cancellation) Synchronous per-transaction MMS online revocation lookup Formally verified; fails under static TTL caching
P12 (Authentic agent requests) RFC 9449 DPoP asymmetric proof of possession Formally verified; bearer tokens fail under log leakage
Figure 1 UPI Circle Autonomous Agent Delegation: Systems Topology & Cryptographic Flow
PRIMARY UI Primary Account Holder NPCI Common Library (CL) Hardware-isolated MPIN Entry Out-of-band Consent Channel: • Sets single-tx cap: INR 5,000 • Sets monthly cap: INR 15,000 • Locks allowed payee whitelist AGENT SANDBOX Autonomous AI Agent Secondary Delegate (OC 201-B) LLM Orchestrator & Tool Ingestion Cryptographic KeyStore: • Ephemeral EC Keypair (P-256) • Public key bound via cnf JWK • Signs DPoP header per debit • Binds: htm, htu, ath, jti ISSUER BANK Remitter Bank (AS + CBS) Authorization Server & Core Banking Mandate Stamping & Ledger Holds Mandate Token Minting: • aud: https://switch.npci.org.in • RAR: allowed_payees, caps • cnf: Agent EC Public Key NPCI SWITCH UPI Engine & Central MMS Mandate Management System Real-time Revocation & Invariants Synchronous Invariant Verification: • Real-time MMS Revocation Check • DPoP ath & htu ES256 Signature • Payee VPA Whitelist Strict Match • Max-per-tx & Monthly Limit Check MERCHANT Acquiring Bank / Payee Merchant Settlement Node Beneficiary CBS & Terminal Settlement Invariants: Target VPA: electricity-board@billdesk Instant Credit via UPI Rail ✓ Dual-Leg Settlement Done ✓ Non-Repudiable Receipt 1. MPIN 2. MMS Sync 3. JWT Token 4. DPoP Pay 5a. CBS Debit 5b. Credit 6. Ack
Figure 1: Complete cryptographic systems topology of an autonomous agent payment under UPI Circle, showing out-of-band Common Library MPIN consent, central MMS state synchronization, DPoP key binding, and synchronous dual-leg clearing.

2. The Delegation Problem: Autonomous Software Agents Under UPI Circle

In standard human-to-merchant UPI transactions, security is anchored in real-time, synchronous authentication: the account holder inspects the merchant name, Virtual Payment Address (VPA), and transaction amount on a trusted smartphone screen, then inputs a 4- or 6-digit MPIN within an isolated common library. The authorization is contemporaneous with debit execution.

Delegated agent payments under UPI Circle decouple the moment of user authorization from the moment of execution. Under NPCI Circular OC 201 (August 2024) and Addendum OC 201-B (October 2025), a primary account holder grants payment authority to a secondary user, IoT device, or automated software agent. Two distinct operational modes exist:

  1. Partial Delegation (Approve Each Payment): The secondary user or agent initiates the transaction, but the primary user must review and authenticate the debit with their MPIN on their primary device before funds move.
  2. Full Delegation (Spend With Limit): The primary user establishes a monthly limit (up to INR 15,000) and max-per-transaction limits (up to INR 5,000). The secondary delegate initiates and completes debits autonomously without requiring primary user authentication per transaction.

Full Delegation represents the true autonomous agent paradigm. However, because LLM-based software agents operate on unstructured, untrusted text (such as web search results, scraped vendor websites, and incoming vendor invoices), they are vulnerable to indirect prompt injection and logical subversion. If an agent is misled, it may attempt to pay an unapproved merchant or execute excessive debits.

Consequently, the payment mandate must serve as an immutable, cryptographically verifiable capability token. The underlying payment switch and acquiring PSP must deterministically enforce limits without relying on the agent's internal judgement.

3. Cryptographic Structure of an Agent Payment Mandate

To eliminate ambiguity, an agent payment mandate must be expressed as a signed, structured JSON Web Token (JWT) combining RFC 9396 Rich Authorization Requests, RFC 8707 Resource Indicators, and RFC 7800/9449 Proof-of-Possession key confirmations.

3.1 Mandate Token Payload Schema

The following JSON payload illustrates the required claims inside an issued agent mandate token:

json: signed mandate token claims
{
  "iss": "https://issuer.bank.example",
  "sub": "user_payer_9921@okhdfcbank",
  "aud": "https://switch.npci.org.in/upi/v2",
  "jti": "mandate_c81e728d9a4b",
  "iat": 1731693600,
  "exp": 1734285600,
  "authorization_details": [
    {
      "type": "https://specs.npci.org.in/upi-circle/delegated-mandate",
      "delegation_mode": "spend_with_limit",
      "allowed_payees": [
        "electricity-board@billdesk",
        "broadband-services@icici"
      ],
      "max_amount_per_transaction": 500000,
      "monthly_cumulative_cap": 1500000,
      "currency": "INR"
    }
  ],
  "cnf": {
    "jwk": {
      "kty": "EC",
      "crv": "P-256",
      "x": "f83OJ3D2xFmT4v7GywbTS4e1X9uQ6p1k_b1A2f0G_sM",
      "y": "x_da7W8Z8w7H7D5F6A9E2D1C3B4A5F6E7D8C9B0A1F2"
    }
  }
}

3.2 Outbound DPoP Payment Request Proof

When the autonomous agent issues a debit request against the payment server, it must provide a fresh Demonstrating Proof-of-Possession (RFC 9449) JWT signature proving ownership of the private key bound in the mandate's cnf claim. The proof binds the HTTP method, target URI, payment identifier, and a SHA-256 hash of the mandate token (ath), strictly preventing eavesdroppers from reusing leaked payment tokens:

json: DPoP proof header payload
{
  "typ": "dpop+jwt",
  "alg": "ES256",
  "jwk": {
    "kty": "EC",
    "crv": "P-256",
    "x": "f83OJ3D2xFmT4v7GywbTS4e1X9uQ6p1k_b1A2f0G_sM",
    "y": "x_da7W8Z8w7H7D5F6A9E2D1C3B4A5F6E7D8C9B0A1F2"
  }
}
.
{
  "jti": "pid_8f29c1d0",
  "htm": "POST",
  "htu": "https://switch.npci.org.in/upi/v2/pay",
  "ath": "f8a7e0c8b9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6",
  "iat": 1731693720
}

4. Formal Tamarin Specification & Proof Mechanics

We formalized this payment lifecycle in the Tamarin prover under the theory Agent_Payment_Mandate. The model specifies multi-set rewriting rules for setup, mandate issuance, agent execution, and payment server validation.

4.1 Multiset Rewriting Rules for Protocol Transitions

The core execution transition rules demonstrate how cryptographic proof verification is modeled without bearer token assumptions:

spthy: agent payment execution rule
// The honest agent pays its task's payee, within the cap, at the mandate's
// payment server, with a proof of possession. Requests leak (FAPI 2.0 A5).
rule Agent_Pay:
    [ St_Agent(~rid, $A, $U, $P, cap, $PS)
    , FromAS(~rid, <<'mandate', mid, $U, $A, $P, cap, $PS, pkA>, sigM>)
    , !AgentKey($A, ~sk), Fr(~pid) ]
  --[ AgentPays($A, mid, $P, $amt, $PS), CapIs(cap), AmountOk(cap, $amt) ]->
    [ Out(<'pay', <<'mandate', mid, $U, $A, $P, cap, $PS, pkA>, sigM>, $P, $amt, ~pid,
           sign(<'pop', ~pid, $PS, $P, $amt, h(sigM)>, ~sk)>) ]
spthy: payment server invariant verification rule
// Payment server verifies mandate signature, DPoP proof-of-possession,
// audience, payee whitelist, amount cap, and real-time revocation status.
rule PS_Execute:
    [ In(<'pay', <<'mandate', mid, u, a, p, cap, aud, cnf>, sigM>, payee, amt, pid, proof>)
    , !ASPk(pkAS), !PS($PS) ]
  --[ Eq(verify(sigM, <'mandate', mid, u, a, p, cap, aud, cnf>, pkAS), true)
    , Eq(verify(proof, <'pop', pid, $PS, payee, amt, h(sigM)>, cnf), true)
    , AudCheck(aud, $PS), PayeeCheck(p, payee), AmountCheck(cap, amt)
    , StatusCheck(mid), PaymentId(pid)
    , Debit(u, a, mid, payee, amt, $PS) ]->
    [ ]

4.2 Formal Security Lemmas

The prover evaluates three core trace lemmas representing the required security guarantees:

Lemma P10 (debit_within_intent): Proves that every debit executed for an honest principal moves funds only to an intended payee, at the intended payment server, within the authorized amount cap:

lemma debit_within_intent:
  "All u a m p amt ps #i.
     Debit(u, a, m, p, amt, ps) @ #i & not (Ex #k. User_Dishonest(u) @ #k)
     ==> Ex cap #j. Intent(u, a, p, cap, ps) @ #j & (cap = 'large' | amt = 'small')"

Lemma P11 (no_debit_after_revocation): Proves that no debit succeeds after the mandate has been revoked by the principal, ensuring that delinking takes effect immediately:

lemma no_debit_after_revocation:
  "All u a m p amt ps #i #r.
     Debit(u, a, m, p, amt, ps) @ #i & Revoked(m) @ #r
     ==> #i < #r"

Lemma P12 (debit_requested_by_agent): Proves that for an honest principal and agent, every debit corresponds to an action explicitly initiated by the agent, precluding network replay or injection attacks:

lemma debit_requested_by_agent:
  "All u a m p amt ps #i.
     Debit(u, a, m, p, amt, ps) @ #i & not (Ex #k. User_Dishonest(u) @ #k) & not (Ex #k. Agent_Dishonest(a) @ #k)
     ==> Ex #j. AgentPays(a, m, p, amt, ps) @ #j & #j < #i"
Figure 2 Model 05 Ablation Lattice & Minimal Sufficient Check Sets
Hardened Baseline: All 6 Checks Active Lemmas P10, P11, P12 Machine-Checked & Formally Proved NO_CONSENT Omit User Approval AS issues unapproved mandates; debit steals funds P10 Fails NO_PAYEE Omit Payee Match Agent redirects debit to arbitrary attacker VPA P10 Fails NO_AMOUNT Omit Cap Validation Debits exceed authorized caps, draining balances P10 Fails NO_AUD Omit Server Audience Mandate for Bank A replayed against Bank B payment switch P10 Fails NO_SENDER_CNF Omit DPoP Binding Leaked request replayed with fresh payment identifier P12 Fails NO_ONLINE_REVOC Omit MMS Lookup Agent continues debits after user revokes mandate in mobile app P11 Fails
Figure 2: Machine-checked ablation lattice for Model 05 demonstrating that each security lemma requires an independent, non-redundant cryptographic control.

5. Comparative Evaluation Across Global Payment Schemes

We surveyed emerging industry initiatives for delegated autonomous payments against the formalized model invariants:

Security Invariant Visa Intelligent Commerce / TAP Mastercard Verifiable Intent (v0.1) NPCI UPI Circle (OC 201 & OC 201-B)
Principal Consent Passkey-authenticated instruction Cardholder mandate signed by device key App linking authenticated via UPI MPIN
Payee Binding Merchant name verified against mandate Exact match on allowed_merchants Person-to-merchant delegation; strict VPA binding needed
Financial Caps declineThreshold aggregated per instruction amount_range and cumulative budget Per-transaction (≤5K) and monthly (≤15K) limits
Payment Server Audience Not defined as an explicit audience claim Not found in public draft Not found in public circulars; recommended
Proof of Possession Fresh agentSignature (RFC 9421 HTTP Signatures) Agent key bound with cnf; signs final order Device and user ID validated per payment
Synchronous Online Revocation Issuer-side token revocation; no per-payment check stated Short expiry windows; no real-time lookup defined App delinking; synchronous per-payment check needed

6. Alignment with Indian Policy & Security Frameworks

This technical mapping identifies where each machine-checked protocol check supports stated policy objectives:

Regulatory & Legal Framework Mapping

7. Technical Implementation Checklist for Banks & PSPs

For Payment Service Providers, issuing banks, and payment network operators implementing autonomous agent mandates:

  1. Mandate Issuance: Issue mandates only after capturing explicit principal consent over a dedicated, out-of-band channel (e.g., banking app with biometric or MPIN authentication).
  2. Mandate Structure: Encode exact payee identifiers, transaction ceilings, expiration timestamps, target payment server URI, and the agent's public key into a signed mandate JWT.
  3. DPoP Verification: Require fresh asymmetric proof-of-possession signatures (RFC 9449) over outbound payment requests, validating the signature against the key stamped in the mandate.
  4. Synchronous Revocation: Execute an online query against the central revocation repository (or distributed status ledger) synchronously before committing funds. Do not rely on local token expiration windows.
  5. Replay Cache: Maintain a synchronized payment ID cache to ensure one-time request processing.

8. How to Reproduce Formal Proofs

Every formal model, security lemma, and ablation permutation is fully reproducible via Docker without installing Tamarin or Maude locally:

bash: reproduce formal proofs
docker build -t mcp-auth-tamarin .
docker run --rm mcp-auth-tamarin ./scripts/reproduce.sh

9. References & Primary Sources