Start typing to search this publication.
techcirkle
Open menu

Subscribe to techcirkle

Get new posts delivered straight to your inbox.

Guardrails for AI Agents That Call Payment and Fintech APIs

How to let AI agents call fintech APIs safely: split read and write tools, draft then confirm, scoped OAuth grants and policy kept outside the model.

techcirkle
4 min read
Cover image for Guardrails for AI Agents That Call Payment and Fintech APIs
A developer configuring AI agent tools for a payments system at a workstation in a dark office
A developer configuring AI agent tools for a payments system at a workstation in a dark office

LLM agents are starting to call fintech APIs. Some are internal, automating reconciliation or chasing failed payouts. Some are features inside a product that act for a user. And some belong to your customers, who want their assistant to pay invoices through your API.

The trouble is that fintech APIs were built for callers that behave predictably. A person checks the amount before pressing send. A batch job runs reviewed code. An agent decides its call sequence at run time, can hallucinate a field, and can loop on a retry. This post covers the guardrails we put in place before an agent is allowed anywhere near money.

Principle: the model proposes, deterministic code disposes

Every guardrail below follows from one idea. The model can choose what to attempt. Whether it is allowed is decided by ordinary code that cannot be argued with.

1. Split read tools from write tools

Read access is where agents earn their keep, so be generous with it. Write access should be narrow, typed and capped.

{
  "name": "get_transactions",
  "description": "List transactions for an account the user owns.",
  "input_schema": {
    "type": "object",
    "properties": {
      "account_id": { "type": "string" },
      "from": { "type": "string", "format": "date" },
      "to": { "type": "string", "format": "date" }
    },
    "required": ["account_id"]
  }
}
{
  "name": "draft_supplier_payment",
  "description": "Create a DRAFT payment to an existing, verified payee. Does not send money.",
  "input_schema": {
    "type": "object",
    "properties": {
      "payee_id": { "type": "string" },
      "amount_minor": { "type": "integer", "minimum": 1 },
      "currency": { "type": "string", "enum": ["USD", "GBP", "AED"] },
      "invoice_ref": { "type": "string" }
    },
    "required": ["payee_id", "amount_minor", "currency", "invoice_ref"]
  }
}

Notice what the write tool does not allow: free-text account numbers, new payees or anything but a draft. If an agent needs to add a payee, that is a separate, human-only flow.

2. Draft, then confirm

Most payments APIs already support creating a payment intent and confirming it later. Use that seam. The agent creates the draft; a human or a policy engine confirms it.

agent -> draft_supplier_payment(...)      -> status: "awaiting_approval"
policy engine evaluates draft             -> auto-approve | needs_human | reject
human approves in UI (if required)        -> confirm_payment(draft_id)
service calls provider with idempotency key

The agent never holds a "confirm" tool. Confirmation lives on a different path entirely.

3. Keep policy outside the model

Limits written into a system prompt are suggestions. Limits written into code are rules.

function evaluate(draft: Draft, ctx: Context): Decision {
  if (!ctx.payees.isVerified(draft.payeeId)) return reject("unverified_payee");
  if (sanctions.hit(draft.payeeId)) return reject("sanctions");
  if (draft.amountMinor > ctx.limits.perPayment) return needsHuman("over_per_payment_limit");
  if (ctx.velocity.last24h(draft.payeeId) >= ctx.limits.dailyCount) return needsHuman("velocity");
  if (!ctx.invoices.matches(draft.invoiceRef, draft.amountMinor)) return needsHuman("invoice_mismatch");
  return autoApprove();
}

Sanctions checks, velocity rules, approval thresholds and payee verification all belong here, where a prompt injection hidden in an invoice PDF cannot reach them.

A businesswoman approving online banking payments on a virtual screen
A businesswoman approving online banking payments on a virtual screen

4. Delegate with scoped OAuth, never a copied key

When a customer's assistant calls your API, it should present an OAuth access token from a grant the customer approved, with scopes and limits they chose:

scope: accounts:read transactions:read payments:draft
limits: per_payment=..., per_day=..., payees=verified_only
expires: 30 days, revocable from settings

Never ask customers to paste a full API key into an assistant. A key cannot express "drafts only, under this amount, to these payees", and it cannot be revoked per assistant without breaking everything else.

The same rule applies to your internal agents. Giving one a full-permission key "just for the pilot" is one of the most common mistakes we see.

5. Trace every action end to end

For each financial action, store:

  • Which agent and which version acted.

  • The prompt context and the documents it was given.

  • The exact tool call and arguments.

  • The policy decision and who confirmed.

  • The provider request, response and idempotency key.

Write this to an append-only store. When a dispute or an audit arrives, you need to reconstruct the decision, not just the HTTP request.

6. Reuse the integration foundations

These guardrails sit on top of a sound integration layer: domain services, provider adapters, your own ledger as the source of truth, idempotency keys persisted before each write, and webhooks confirmed by fetching the object. Those patterns are what make an agent's retries harmless and its effects checkable.

A sensible rollout

  1. Read-only agents: reconciliation summaries, support answers like "why was this card declined?", changelog triage.

  2. Draft-only write tools with human approval on every draft.

  3. Policy-engine auto-approval for low-risk, well-matched drafts.

  4. Gradually widen limits based on observed behaviour.

This is the core of how we approach agentic workflow development for finance teams. For the bigger picture, covering API categories, provider evaluation, costs and regional rules, read our full guide to fintech APIs.

Frequently Asked Questions

Should an AI agent ever execute a payment directly?

In most cases, no. Let the agent create a draft or payment intent, then have a human or a deterministic policy engine confirm it on a separate path.

Why not enforce limits in the system prompt?

Prompts can be overridden by injected content or model error. Limits, sanctions checks and approval thresholds must live in code the model cannot influence.

What scopes should a customer's assistant get?

Only what the task requires, typically read access to accounts and transactions plus a draft-only payment scope, with spending limits and an expiry the customer controls.

What should go in an agent audit trail?

The agent and version, its context, the tool call and arguments, the policy decision, who approved, and the provider request, response and idempotency key.

How do idempotency keys help with agents?

Agents may retry or loop. A key generated and stored before each write ensures repeated calls cannot move money twice.

What is a low-risk first agent for a fintech team?

A read-only one, such as summarising reconciliation breaks or explaining card declines from transaction data, which delivers value without write access.

Can an invoice or email trick an agent into paying someone?

It can try, which is why new payees should be added only through a human flow, and why payee verification and invoice matching are enforced in the policy engine.

Subscribe to techcirkle