An AI assistant that makes up a part number or an on-hand quantity isn't a quirky chatbot problem. It's a buyer ordering the wrong material, or a customer getting a ship date that never existed.
The fix isn't a smarter model. It's making the assistant look up every fact in your ERP at the moment it answers, through permissioned tools, and show where each number came from. When the data isn't there, it should say so. That's the approach behind our work on making AI trustworthy on manufacturing data, and it's what this post walks through.
Key takeaways
- Don't let the model answer ERP questions from memory. Every number should come from a live query against the system of record.
- Give the AI named, role-scoped tools ("get on-hand," "get job cost") instead of a database login.
- Require a citation and an as-of time on every answer, and make "I don't know" an acceptable answer.
- Grounding reduces hallucinations but doesn't end them. Stanford researchers found retrieval-based legal AI tools still gave wrong information 17% to 34% of the time (Stanford HAI). Test and review.
- A cited wrong number is still wrong. Clean, owned data does more for accuracy than any prompt.
In this post
- Why do AI assistants hallucinate on ERP data?
- What does a grounded ERP answer look like?
- Six safeguards that keep ERP answers honest
- How do you test an ERP assistant before people rely on it?
- The failure nobody talks about: cited but wrong
- Where Magic fits
- Frequently asked questions
Why do AI assistants hallucinate on ERP data?
Because a language model is built to produce a plausible answer, not to admit it can't see something. NIST's Generative AI Profile calls this confabulation: "confidently stated but erroneous or false content" that can mislead the people relying on it.
ERP questions are where that hurts most. A general model has never seen your item master, your open orders, or this morning's inventory. If it isn't connected to them, it fills the gap with something that sounds right. Ask why Line 3 missed schedule when it can see the order header but not the downtime log, and it will still write a confident explanation.
Even a connected assistant goes wrong in a few predictable ways:
- It answers from training data or an old export instead of querying the live system.
- It picks the wrong field, like standard cost when you asked about actual cost.
- It sees part of the picture, say the ERP but not the MES, and fills in the rest.
- It runs out of retrieved facts halfway through an answer and keeps writing anyway.
What does a grounded ERP answer look like?
A grounded answer is built only from data the assistant retrieved for that question, with the source attached. The assistant doesn't "know" your inventory. It asks for it.

There are four steps. The question arrives with the user's identity. The model calls a named, permissioned tool instead of writing its own SQL. The integration layer reads the system of record. Then the model writes an answer using only what came back, and cites the record and the time it was read.
This is the idea behind retrieval-augmented generation (RAG): pair the model with a retrieval step so answers come from a source you control, not from what the model memorized. For ERP data, that retrieval is usually a live query or API call, not a document search. Policies and SOPs live in files. What happened on second shift lives in systems.
Open standards such as the Model Context Protocol (MCP) make this easier. An MCP server exposes a fixed menu of tools, each with a name and defined inputs, so the assistant works through approved operations instead of improvising.
Put this into action: list the ten questions your planners, buyers, and customer service team ask most, and the ERP record that answers each one. That list is your first set of AI tools. See how Magic MCP turns existing integration flows into AI tools.
Six safeguards that keep ERP answers honest
No single control stops hallucinations. You stack them, starting with the data.

1. Clean, owned data
Agree on one system of record per field and a named owner for it. When the ERP and the MES disagree about a part, the tie-break should be written down, not left for the model to guess.
2. Shared definitions (a semantic layer)
Write down what "on hand," "late," "available to promise," and "job cost" mean in your business, and which fields and filters produce them. Build those definitions into the tools so the model never has to work out a formula on its own.
3. Governed, role-based access
Give the assistant named operations scoped per user and per role, not a service account with blanket database rights. A supervisor and a controller can ask the same question and get different answers, because they're entitled to different data. Log every call.
4. Live retrieval, not model memory
Any factual claim about orders, inventory, costs, or customers should come from a tool call made for that question. If an answer contains a number that didn't come from a tool result, treat it as a defect.
5. Answer rules: cite it or say you can't
Tell the assistant to cite the system, record, and as-of time behind every number, and to say plainly when it can't find something or isn't allowed to see it. "I can't see open quality holds for that part" is a good answer.
The OWASP guidance on LLM misinformation lists the same core defenses: retrieve from trusted sources, cross-check outputs, keep human oversight for critical information, and tell users where the AI's reliability ends. Where an answer feeds another system, constrain it to a fixed structure such as a JSON schema so the next step can check it.
6. Evals, human review, and audit logs
Test before rollout, keep testing after, and keep a person in the loop for decisions that cost real money. Logs of who asked what, which tools ran, and what came back let you trace any answer after the fact.
How do you test an ERP assistant before people rely on it?
Build a set of real questions with known answers, run it before launch, and rerun it whenever the model, prompts, or data connections change. Grounding helps a lot, but it isn't a guarantee.
When Stanford researchers tested legal research tools built on retrieval-augmented generation, Lexis+ AI and Ask Practical Law AI produced incorrect information more than 17% of the time, and Westlaw's AI-Assisted Research more than 34% of the time. General-purpose chatbots in their earlier study hallucinated 58% to 82% of the time on legal queries (Stanford HAI). Retrieval cut the error rate. It didn't remove it.
A practical test plan for ERP data:
- Collect a few dozen real questions your users ask, with the correct answer and source record for each.
- Include questions the assistant should decline: data it can't see, data the user isn't allowed to see, and parts or orders that don't exist.
- Check every number in every answer against the source record, not just whether the answer sounds right.
- Sort the misses by type (wrong field, stale data, invented value, missing refusal) and fix the cause. It's usually a tool or a definition, not the prompt.
- Rerun the full set after every model, prompt, or integration change.
The failure nobody talks about: cited but wrong
Grounding stops the model from inventing things. It doesn't help when the data is wrong before the model reads it. If production is back-flushed once a day, the "live" on-hand number is a snapshot of a shift that already ended. If the job ran a different routing than the costed BOM, the assistant will cite standard cost to the cent and still be wrong.
That answer passes every hallucination check. It's sourced, cited, and traceable. And a cited wrong number travels further inside a company than an obvious hallucination, because it survives review. Our seven steps to AI-ready manufacturing cover how to close those data gaps before an assistant goes live.
Not sure how current or consistent your ERP data really is? Magic's IT/OT AI Readiness Assessment scores data completeness, data integrity, and access controls before anyone builds an assistant. Learn about the assessment.
Where Magic fits
We don't sell a model. Magic MCP is a model-agnostic governance layer that sits between whatever AI you use and the systems that hold the truth. It turns existing Magic xpi integration flows into secure, callable tools, so the AI gets a catalog of named operations like "get job cost" or "get current on-hand" instead of a database credential.
Every call carries the user's identity and role, every call is logged, and responses can carry the as-of time of the underlying read, so a stale number shows up as stale. Because it works with Claude, Copilot, and other models side by side, the governance you build doesn't have to be redone when you change models (more on running mixed AI tools).
Underneath, Magic xpi connects ERP, CRM, WMS, MES, and the plant floor through 100+ pre-built connectors, and Magic Engineering makes sure the floor data exists in the first place.
Frequently asked questions
Can you completely stop an AI from hallucinating?
No, but you can make it rare and easy to catch. Live data, required citations, permission to say "I don't know," and regular testing cut errors sharply. Even well-built retrieval tools still make mistakes, so keep a person in the loop for high-stakes decisions.
Is RAG enough for ERP data?
Not on its own. Document search works for manuals and policies, but inventory, open orders, and job costs change by the hour. Those should come from live, permissioned queries against the system of record.
Should we fine-tune a model on our ERP data instead?
Usually not for factual answers. Fine-tuning shapes style and patterns, but the model still answers from memory, and your data changes every day. Live tool calls keep answers current and traceable.
How do we keep the AI from showing people data they shouldn't see?
Enforce permissions in the tools, not the prompt. Each call should carry the user's identity, and the integration layer should return only what that user's role allows.
What should the assistant do when the data isn't there?
Say so plainly, name what's missing, and stop. A clear "I can't see that" costs far less than a confident wrong answer.
Does this work with Copilot, Claude, or other models?
Yes. The safeguards live in the data and integration layer, not the model, so they carry over when you change or mix models.
Ready to trust the answers?
An AI assistant is only as trustworthy as the data it can reach and the rules it has to follow. Get those right, and your team can stop double-checking every number. Michelman used Magic xpi to automate syncing between JD Edwards and Salesforce and raised data accuracy between the two from 40% to more than 90% (read the story). That kind of clean, consistent data is what a grounded assistant needs.
If you want an assistant your team can rely on for ERP answers, start with the data. Book a time with our team.


