Payments and finance

A cap per payment, a budget per day and two people for the large ones: a rule set for agents that pay suppliers or move money.

Updated

An accounts-payable agent reads invoices, matches them to orders and pays them. Most of that is routine. The part that is not, a new bank account on a familiar supplier’s letterhead, is exactly what invoice fraud is built to slip past a busy person, let alone a model.

The risk

  • Changed bank details. A convincing email says the supplier has moved banks. The agent updates the payee and pays the next invoice to the fraudster.
  • Many small payments. A cap per payment does not stop a hundred payments just under it.
  • A misread amount. €1,840.00 read as €18,400 from a scanned PDF, or a duplicate invoice paid twice.

Two kinds of action

Paying and changing who gets paid are different risks, so they get different names. Your code picks the name, not the model:

  • payment.invoice: pay an invoice to a payee already on file, with the bank details on file. It always states the amount.
  • payee.add and payee.change_bank_details: anything that changes where money goes. No amount; always two people.

The rules

  1. Always allow payment.invoice up to €500, €2,000 a day, for ap-agentRoutine invoices to payees already on file are paid at once, until €2,000 has gone out by rule today.
  2. Always ask about payment.* above €1,000, two peopleLarge payments wait for two different people, whatever an allow rule says.
  3. Always ask about payee.*, two peopleAdding a payee or changing bank details is how invoice fraud works. Two people, at any amount.
  4. Never allow payment.* above €10,000Payments that large are made by a person in the bank's own app. A payment with no amount in euros is refused too.
The same rules as API bodies
# POST /v1/workspaces/{workspace_id}/rules, one call per rule
{
  "action": "payment.invoice",
  "agent_key_id": "AP_AGENT_KEY_ID",
  "budget_amount": "2000.00",
  "budget_currency": "EUR",
  "budget_period": "day",
  "effect": "allow",
  "limit_amount": "500.00",
  "limit_currency": "EUR"
}

{
  "action": "payment.*",
  "approvals": 2,
  "effect": "ask",
  "limit_amount": "1000.00",
  "limit_currency": "EUR"
}

{
  "action": "payee.*",
  "approvals": 2,
  "effect": "ask"
}

{
  "action": "payment.*",
  "effect": "deny",
  "limit_amount": "10000.00",
  "limit_currency": "EUR"
}

Owners write rules under Rules in the app, or post these bodies while signed in. Replace the ids in capitals with your own.

In short: up to €500, paid at once within €2,000 a day; €500 to €1,000, one person; €1,000 to €10,000, two people; above that, never. Any change to a payee needs two people at any amount.

The ask and never rules can go in on day one. They never approve anything, so they cannot make you less safe. Only the allow rule needs the evidence of a few weeks of approvals.

The agent’s side

import { ApprovalClient } from "@variantgate/agent";

const approvals = new ApprovalClient({
  agent: "ap-agent",
  apiUrl: process.env.VARIANTGATE_API_URL ?? "https://api.variantgate.com",
  key: process.env.VARIANTGATE_KEY ?? "",
});

export async function payInvoice(invoice: Invoice) {
  // Pay only payees on file, with the bank details on file, never the PDF's.
  const payee = await payees.get(invoice.supplierId);
  if (!payee || payee.iban !== invoice.iban) {
    throw new Error("New or changed bank details: ask for payee.change_bank_details first.");
  }
  return approvals.guard(
    {
      action: "payment.invoice",
      summary: `Pay ${payee.name} €${invoice.total} for invoice ${invoice.number}`,
      amount: invoice.total,
      currency: "EUR",
      details: { supplier: payee.name, iban: masked(payee.iban), invoice: invoice.number, due: invoice.due },
      ttlSeconds: 24 * 60 * 60, // two people may take a day
    },
    async () => {
      const transfer = await bank.transfers.create({
        amount: invoice.total,
        currency: "EUR",
        iban: payee.iban,
        reference: invoice.number,
        idempotencyKey: `invoice-${invoice.id}`,
      });
      return transfer.id; // kept on the record
    }
  );
}
  • The code checks the payee against your own records before it asks. A changed IBAN never reaches payment.invoice; it has to go through payee.change_bank_details and two people first.
  • The request stays open for a day, since two people may not both be at their desks within the default 15 minutes.
  • This code pays invoices in full. If a person lowers the amount, the guard pays nothing and records the request as not done. Deny with a note instead, and the agent can tell the supplier why.
  • The transfer id goes on the record as the outcome, next to who approved it.

What the people approving see

ap-agent

payment.invoice · asked just now

23 h left

Pay Nordlicht GmbH €1,840.00 for invoice 2026-0412

€1,840.00as stated by the agent

1 of 2 approvals: ana@example.com

due

2026-11-30

iban

DE89 … 3000

invoice

2026-0412

supplier

Nordlicht GmbH

How this request looks in the inbox, with example values.
  • The first approval shows on the card. The request waits until a second, different person approves; one denial stops it.
  • Both approvers are on the record, and an approval that needs two people cannot be remembered as a rule from the inbox.
  • Once the day’s €2,000 has gone out by rule, small invoices wait for one person until the budget starts again at midnight UTC.

Rolling it out

  1. Day one: the cautious rules only. The never rule and the two two-person rules. Every other payment waits for one person.
  2. Weeks one to four: read the record. Export it as CSV and look at payment.invoice amounts approved without a second look.
  3. Add the allow rule below that line, for the AP agent’s key only, with a daily budget no bigger than a bad day you could recover from.
  4. Keep a second lock at the bank. A payment limit on the account the agent uses fails differently from these rules.

Why caps, budgets and a second person each catch something the others miss is in spending limits for AI agents and two-person approval.