An AI agent that reads the ERP creates few problems. An agent that writes to it (creating a supplier, approving an invoice, changing a VAT rate, releasing a production order) changes the nature of the risk. The question is no longer the quality of an answer but an accounting or logistics posting that commits the company, sometimes irreversibly.
This article is a practical guide for CIOs, CISOs and internal control leads at mid-sized companies. It does not rehash general AI governance (see our AI governance framework for CIOs and CISOs) or connection architecture (see MCP and ERP: connecting AI agents without opening every door). It answers a narrower question: which controls to put in place, and in what order, before letting an agent write.
Why an agent is not a user like any other
It is tempting to treat an agent like a new hire: one account, one role, done. That reasoning fails on four counts.
- Speed. An accountant makes a keying error on one batch of invoices. A misconfigured agent repeats the same error across thousands of lines before anyone notices. After-the-fact controls, calibrated for humans, arrive too late.
- Volume. Internal audit sampling assumes a flow a human can review. With an agent, the flow exceeds the usual sampling capacity, so you need automated controls and thresholds.
- No judgment. A human notices that an invoice “looks off” without always being able to say why. An agent applies the most probable reasoning, even when the context should raise a flag. It can also produce a convincing justification for a wrong decision.
- Prompt injection. An agent that reads external documents (invoice PDFs, supplier emails, attachments) can receive instructions hidden in that content. A bank account changed by text slipped into an invoice is the classic scenario. A human ignores that kind of instruction; an agent may execute it if nothing stops it. The OWASP Top 10 for LLM Applications lists prompt injection and excessive agency among the major risks.
The practical conclusion: controls must sit outside the agent, in the ERP and in the organization, not in the prompt. An instruction such as “never approve anything above €5,000” is not a control. It is a suggestion.
Identity and permissions: a dedicated service account, least privilege
One account per agent, never a shared one
Each agent gets its own technical identity, named and tied to a human owner. Three mistakes come up regularly:
- the agent uses an administrator’s account “to make it work”;
- several agents share the same service account, which makes the audit trail unreadable;
- the agent inherits the full rights of the user who invokes it, including rights the task does not need.
Vendors are moving in this direction. Microsoft documents that Copilot Studio can assign each agent a Microsoft Entra Agent ID, manageable in the Entra admin center, and that an agent user must be created before Dataverse security roles can be assigned to it.
Three permission levels: read, propose, write
Rather than slicing rights object by object from day one, structure them into three generic roles, then refine by domain (procurement, accounting, inventory):
| Level | What the agent can do | Example |
|---|---|---|
| Read | View data within its scope | Read orders and receipts to answer a question |
| Propose | Create a draft or suggestion with no accounting effect | Prepare a reconciliation entry in “to be approved” status |
| Write | Record or approve in the ERP within defined limits | Post a compliant invoice below a threshold |
The rule: every agent starts at read, moves to propose after testing, and gets write access only for tightly bounded actions. In most projects, the “propose” level already delivers most of the productivity gain.
Segregation of duties (SoD) traps
Segregation of duties is where agents create the most internal control debt. The central trap: a single agent, or two agents sharing one identity, that both creates and approves. A few concrete cases:
- the agent creates the supplier and approves its payment;
- the agent enters the purchase order and receives the goods;
- the agent proposes a manual journal entry and approves it;
- a reconciliation agent approves the variances it detected itself.
SoD conflict tools (see our SoD tool comparison and the SoD controls to implement before the annual audit) must therefore include agent identities in their analysis scope. An agent missing from the conflict matrix is a blind spot your auditor will find.
Another trap: the agent that acts on behalf of a user and accumulates that user’s rights with those of its own account. Define clearly whether the agent acts under its own identity (fixed rights) or under delegation (the user’s rights, restricted). Mixing both models without an explicit rule makes SoD impossible to verify.
Autonomy thresholds: amount, risk, reversibility
The autonomy level is not decided agent by agent but action by action. Three criteria are enough for a first matrix:
- the amount of the transaction;
- the risk (fraud, compliance, customer or supplier impact);
- reversibility: can it be cleanly undone (reversal, credit note), or is the effect final (payment sent, return filed)?
Each action falls into one of three zones: automatic, human approval, prohibited.
| Agent action | Low amount, reversible | High amount or sensitive | Irreversible |
|---|---|---|---|
| Classify a document, extract fields | Automatic | Automatic with sampling | Not applicable |
| Match an invoice to a purchase order, zero variance | Automatic | Human approval | Human approval |
| Match with a price or quantity variance | Human approval | Human approval | Human approval |
| Create or change a supplier or bank account | Prohibited for write, propose only | Prohibited | Prohibited |
| Issue a payment | Prohibited | Prohibited | Prohibited |
| Change configuration (VAT, accounts, permissions) | Prohibited | Prohibited | Prohibited |
| Send a customer payment reminder by email | Automatic (approved template) | Human approval | Human approval |
The actual figures (what counts as a “low amount”) come from your internal policy and risk appetite. Anchor them to your existing signing authority limits: an agent should never have more autonomy than the management level whose task it takes over.
A concrete example: supplier invoice matching
An agent processes supplier invoices received by email. Its path, with guardrails:
- Read: it extracts the supplier, purchase order number, lines and amount from the PDF.
- Check: it compares them with the order and the goods receipt (three-way match).
- Compliant and below threshold: it posts the invoice in “to pay” status, without issuing a payment.
- Variance: it creates a draft with the variance highlighted and sends it to the accounts payable accountant, who decides.
- Sensitive case: any bank detail change found in the invoice is blocked and escalated to internal control, never applied by the agent.
Step 5 neutralizes the injection scenario mentioned earlier: even if the PDF contains a malicious instruction, the agent simply has no right to write to the supplier record.
Audit trail: record what the agent read, decided and changed
For an agent, the ERP’s standard logging (who changed which field, when) is not enough. It says what changed, not why. A usable audit trail captures five elements:
| Element | Why |
|---|---|
| Agent identity and version (model, prompt, configuration) | Know which behavior produced the action |
| Input: prompt, source document, instruction received | Reconstruct the context and detect an injection |
| Data read in the ERP | Prove what information the decision rests on |
| Decision and justification produced | Enable review and challenge |
| ERP object created or changed, with reference | Link the decision to the accounting or logistics entry |
For actions subject to approval, add the identity of the human who approved and a timestamp. That is what separates a real approval from a reflex click.
The link with SOX, GoBD, GDPR and the AI Act
- SOX and internal control. Controls automated by an agent must be documented and tested like any key IT control. See our guide on the ERP audit trail and retention periods (in French).
- GoBD (Germany) and FEC (France). The entry produced by the agent remains an accounting entry: it must be traceable, unalterable and retained under the same rules, whatever its origin.
- GDPR. Prompts and data read may contain personal data (contact names, bank details of sole traders). The agent’s log is therefore itself a processing activity: retention period, restricted access, minimization. And if a fully automated decision has significant effects on an individual, Article 22 of the GDPR applies.
- AI Act. For high-risk systems, Article 12 requires the ability to automatically record events, Article 14 requires human oversight (understanding the system’s limits, staying aware of automation bias, being able to disregard, override or reverse an output, and to interrupt the system), and Article 26 requires the deployer to assign oversight to competent, trained and empowered people, and to keep logs for at least six months unless a longer period applies. Most ERP agents are not high-risk systems under Annex III, and the application timeline has seen adjustments: check it with your DPO and read our analysis of the AI Act’s impact on ERP. But these three articles describe practices that are reasonable to apply to any agent that writes.
Testing and sandbox before production
Do not test an agent on “clean” cases. Build a test set that reflects what your teams actually encounter:
- nominal cases, to measure the rate of good decisions;
- edge cases: price variances, duplicates, currencies, credit notes, partial invoices;
- adversarial cases: a document with a hidden instruction, a homonym supplier, changed bank details;
- permission tests: verify that the agent fails when it attempts an out-of-scope action.
The sandbox must be an ERP test environment with anonymized or fictitious data, not production in “read mode”. Document the results and have the process owner sign them off: that is the evidence your internal control function will require.
Finally, plan a kill switch: the ability to suspend a single agent without stopping the others or the ERP, and to revoke its identity within minutes.
Monitoring: which indicators to track
Once in production, an agent is managed like any process. Five indicators are enough to start:
- Human rejection rate: the share of agent proposals corrected or refused. A sharply falling rate may signal real improvement, but also reflex approvals.
- Exception rate: the share of cases the agent sends back to a human.
- Drift: how decisions change over time after a change of model, prompt or data. Any version change triggers a new testing phase.
- Out-of-scope attempts: actions refused by the ERP for lack of rights. A rise is a signal to investigate.
- Cost: the agent’s consumption (model calls, licenses) against the cost of manual processing.
Pair these indicators with a periodic review, for example monthly at the start, with the process owner and internal control.
A 4-step rollout plan
- Inventory and classify. List the planned actions and assign each a zone (automatic, human approval, prohibited) using the matrix above.
- Set up identity. Create the service accounts and the read/propose/write roles, and include them in the SoD analysis.
- Test in a sandbox. Nominal, edge and adversarial test set, permission tests, process owner sign-off.
- Deploy to production in stages. Start with propose-only, measure, then open write access on the safest scope, with enhanced monitoring.
| Control | Owner | Expected evidence |
|---|---|---|
| Dedicated service account per agent | CIO / IAM | List of identities, named owner |
| Least privilege, three role levels | CIO / business | Approved role matrix |
| Agent included in the SoD analysis | Internal control | Conflict report |
| Approved autonomy matrix | CFO / business | Signed document |
| Full logging (input, reads, decision, write) | CISO | Usable log sample |
| Test sets and adversarial tests | Business / CISO | Signed test report |
| Kill switch tested | CIO | Dated revocation test |
| Periodic indicator review | Internal control | Monthly minutes |
What vendors say about these controls
The three vendors our readers ask about do not communicate at the same level of detail.
- SAP Joule. According to the SAP reference architecture documentation and the vendor’s publications, Joule relies on the user’s existing roles and authorizations, and SAP presents human-in-the-loop controls for critical decisions, with progressively increasing autonomy. Check in your contract and configuration what is actually enabled.
- Microsoft Copilot and Dynamics 365. Microsoft emphasizes the agent’s own identity via Entra Agent ID: permissions visible in Entra, security roles to be assigned explicitly, administrative oversight. The identity model is therefore close to what this article describes.
- Odoo. The Odoo 19 AI agents documentation states that an agent with no assigned “topic” can only provide information, without modifying the database, and lets you restrict the agent to given sources. At the time of writing it does not detail fine-grained, agent-specific permission controls: validate this with your integrator, relying on Odoo’s standard access rights.
In all three cases, the substantive control stays on your side: a vendor provides mechanisms, not your autonomy policy. For a side-by-side view of features, read our agentic AI comparison of SAP Joule, Sage, Odoo and Microsoft.
Common mistakes
- Relying on the prompt for control rather than on ERP permissions.
- Using an administrator or shared account “to go faster”.
- Leaving agents out of the SoD matrix.
- Granting write access before measuring quality in propose mode.
- Logging the ERP write but not the input or the justification.
- Not providing a per-agent kill switch.
- Measuring productivity gains without tracking the human rejection rate and drift.
- Letting human approvals turn into automatic clicks because volume is not under control.
- Changing the model or prompt without rerunning the test battery.
Going further
Our ERP internal control checklist is available on our lead magnet page: it helps you document the evidence your auditors expect. If you want an outside review of your agents’ permissions (accounts, roles, segregation of duties conflicts), DigitsLane performs ERP access audits. To explore the wider framework, also read our guide on zero trust ERP access security (IAM, PAM, MFA) and our overview of ERP hyperautomation.