No script releases a payment
Automation is good at preparing a payment run. It should never be able to release one. Releasing money is a separate act, and it belongs to a person with a name and a time.
Drafting is cheap, releasing is not
Drafting a payment run is mostly reading and sorting. A script reads the approved invoices, builds the batch, adds up the total, and puts the lines in order. That work is repetitive, easy to get wrong by hand, and cheap to redo. If the batch is wrong, you throw it away and build it again.
Releasing money is not like that. Once a payment leaves, it is gone. You cannot rebuild it. You have to ask the supplier for the money back, and sometimes you cannot.
This is why the two acts need different rules. A script that can release a payment is one bug away from paying the wrong supplier. One leaked password is enough. The same goes for an AI agent. If an agent can press "pay", then one day it will press it for a reason nobody checked. It will not be a dramatic failure. It will be a plausible-looking batch with one wrong line in it, or a supplier name that almost matches the one you meant.
So keep the two apart. Let the machine do the boring part, and keep the deciding part with a human who can be asked afterwards why they did it.
Where the gate sits
The flow has four steps. Only one of them moves money, and it is done by a person.
| Step | Who | What is recorded |
|---|---|---|
| 1. Reads approved invoices and drafts the batch | Who: script | Recorded: batch file and its total |
| 2. Compares the batch with the approved invoices and samples lines | Who: person | Recorded: reviewer name, date, result |
| 3. Releases the batch with their own login | Who: person | Recorded: approver name, date, time |
| 4. Reads the bank confirmation and matches it back to the batch | Who: script | Recorded: matched and unmatched lines |
The gate is between step 2 and step 3. Nothing leaves before a person acts. Steps 1 and 4 are the script's work: one before the gate, one after it. Steps 2 and 3 are people, and each of them leaves a record.
Note what step 3 says: their own login. Not a shared account, not a service account, not a button on a dashboard that anyone can press. The person who releases the batch should be the person whose name is on the release.
Step 4 matters as much as the rest. The script reads the bank confirmation and matches it back to the batch it drafted. When a line does not match, it says so, and a person looks at it. A batch that was released is not finished until someone has seen that it landed.
The control total
A gate is only as good as what the reviewer checks. A small number does most of the work: the control total.
Here is a worked example, with made-up numbers. A batch holds 12 payments totalling 48,250.00. The approved invoices for those same suppliers also total 48,250.00. The difference is 0.00.
| Payment batch, 12 payments | 48,250.00 |
|---|---|
| Approved invoices, same suppliers | 48,250.00 |
| Difference | 0.00 |
The batch goes to the approver only when the difference is zero. If it is not zero, the batch stops where it is and someone looks at why.
The total catches the errors that are hard to see line by line: a missed invoice, a payment added twice, a line edited after approval, a currency that changed. It will not catch everything. A wrong supplier with the right amount passes the total without a word, which is why step 2 also samples lines.
The script should also flag possible duplicates before the reviewer opens the file. Same supplier, same amount, same invoice number. Or same supplier and same amount within 7 days. The reviewer decides what to do with a flag. The script only has to raise it, clearly, next to the line it belongs to.
When one invoice in the batch looks wrong, re-add it line by line with the invoice check and compare the result with the total printed on it.
Keys the script must not have
The simplest way to keep a script out of the release step is to make sure it cannot reach it.
The script's account can read invoices and write a draft file. That is all it needs. It must not hold any login, token or certificate that can approve or release. Not "only for emergencies". Not "turned off for now". Not a key with a note saying it should not be used.
Passwords and keys live in a local configuration file, outside the code. Never inside the script, where they end up in a copy of the file someone sends to a colleague. Never in a shared folder, where the list of people with access is a guess. The script reads the file, does its job, and stops. Someone else decides what happens to the draft.
When a batch is released, the bank sees a login that can release payments. That login should belong to the approver, not to the tool.
Check your own files
You do not need a review to start this. You need a list.
- List every account, token and certificate your scripts use.
- For each one, ask: can this approve or release a payment?
- For every release in the last month, is there a recorded name and a time?
- Is there a control total before approval, and is a non-zero difference a stop, not a warning?
If any of the first two answers is uncomfortable, that is the work. Move the key. Close the account. Put the release back behind a person.
No script releases a payment.
Write the rule down in that one sentence and keep it where the scripts live.