Finance · 11 min read

Published

The work between the finance systems

Where an AI agent is useful between the ERP system, the bank and the inbox, what should be ordinary code, and what the Swedish Bookkeeping Act and the e-invoicing act require of whoever builds it.

Take an invoice from a haulage firm to a manufacturing company. It arrives as a PDF in the finance department's shared inbox, and someone enters it into the ERP system. The order number is missing, so the question goes to purchasing. The amount is higher than the freight contract says because an extra trip has been added, and the production manager who has to approve it is travelling. Two weeks later the haulage firm calls to ask where the payment is. In March the auditor wants to see the contract behind the price.

The ERP system handled what was normal: the supplier existed, the account existed and the payment went out with the bank file. The rest was done by people reading in one system and writing in another, or in an email. That is the work between the finance systems. It rarely appears in any written procedure, but it is often where the working hours go.

1. Four kinds of work between systems

Go through the invoice step by step and the manual work comes down to four things.

  1. Fetching: finding the order, the contract or the delivery note in another system.
  2. Comparing: the invoice against the order, the price against the contract, the bank against the ledger.
  3. Asking and reminding: emailing purchasing, chasing an approval that has got stuck, answering the supplier.
  4. Explaining: putting together the supporting documents when the auditor asks, or when a discrepancy has to be commented on in the financial close.

The same four kinds turn up in accounts receivable, in group reconciliations and in the financial close.

2. Another system means more seams

It is tempting to buy one more system for whatever falls in between, such as a portal for exceptions or a dashboard showing what is pending. But every new system has its own data and its own logins, and someone has to move the data into and out of it, so the seams multiply.

An agent can instead do the work in the seams, in the systems you already have. It fetches the order, compares it with the contract, reminds the approver and answers the supplier about the payment. Anything that needs a decision is left to a person, with the supporting documents gathered in one place. The ERP system is still where business transactions are recorded. How to set up that way of working in finance is covered in AI in finance, and how to get it right.

3. Most of the work between systems is code

Work that needs a person today does not necessarily need a language model. Sort each step by what decides it.

Who does itWhat decidesExamples from the supplier invoice workflow
CodeKnown rule, structured dataMatch the invoice to the order and delivery. Duplicate check. Bank account against the supplier register. VAT, account coding, approval policy.
ModelKnown rule but varying input, or reading free textInterpret an invoice that only exists as a PDF. Understand a supplier's question in an email. Suggest an order for an invoice with no order number.
HumanAmbiguity, accountability or irreversible consequencesApprove a price discrepancy above the limit. Confirm changed bank details. Decide an accrual that rests on judgement.

Most of the fetching and comparing ends up in the first row. Duplicate and bank account checks, VAT logic, account coding and approval are handled by ordinary code. The model may read free text and draft replies, but it must never be the only check before a payment. Why most workflows need no model at all is explained in Most workflows need no AI at all.

4. Changed bank details are checked by code

In May 2026 the Swedish Police Authority warned of a growing number of scam emails targeting companies. The fraudster sends email that appears to come from a known supplier, with new bank details, or poses as a senior executive and orders an urgent, confidential payment. Attackers can also get into real email accounts, read the conversations and send convincing messages. So an email coming from the right address proves nothing. The advice is to confirm unusual payment requests through a channel other than email, for example by phoning. The Police Authority's page on invoice fraud also covers invoices for things that were never ordered: dispute them in writing and report them to the police.

A language model reads text and does what the text says, if the text is convincing enough. That makes it useful, and it is also a vulnerability: prompt injection comes first on OWASP's 2025 list of the ten biggest risks in applications built on language models. Content from external sources, such as files or web pages, can change the model's behaviour in ways nobody intended. An email with new bank details is that kind of content. Simon Willison calls the combination of access to private data, untrusted content and the ability to communicate externally a lethal trifecta, and advises never giving an agent all three.

We assume that an agent can be tricked by content it reads. That is why an agent that has read untrusted text must not be able to trigger payments or send data onwards. The limit is set in the agent's permissions, because the agent can be talked out of an instruction in its prompt in the same way. The sign-off step is an approval check, not a security control. Security lies in what the agent can do at all: least privilege and no tools it does not need.

For changed bank details, that means three things.

  1. Code compares the bank account on the invoice with the supplier register, every time, whatever the invoice or the email says.
  2. If the account differs, the payment is stopped. No model may decide that the discrepancy is reasonable.
  3. A person confirms the change through a channel other than the email before the register is updated. The agent may prepare the case but not close it.

An email is a claim. A bank account in the supplier register is verified information. The agent must never be able to confuse the two.

5. The Swedish Bookkeeping Act, line by line

The Swedish Bookkeeping Act (BFL, 1999:1078) does not mention AI, but it governs what has to happen to the information an agent handles.

The Act saysProvisionWhat it means for the agent
There must be a voucher for every business transaction, stating when it was compiled, when the transaction took place, what it relates to, the amount and the counterparty. Information about the transaction that has been received must be used as the voucher.Chapter 5, Sections 6 and 7What a model extracts from the invoice does not replace the invoice. The invoice that came in is the voucher.
Electronic documents the company has received must be kept in the format and with the content they had when they arrived.Chapter 7, Section 1, third paragraphThe agent may process a PDF, but the original must be kept as it arrived.
A document that is transferred to another document may be destroyed only if the transfer involves no risk of the information being altered or lost.Chapter 7, Section 6A model's interpretation can be wrong, so it does not replace the original.
If an accounting entry or a voucher is corrected, it must be stated when and by whom.Chapter 5, Sections 5 and 9If the agent corrects something, it must be visible that it was the agent, when, and on what basis.
The company must describe how the accounting system is structured (system documentation) and the processing carried out in it, so that it is possible without difficulty to follow and understand how each accounting entry has been handled (processing history).Chapter 5, Section 11Our reading: if an agent codes, matches or corrects entries in the accounts, the log of that is part of the processing history.
Accounting records must be kept up to and including the seventh year after the end of the calendar year in which the financial year ended, and stored in Sweden. Electronic documents may be stored in another EU country if the location is notified to the Swedish Tax Agency (for certain companies, Finansinspektionen), if the Tax Agency or Swedish Customs gets immediate electronic access on request, and if the information can be printed out in Sweden.Chapter 7, Sections 2 and 3 aIt decides where the agent may store what it produces and where it may send documents.

A finance director already knows these rules. Whoever builds the agent must be able to show how it handles each line, and the auditor should see the set-up before the agent goes live.

6. E-invoicing: what the law requires

The more structured the incoming material, the less work there is between the systems. An e-invoice needs no model, because the amount, counterparty, dates and lines are already fields. A PDF has to be read.

The Swedish Act on electronic invoices following public procurement (2018:1277) states that invoices a supplier issues to a contracting authority or entity must be electronic and follow the European standard the Commission has referred to, unless the parties have agreed on another standard (Section 4). Contracting authorities and entities are obliged to receive and process invoices that follow the standard (Section 5). The requirement applies to invoices from procurements begun on or after 1 April 2019, direct awards included. A PDF invoice or a scanned paper invoice does not count as an e-invoice under the Act. The National Agency for Public Procurement recommends the Peppol BIS Billing 3 format, an implementation of the EN 16931 standard. Contracting authorities and entities must also be registered in Peppol to be able to receive e-invoices, under regulations from the Agency for Digital Government (DIGG), MDFFS 2019:1.

If you are a municipality or another contracting authority, or you sell to the public sector following a procurement, you are directly affected. Outside public procurement the Act sets no requirements, and there the format is a matter between you and the supplier. Every supplier that moves from PDF to Peppol removes a step where a model would otherwise have had to interpret.

7. Two responsibilities to keep apart

An AI project in the finance workflow involves two kinds of responsibility. Finance owns the rules: what the agent may do, where the limit for a price discrepancy lies and when a case should go to a person. These are the same kind of questions the approval policy already answers, and it is the finance director or the head of accounting who knows where the exceptions are and what the auditor tends to ask about. IT owns the environment, the permissions, security and logging, and is needed from day one.

Whoever owns the workflow must be able to pause the agent without waiting for a developer. Prompts, rules and model versions are handled as code changes, and nothing goes into production without your approval for each release. For rule changes, that approval should come from finance.

The division of responsibility is the same wherever the solution runs. We build in your environment, whether that is Microsoft, Google or something else, or run the solution ourselves.

8. Before you start

Start with a workflow where the rules are already written down, in the approval policy, the contracts and the supplier register, and where the manual work consists mostly of fetching and comparing. There, most of it can become code, and what is left for a model is limited. How to map the workflow before anything is built is covered in Don't put AI on a broken process.

Go through the questions below with the people who do the work today, before you talk to any supplier, us included.

  1. Which of the four kinds of work between systems takes the most time in your organisation, and in which workflows?
  2. What share of your supplier invoices arrive as e-invoices, and which suppliers account for the PDFs?
  3. How are changed bank details checked today, by whom and through which channel?
  4. Where in the workflow does a check rely on someone usually noticing when something is wrong? That check should become code.
  5. Who owns the workflow's rules, and who approves a change to a rule?
  6. Can you show the auditor who corrected an entry, when and why? If not, that has to work before any agent corrects anything.
  7. Where are your accounting records stored, and which services are allowed to receive them?

Sources

  1. Swedish Bookkeeping Act (Bokföringslag (1999:1078)) Chapter 5, Sections 5, 6, 7, 9 and 11, and Chapter 7, Section 1, third paragraph, and Sections 2, 3 a and 6
  2. Swedish Act on electronic invoices following public procurement (Lag (2018:1277) om elektroniska fakturor till följd av offentlig upphandling) Sections 1, 4 and 5, and point 2 of the transitional provisions
  3. National Agency for Public Procurement (Upphandlingsmyndigheten), Rules for e-commerce and e-invoicing (Regler för e-handel och e-faktura) The sections Vad räknas som e-faktura, Europeisk standard och Peppol (what counts as an e-invoice, European standard and Peppol) and the question on direct awards, read 31 October 2026
  4. Agency for Digital Government (DIGG), Regulations on registration in Peppol (Föreskrift om registrering i Peppol (MDFFS 2019:1)) Section 2, in force 1 December 2019, as amended by MDFFS 2026:1
  5. Swedish Police Authority (Polisen), Growing number of scam emails targeting companies (Ökande antal bluff-mejl mot företag) News item, 25 May 2026, the sections Kännetecken och metoder (characteristics and methods) and Verifiera alltid (always verify)
  6. Swedish Police Authority (Polisen), Invoice fraud (Fakturabedrägeri) Page reviewed 3 July 2026
  7. OWASP Top 10 for LLM Applications 2025, LLM01: Prompt Injection The section on indirect prompt injection from external sources
  8. Simon Willison, The lethal trifecta for AI agents Post published 16 June 2025

Would you rather have someone do the maths on your own workflow than read about it?

Book 20 minutes

More articles.

See all articles
Finance

AI in finance, and how to get it right

11 min read

Why neither an AI assistant for everyone nor a point solution for each problem holds up in a finance department, and how background agents are built within the approval policy and the Swedish Bookkeeping Act.

Finance

Automating a process: do the maths first

7 min read

Four numbers are enough to tell you whether a task is worth streamlining or automating away. The calculation we do in every mapping, and the three places where it tends to lie in your favour.