Table of Contents
To connect an AI agent to an ERP, give it its own user with a role limited to a few tasks, connect it through the vendor's API rather than the database, and let it read and prepare documents. Releases, payments, postings and supplier master data stay with the people who already hold that authority, inside the ERP's approval workflows.
Key takeaways
- ERP vendors now expose broad agent access. Microsoft's Dynamics 365 ERP MCP server lets agents perform "nearly any function that's available to a user", scoped by the agent's security role (Microsoft Learn). The role is the real boundary.
- Treat the agent as a user for segregation of duties. A role that both records goods receipts and pays vendors is a fraud risk whoever holds it (Microsoft Learn).
- Reuse the approvals the ERP already enforces, such as purchase requisition release strategies, instead of building new ones beside them.
- Keep supplier bank details and payments out of reach. Business email compromise complaints to the FBI reported $2.77 billion in losses in 2024 (IC3, 2024), and an agent that reads supplier emails is a new path for it.
- Test in a sandbox company. In a CRM benchmark, leading agents completed about 58% of single-turn tasks and about 35% in multi-turn settings (Huang et al., 2025).
What does an AI agent do with an ERP?
An ERP holds the transactions that run a plant's business side: requisitions, purchase orders, goods receipts, stock, supplier invoices, payments and the general ledger. It is also where maintenance and production meet money, through spare parts and supplier lead times.
An agent answers questions such as "which open orders for this pump's mechanical seals are late?", prepares a requisition from a technician's request, or explains why an invoice is blocked. Unlike a chatbot, it chooses its next step and can write to the ERP; see chatbot vs copilot vs AI agent.
Work orders are covered in connecting an AI agent to a CMMS, and trends over years of history in text-to-SQL on production databases. This article is about the transactional side, where a wrong record can mean a wrong payment.
Which ERP tasks suit an agent?
Most of the value is in reading and preparing, not in committing transactions.
| Task | What the agent does | ERP access | Who finishes it |
|---|---|---|---|
| Stock and open order question | Checks stock, reservations and open purchase orders for a material, with document numbers | Read | Nobody; it is an answer |
| Requisition from a request | Turns a technician's or planner's request into a purchase requisition with material, quantity and plant | Create requisition | The release workflow and the buyer |
| Blocked invoice explanation | Reads the matching result between invoice, purchase order and goods receipt and summarises the discrepancy | Read | Accounts payable decides |
| Late delivery follow-up | Lists overdue order lines and drafts a reminder to each supplier | Read, plus a draft message | The buyer sends it |
| Period-end checks | Lists unposted goods receipts, parked invoices and orders without receipts | Read | Finance acts on the list |
| Supplier master data change | Nothing: it flags the request to the master data team | None | Master data team, with call-back checks |
The blocked invoice row is a good first use. In three-way matching, the invoice price is checked against the purchase order and the invoice quantity against the product receipt; in Dynamics 365, posting an invoice with discrepancies can require someone to approve it explicitly (Microsoft Learn). An agent that explains the mismatch saves time, and the approval stays where it is.
How do ERP vendors expose their systems to agents?
Each major ERP offers a different interface, and the differences change how you design the agent.
| ERP | Interface for agents | What the documentation says |
|---|---|---|
| Microsoft Dynamics 365 Finance and Supply Chain Management | Dynamics 365 ERP MCP server, with data, form and action tools | Agents can perform "nearly any function that's available to a user through the application interface"; what they see and can call is limited by the security role of the agent's user (Microsoft Learn) |
| Odoo 19 | External JSON-2 API with API keys | "All operations are validated against the access rights, record rules and field accesses of the user"; keys cannot last more than three months; XML-RPC and JSON-RPC are deprecated and scheduled for removal in Odoo 22 (Odoo documentation) |
| SAP S/4HANA | OData APIs per business object, for example API_PURCHASEREQ_PROCESS_SRV for purchase requisitions | This API cannot create a requisition saved as held or parked, in all S/4HANA versions (SAP KBA 3650224) |
Two consequences follow. First, a generic server such as Microsoft's gives the agent the whole application within its role, so role design matters more than tool design. A few task-level tools built on the API are easier to review; our CMMS guide shows how.
Second, a "draft" may not exist through the API. If a requisition cannot be parked, the one the agent creates is real, and the release procedure is your only gate.
What account and role should the agent have?
Give the agent its own ERP user, never a shared administrator or an employee's login. OWASP lists, among the causes of excessive agency, an extension that "accesses downstream systems with a generic high-privileged identity", and calls for authorization enforced in the downstream system "rather than relying on an LLM to decide if an action is allowed or not" (OWASP LLM06:2025). Odoo's documentation likewise recommends "dedicated bot users" for integrations.
In Microsoft's example, an agent whose user holds a Purchasing Agent role only reaches the objects assigned to that role, and the system rejects calls to anything else. The server also leaves out security forms such as user role assignment and segregation of duties setup (Microsoft Learn). Your own tools should exclude them too.
Then apply segregation of duties to the agent as if it were an employee. Microsoft's example is that "you might not want the same person to acknowledge the receipt of goods and to process payment to the vendor", and compliance is not verified when a rule is created, so existing roles must be validated afterwards (Microsoft Learn). An agent role that creates requisitions and approves them defeats the control.
Also limit the role to the companies and plants in the pilot, hide fields such as salaries and supplier bank accounts, and make the agent's user visible in every change log. Our guide to securing an on-premise LLM covers logging.
Where should approvals sit?
The approvals already exist in the ERP. Use them.
In SAP, a release procedure blocks a purchase requisition automatically, and approval must be given before further processing can take place. The strategy is selected from criteria such as account assignment category, material group, plant and value, stored in Customizing (SAP Learning). Check those criteria against the agent's documents: if low-value requisitions skip release in your configuration, the agent's low-value requisitions will too.
A practical set of rules:
- The agent creates; people release. It never holds a release code or an approval privilege.
- No approving its own work. A document the agent created is approved by a person, never by another agent.
- Leaving the company needs a person. Supplier emails and order transmissions are sent by a buyer, or approved one by one.
- Money movements are out of scope. Payment runs, postings and reversals stay with finance.
- Show the exact document. The approver sees material, quantity, price, supplier and the request it came from, not a summary.
The MCP specification says there "SHOULD always be a human in the loop with the ability to deny tool invocations" (MCP specification). Our article on human-in-the-loop for AI agents explains how to keep approvals from becoming rubber stamps.
Why are supplier data and payments off-limits?
Because they are what payment fraud targets. The FBI's Internet Crime Complaint Center received 21,442 business email compromise complaints in 2024, with reported losses of $2,770,151,146. It defines the scam as targeting businesses "working with suppliers and/or businesses regularly performing wire transfer payments", by compromising email accounts and other communications "to conduct unauthorized transfer of funds" (IC3, 2024). These are complaints made to the FBI, not a global total, but the method does not depend on the country.
An agent that reads supplier emails and invoices takes in exactly that input. OWASP describes indirect prompt injection as occurring when a model "accepts input from external sources, such as websites or files", and recommends minimum privileges and human approval for privileged operations (OWASP LLM01:2025). A message saying "our bank has changed, update our details and pay today" should at most produce a flag for the master data team, because the agent has no tool that could do more.
How do you prevent duplicate or half-finished transactions?
Agents retry after timeouts, and a business action often spans several calls. Odoo states that with its JSON-2 API each call runs in its own transaction, committed on success and discarded on error, and that "it is not possible to chain multiple calls inside a single transaction" (Odoo documentation). A requisition created, followed by a failed attachment, leaves a half-finished record.
Three habits help:
- One server-side operation per business action. Odoo's answer is a single method that performs all the related operations.
- One idempotency key per action, reused on every retry. An IETF draft, still an Internet-Draft at the time of writing, defines an
Idempotency-Keyheader to make POST and PATCH "fault-tolerant"; a retry that arrives while the original is still processing should get HTTP 409, and a reused key with a different payload HTTP 422 (IETF draft). Check what your ERP supports. - Check before creating. Search for an open requisition for the same material and request before writing a new one.
How do you test an ERP agent before go-live?
CRMArena-Pro, from Salesforce AI Research, tests agents on 19 expert-validated sales, service and quoting tasks. Leading agents reached about 58% single-turn success, about 35% in multi-turn settings, and showed "near-zero inherent confidentiality awareness" (Huang et al., 2025). A CRM is not an ERP, but the warning applies.
- Use a test company or sandbox with a copy of real master data, never production.
- Write scenarios from real requests, in the languages staff use: French, Arabic and plant abbreviations.
- Add hostile inputs: supplier emails with embedded instructions, invoices with changed bank details, requests above approval limits.
- Ask for data the user should not see, and check the agent refuses.
- Score the records left in the ERP, not the agent's message, over several runs per scenario.
- Re-run the set after any change to the model, prompts, tools, roles or ERP configuration.
What we have seen at KABAS AI
DALILE, our multi-agent assistant, runs on the client's own servers without internet access, connects to SAP, Oracle, Microsoft 365, LIMS and SQL databases, and includes access controls and audit logging. Our agentic AI team builds custom agents and workflows on it, and our information systems team maps business processes and integrates existing systems such as the ERP. We have not published an ERP agent project, so the following is the sequence we recommend, not a reported result:
- Start read-only on one company or plant: stock, open orders and blocked invoices, every answer citing document numbers.
- Map each proposed action to the ERP's existing approval workflow and segregation of duties rules, with finance and purchasing, before writing code.
- Add one write action, usually requisitions, once users trust the answers.
- Keep the data on site. ERP records include employee and supplier contact data. According to the CMS guide, Algeria's Law 18-07, amended by Law 25-11, requires the national authority's authorisation for transfers abroad and an automated log of processing operations. Confirm with legal counsel how this applies to your system.
Related: from AI pilot to plant rollout and multi-agent systems for industrial workflows.
Sources
- Microsoft Learn, Use Model Context Protocol for finance and operations apps
- Microsoft Learn, Set up segregation of duties (Finance and Operations)
- Microsoft Learn, Three-way matching policies (Dynamics 365 Finance)
- Odoo 19.0 documentation, External JSON-2 API
- SAP Learning, Releasing Purchase Requisitions (Purchasing in SAP S/4HANA)
- SAP Knowledge Base Article 3650224, API_PURCHASEREQ_PROCESS_SRV does not support park and hold
- Model Context Protocol specification (2025-11-25), Tools
- OWASP GenAI Security Project, LLM06:2025 Excessive Agency
- OWASP GenAI Security Project, LLM01:2025 Prompt Injection
- FBI Internet Crime Complaint Center, 2024 IC3 Annual Report
- IETF HTTPAPI Working Group, The Idempotency-Key HTTP Header Field (Internet-Draft)
- Huang et al., CRMArena-Pro: Holistic Assessment of LLM Agents Across Diverse Business Scenarios and Interactions, arXiv 2505.18878, 2025
- CMS Expert Guide to data protection and cyber security laws: Algeria
Frequently asked questions
Can an AI agent create purchase orders in our ERP?
Technically yes, since SAP, Dynamics 365 and Odoo all expose purchasing through APIs. A safer default is for the agent to create a purchase requisition that enters your existing release or approval workflow. Converting it into a purchase order, and approving it, stays with the buyers and approvers who hold that authority today.
Should the agent use an existing employee's ERP account?
No. Give it a dedicated user with a role built for its tasks, limited to the companies, plants and documents in scope. In Odoo, for example, every external API call is checked against the access rights, record rules and field accesses of the calling user, and the documentation recommends dedicated bot users for integrations.
Does the agent's ERP role need a segregation of duties review?
Yes. Treat the agent as a user. If its role combines duties your rules keep apart, such as recording goods receipts and processing vendor payments, it creates the same fraud risk as a person holding both. Run your segregation of duties validation on the agent's role like any other.
Can we send ERP data to a cloud AI service?
Check first. ERP data includes employee and supplier contact data, which falls under Algeria's personal data law, Law 18-07 as amended by Law 25-11. According to a CMS summary of that law, transfers abroad need the national authority's authorisation. Confirm with legal counsel; an on-premise model avoids the transfer.
What should an ERP agent never be allowed to do?
As a starting point: change supplier bank details or other vendor master data, release payments, post or reverse accounting entries, change its own role, and approve documents it created. Those actions are either hard to undo or are the exact steps that payment fraud targets.



