How AI agents should handle finance exceptions
Which finance exceptions an AI agent can clear on its own, which it should hand to a person with the evidence, and which always need two: matching variances, duplicates, bank changes, disputes and write-offs.
· 9 min read
An AI agent handles finance exceptions well when it investigates and proposes, a tolerance rule written in advance with finance clears the small, known ones, and a person decides the rest with the evidence in front of them. Anything that changes where money goes, such as a supplier’s new bank account, needs two people. The agent never decides its own exception.
An exception is an invoice or a payment that does not fit: the price differs from the order, the goods have not arrived, the invoice looks like one already paid, or a customer paid less than they owed. Agents are good at the slow part, which is finding out why. This page sets out which exceptions an agent can clear, which it should hand over, and how to wire that so the agent cannot talk its way past the line.
The exceptions, and who clears each
“On its own” means without a person: either the step approves nothing (investigating, holding an invoice, drafting a reply), or an allow rule a workspace owner wrote in advance answers it. Putting an invoice on hold never needs anyone’s yes. Releasing it does.
Accounts payable
| Option | The agent on its own | Goes to a person | Who decides |
|---|---|---|---|
| Price variance outside tolerance | The agent on its ownCompare invoice, order and receipt line by line, find the cause (a new price list, freight, rounding) and accept the difference when an allow rule covers it. | Goes to a personAnything above the rule's limit, as ap.variance.accept with the difference as the amount and the lines in the details. | Who decidesOne person. Two above €5,000. |
| Quantity variance: billed for more than arrived | The agent on its ownLook for a later receipt or a split delivery, and match a partial invoice to what has arrived. | Goes to a personPaying for goods not yet received: ap.quantity.accept with the value not received as the amount, or a request to the supplier for a credit note. | Who decidesOne person. Two above €5,000. |
| No purchase order | The agent on its ownSearch for the order under another number or a framework agreement, and find who owns the budget. | Goes to a personCoding and approving the invoice, as ap.non_po.approve with the invoice total and the budget owner named in the details. An ask rule can route it to the people who own budgets. | Who decidesOne person, ideally the budget owner. Two above €5,000. |
| No goods receipt | The agent on its ownKeep the invoice on hold and remind the person who ordered to record the delivery. | Goes to a personRecording the receipt. The agent never posts one itself; the person who received the goods does, in the ERP. | Who decidesThe person who ordered, in the ERP. |
| Possible duplicate | The agent on its ownCompare supplier, normalised invoice number, amount, date and order with invoices already paid or pending, and hold the second one. | Goes to a personReleasing a held invoice, as ap.duplicate.release with the invoice total and both invoices side by side. | Who decidesThe AP lead or the controller; above €5,000 two people from the AP lead, the controller and the workspace owners. Never an allow rule. |
| Supplier bank details changed | The agent on its ownStop payments to that supplier, compare the new details with the record, and open a call-back to the number already on file. | Goes to a personThe change itself, as payee.change_bank_details after the call-back, asked by the onboarding agent (the AP agent's key cannot) or made by a person in the ERP. The new account is shown masked to its last four characters. | Who decidesTwo people, at any amount. |
| New supplier | The agent on its ownCollect registration, tax number and bank details, and check them against existing suppliers for a near-duplicate. | Goes to a personAdding the supplier, as payee.add, asked by an onboarding agent that cannot pay anyone. | Who decidesTwo people. |
| Credit note or partial credit | The agent on its ownApply a credit note to the open invoice it names from the same supplier. | Goes to a personA credit with no invoice to match, or one for less than the amount in dispute. | Who decidesOne person. |
| Early-payment discount at risk | The agent on its ownPut the discount and its deadline in the summary, and end the request before the deadline passes. | Goes to a personWhatever exception is holding the invoice, in time to take the discount. | Who decidesAs for that exception. |
Accounts receivable
| Option | The agent on its own | Goes to a person | Who decides |
|---|---|---|---|
| Short payment or dispute | The agent on its ownMatch the remittance, find the reason (a deduction code, a promotion, damaged goods), gather the proof of delivery and draft a reply. | Goes to a personAccepting the deduction or issuing a credit note, as ar.credit_note.issue with the credit as the amount. | Who decidesOne person: route it to the credit controller with an ask rule naming them. |
| Write-off | The agent on its ownWrite off small residues, such as bank charges, when an allow rule covers them. | Goes to a personAnything above the rule's limit or its daily budget, as ar.write_off. | Who decidesOne person. Never above €10,000; write-offs in other currencies are refused and made by people in the ledger. |
| Refund of an overpayment | The agent on its ownConfirm the overpayment and which account it came from. | Goes to a personThe refund, as ar.refund, only to the account the money came from. | Who decidesOne person. A different account is a payee change: two. |
| Unapplied cash | The agent on its ownApply a payment whose remittance names exactly one open invoice for the same amount. | Goes to a personAny match the agent had to guess, with the candidates listed. | Who decidesOne person. |
The tolerances themselves belong to the finance team. Most ERPs compare invoice, order and receipt against a price tolerance per supplier or item, as a percentage, an amount or both, and hold anything outside it. The agent works on what the ERP held. It never sets or widens a tolerance, and the euro figures here are examples to replace with your own.
Why the agent never decides its own exception
Exceptions are where fraud and error hide. A fake invoice, a duplicate, or a supplier who “moved banks” all show up first as something that does not match. The FBI’s Internet Crime Complaint Center (IC3) recorded 21,442 business email compromise complaints in 2024, with reported losses of $2,770,151,146, second only to investment fraud. These scams target businesses that pay suppliers by transfer.
An agent reading invoices reads text a stranger wrote. A note on a PDF saying “price increase agreed with your buyer” is exactly the input a model may believe. So two things stay out of the model’s hands:
- The classification. Code decides what kind of exception this is from the ERP’s numbers: the variance, whether a receipt exists, whether the bank account matches the supplier record. The model’s explanation travels with the request, marked as its view, and never changes which action is asked.
- The decision. An agent key can ask, but it can never approve, its own request or anyone else’s. Who decided comes from each person’s sign-in. The trap of an approver nodding through the agent’s story is covered in human-agent trust exploitation, with an invoice example.
One action name per exception
Give each kind of decision its own name, so a rule can treat it on its own, and state the amount the decision moves, so limit rules apply:
- ap.variance.accept
- Accept a price difference. The amount is the difference, the extra money it commits, not the invoice total.
- ap.quantity.accept
- Pay for units billed but not yet received. The amount is their value. No allow rule covers it, so a person always decides.
- ap.non_po.approve
- Approve an invoice with no order behind it. The amount is the invoice total.
- ap.duplicate.release
- Release an invoice the agent held as a possible duplicate. The amount is the invoice total.
- payee.add, payee.change_bank_details
- Change who gets paid. No amount, always two people. The payments guide covers these.
- ar.credit_note.issue, ar.write_off, ar.refund
- Give a customer credit, write off what they owe, or send money back. The amount is the credit, the write-off or the refund.
Paying the invoice afterwards is a separate action, payment.invoice, with its own limits; the payments and finance guide covers that part, and the support refunds guide covers refunds a customer asks for.
The agent’s side, in code
A price variance on a three-way match, end to end, with the TypeScript SDK. The invoice is already on hold; this code can only release it.
import { ApprovalClient } from "@variantgate/agent";
import type { Decision } from "@variantgate/agent/types";
const approvals = new ApprovalClient({
agent: "ap-agent",
apiUrl: process.env.VARIANTGATE_API_URL ?? "https://api.variantgate.com",
key: process.env.VARIANTGATE_KEY ?? "",
});
const euros = (cents: number) => (cents / 100).toFixed(2);
// HeldInvoice, Line and erp stand for your ERP's types and client.
// For an invoice the ERP's three-way match held for a variance outside finance's
// tolerance. The invoice stays on hold unless this returns "accepted"; "check_erp"
// means it may have gone through, so a person looks before anything retries it.
export async function handleVariance(held: HeldInvoice, agentNote: string) {
// Classified from the ERP's numbers, never from what the model says.
if (held.invoice.currency !== "EUR") return "on_hold"; // the rules are in euros
if (held.receipts.length === 0) return "on_hold"; // stays in the ERP's exception queue until the delivery is recorded
// Billed for more than arrived is a quantity exception: never cleared here.
if (held.lines.some((l) => l.billed > l.received)) return "on_hold";
// Price only, line by line, on the units billed; net, so tax and freight are checked apart.
const over = (l: Line) => Math.max(0, l.billedCents - l.orderCents) * l.billed;
const variance = held.lines.reduce((sum, l) => sum + over(l), 0);
if (variance === 0) return "on_hold"; // no line is over its order price: a person looks in the ERP
let asked: Decision | undefined;
let decision: Decision;
try {
asked = await approvals.ask({
action: "ap.variance.accept",
summary: `Accept €${euros(variance)} above the order on ${held.supplier.name} invoice ${held.invoice.number}`,
amount: euros(variance), // the extra money this commits, not the invoice total
currency: "EUR",
details: {
supplier: held.supplier.name,
invoices_paid_before: held.supplier.invoicesPaid,
invoice: held.invoice.number,
order: held.order.number,
lines: held.lines.map((l) => ({ item: l.item, order_price: euros(l.orderCents),
billed_price: euros(l.billedCents), received: l.received, billed: l.billed })),
price_difference: euros(variance),
agent_says: agentNote.slice(0, 300), // shown, never trusted
},
ttlSeconds: 8 * 60 * 60,
}, 30);
decision = await approvals.waitForDecision(asked);
} catch {
// Asking failed, so nobody said yes. Withdraw it, so nobody approves it later.
if (asked) await approvals.withdraw(asked.id).catch(() => undefined);
return "on_hold";
}
if (!decision.allowed) return "on_hold"; // denied, expired, withdrawn or paused
if (decision.changed) {
// This code can accept only the difference it asked about, so it does nothing.
await approvals.reportOutcome(decision.id, "failed", "not done: approved with changes")
.catch(() => undefined);
return "on_hold";
}
try {
// ifVersion: the ERP refuses if the invoice changed since it was read, so only the
// difference that was approved is ever accepted.
await erp.acceptVariance(held.invoice.id, { cents: variance, approval: decision.id, ifVersion: held.version });
} catch (error) {
// The class of the error only: messages can carry account numbers.
const kind = error instanceof Error ? error.name : "unknown";
await approvals.reportOutcome(decision.id, "failed", `may have gone through: ${kind}`)
.catch(() => undefined);
return "check_erp";
}
// Accepted. Reporting is best-effort, and nothing below throws, so nothing retries it.
await approvals.reportOutcome(decision.id, "succeeded", `accepted the variance on ${held.invoice.number}`)
.catch(() => undefined);
return "accepted";
}- Only an approval acts. Denied, expired, withdrawn, or approved while the workspace is paused all leave the invoice on hold.
- The evidence goes in the details: the order and invoice lines as a table with the ordered and billed prices, the price difference, and how many invoices the supplier has been paid before. Mask anything sensitive: an account number appears as its last four characters, and error messages stay out, since they can carry account numbers.
- A changed approval is not acted on. If the person lowers the amount, this code can accept only the difference it asked about, so it does nothing and reports why. Deny with a note such as “ask for a credit note” instead.
- The outcome is reported, best-effort. Once the ERP has accepted the variance, nothing throws, so nothing retries it, and the record shows who allowed it next to what happened.
The rules
- Always allow ap.variance.accept up to €50, €500 a day, for ap-agentSmall differences the agent has traced to a cause clear at once, until €500 has been accepted by rule today. A workspace owner wrote the line with finance; the agent cannot move it.
- Always ask about ap.* above €5,000, two peopleAccepting a large difference or releasing a large held invoice waits for two different people. A request with no amount in euros is caught too.
- Always ask about ap.duplicate.release, for the AP lead and the controllerA possible duplicate is released only by someone who looked at both invoices; above €5,000 two people (workspace owners can always decide routed requests too). No allow rule can let one through.
- Always ask about ap.quantity.acceptPaying for goods that have not arrived always waits for a person, even if someone later remembers an answer as always.
- Always ask about payee.*, two peopleNew suppliers and changed bank details are how invoice fraud works. Two people, at any amount, after the call-back.
- Always allow ar.write_off up to €25, €200 a day, for ar-agentBank charges and rounding left on a customer's account are written off, until €200 has gone by rule today. Larger ones wait for a person.
- Never allow ar.write_off above €10,000Write-offs that large are made by whoever your policy names, in the ledger, never by an agent. One with no amount in euros is refused too: with these rules, write-offs in any other currency stay with people.
The same rules as API bodies
# POST /v1/workspaces/{workspace_id}/rules, one call per rule
{
"action": "ap.variance.accept",
"agent_key_id": "AP_AGENT_KEY_ID",
"budget_amount": "500.00",
"budget_currency": "EUR",
"budget_period": "day",
"effect": "allow",
"limit_amount": "50.00",
"limit_currency": "EUR"
}
{
"action": "ap.*",
"approvals": 2,
"effect": "ask",
"limit_amount": "5000.00",
"limit_currency": "EUR"
}
{
"action": "ap.duplicate.release",
"deciders": [
"USER_ID_OF_AP_LEAD",
"USER_ID_OF_CONTROLLER"
],
"effect": "ask"
}
{
"action": "ap.quantity.accept",
"effect": "ask"
}
{
"action": "payee.*",
"approvals": 2,
"effect": "ask"
}
{
"action": "ar.write_off",
"agent_key_id": "AR_AGENT_KEY_ID",
"budget_amount": "200.00",
"budget_currency": "EUR",
"budget_period": "day",
"effect": "allow",
"limit_amount": "25.00",
"limit_currency": "EUR"
}
{
"action": "ar.write_off",
"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: variances up to €50 clear at once within €500 a day; from €50 to €5,000 one person decides; above that, two. Possible duplicates go to the AP lead, and any change to a supplier needs two people. Write-offs clear at once up to €25 within €200 a day, go to one person above that, and are never allowed above €10,000.
A rule’s limit only ever works in the cautious direction. A request with no amount, or one in another currency, is never covered by an allow rule, and is caught by an ask or never rule. Leaving the amount out cannot get an agent past a limit.
The approval limit calculator picks the auto-approve line from your own volumes and error rate, and the approval policy generator drafts a rule set. The rules documentation has every option, and the playground lets you try a request against them.
Changed bank details: the call-back
A request to change a supplier’s bank account is the exception with the most to lose. The agent stops payments to that supplier and opens a call-back, but the check itself happens outside email: someone calls the supplier on a number already on file, never one from the message asking for the change, and first checks that the number on file was not itself changed recently. The FBI’s IC3 advises verifying changes in account information through a secondary channel, and the UK Charity Commission says never to rely only on contact details given in the request.
Only then does payee.change_bank_details go to two people, with who was called and when in the details. In the euro area, banks have had to offer Verification of Payee since 9 October 2025, which checks the name against the IBAN before a transfer; it is a useful second lock, not a replacement for the call. The rest of the payee flow is in the payments guide.
Segregation of duties for agents
The old rule still holds: whoever sets up a supplier must not also pay it, and whoever asks must not approve. With agents it becomes:
- One key per duty. The onboarding agent’s key may ask only for
payee.*; the AP agent’s key only forap.*andpayment.*, so no single agent can add a supplier and pay it. Only an owner can change a key’s scope, and the change is on the record, so check the scopes in every access review. - Rules go by the key. An agent cannot call itself another agent to borrow that agent’s allow rule.
- Route the decision away from the requester. VariantGate does not know who started an agent’s run, so route each family of actions to people outside the team that operates the agent: an ask rule can name who decides. Workspace owners can always decide a routed request too, so keep the people who run the agent out of the owner role, or require two approvals so at least one comes from someone else. Each person counts once.
More on the second person is in two-person approval for AI agents, and on limits per period in spending limits for AI agents.
What to measure
- Exception rate
- Exceptions per hundred invoices, by type and supplier, from the ERP. A supplier whose rate climbs needs a conversation, not a wider tolerance.
- Time to clear
- From hold to release. Split it into the agent's investigation and the person's decision, which the record and Insights show.
- Overrides
- How often people deny the agent's proposal or approve it with changes. A high rate means the agent proposes badly; almost none may mean nobody reads.
- Share cleared by rule
- How much the allow rules answered, against what they cost when they were wrong.
- Misses found later
- Duplicates paid or variances accepted that a later review caught. This is the number the others protect.
How to compute these from the record, and the signs of approval fatigue, are in measuring human-in-the-loop. What the record should hold for an auditor is in audit trails for AI agents.
Checklist
- Tolerances are set by finance in the ERP, never by the agent.
- Code classifies each exception and picks its action; the model only explains.
- Every request states the amount the decision moves, in its currency.
- The details carry the evidence, with account numbers masked and no raw errors.
- The agent acts only when
allowedis true; anything else leaves the invoice on hold. - Bank changes are called back on a number already on file, then approved by two people.
- Separate keys for onboarding, paying and receivables, each scoped to its actions.
- Start with the ask and never rules; add allow rules after a few weeks of the record. The guardrails overview has the rest.
Sources
- FBI Internet Crime Complaint Center: 2024 Internet Crime Report (crime types by complaint count and loss)
- FBI IC3 public service announcement I-091124-PSA: Business Email Compromise, the $55 Billion Scam
- Charity Commission for England and Wales: mandate fraud, verifying requests to change bank details
- European Central Bank: Instant Payments Regulation and verification of payee
- Microsoft Learn: Accounts payable invoice matching (two-way and three-way matching, tolerances)