Guide
Stop your AI agent paying the same invoice twice
25 October 2026
finance · accountspayable · aiagents · automation
This article was created with the help of AI by the Screwtape.ai team. Product details were checked against screwtape.ai/pricing, /docs and /openapi.json on 2026-10-24.
Duplicate payments are an old accounts-payable problem. The same invoice arrives twice: once by email and once through the portal, or re-sent with a new number after a reminder. A person pays one, a colleague pays the other.
AI agents don't remove that problem. An agent that reads invoices and queues payments will do exactly what it is told, every time a document arrives. If two copies arrive, it can approve both, quickly and confidently.
The fix is not a better prompt. It is a check that runs before the payment goes out, outside the agent, every time.
What a duplicate check should compare
A useful duplicate check looks at more than the invoice number, because duplicates rarely look identical:
- Vendor + invoice number + amount. The obvious case: the same invoice submitted twice.
- Vendor + amount + date within a short window. Catches a re-sent invoice with a new number, or a typo in the number.
- Currency. 1,000 USD and 1,000 EUR are not the same bill.
The result should not be a plain yes or no. "Possible duplicate" is a real answer, and the right response to it is to stop and ask a person, not to guess.
Where the check should live
Put it between "the agent decided to pay" and "the payment is released":
- The agent extracts the invoice and proposes a decision.
- A separate check compares it with invoices already seen, and checks the basics: required fields present, line items adding up to the total.
- Only a clean result lets the payment continue. A duplicate or possible duplicate goes to a person.
Keeping the check outside the agent matters. An agent asked "have you paid this already?" answers from whatever is in its context. A separate service answers from a record.
What to keep as proof
When an auditor or a controller asks why a payment went out, "the agent said it was fine" is not an answer. Keep, for every decision:
- what was checked and the result,
- when it was checked,
- a record you can show later that has not been edited since.
How Screwtape.ai does it
Screwtape.ai decides whether an AI agent is allowed to spend money, and keeps the proof. It is a separate check that runs outside your agent.
- Duplicate invoice check (
POST /v1/duplicate): compares an invoice with the ones your API key recorded earlier, by vendor, invoice number and amount, with an optional same-vendor, same-amount, near-date rule. The answer isunique,duplicate,possible_duplicate,replayornot_checked. Duplicates and possible duplicates escalate to a person. Only keyed fingerprints are stored, and only when you ask it to store them. - Invoice checks: required fields, line items plus tax equal the total, and fields that must match the purchase order values you pass in.
- Signed receipts: every verdict comes with a receipt you can verify yourself.
On the Team and Finance Control plans you also get 15-minute single-use pass tokens bound to the exact invoice, amount and vendor, linked tamper-evident receipts, and policy rules such as amount caps, a vendor allowlist and second approval.
A duplicate check only knows what it has seen, so it works best when every invoice your agent handles goes through it. Verdicts come from AI models and automated checks, and they can be wrong. Keep a person in charge of payments.
Try it free (100 calls a day), then see the team plans: screwtape.ai/pricing.
