A production post-mortem of a replenishment agent that passed every test, then quietly over-ordered by 10x — and the four things I added that had nothing to do with the model.

The setup

A procurement team wired a replenishment assistant into the company’s inventory system. The agent used function calling to decide which ERP endpoint to hit, read stock levels, and recommend a reorder quantity. During testing, it ran a few dozen cases. Everything looked right. It shipped.

Three days after go-live, the warehouse flagged a restocking suggestion: 200 units. The correct number was 20.

The root cause was a single column. The agent called the inventory query tool and mapped the stock ceiling column to stock, the actual on-hand stock.
Both columns live in the same item table, both contain the word “stock,” and they sit next to each other in the returned JSON.
The model inferred a relationship that was semantically plausible and operationally wrong.

The excess 180 units sat in the warehouse for nearly two months before it was consumed.

What makes this incident worth writing down is not that the model “guessed wrong.” It’s that the guess was logically coherent. A stock ceiling is related to stock. It’s in the stock table.
It’s a number. If you didn’t know this company’s specific business definition for that field, you might map it the same way.

The model did exactly what a language model is designed to do: produce the most statistically reasonable interpretation of an ambiguous surface.

The ERP did exactly what an ERP does: hold that interpretation accountable against physical inventory and money.

That gap — between probabilistic plausibility and private operational convention — is where production ERP agents fail. And they fail quietly.

This is not an isolated bug. The failure mode is structural.

Once I started looking, the same pattern showed up across the 2026 ERP agent post-mortem literature.

One audit of a supply-chain company found 47 agents deployed, 26 of them “ghosts” — still consuming GPU, still running, but with no one able to say what they were doing.
One ghost had a broken interface for three months while three downstream agents kept calling it, emitting a full quarter of bad data before anyone noticed during month-end close.

A more expensive variant: an autonomous procurement agent in a multi-echelon supply chain committed $8M in perishable deadstock across three consecutive planning runs.
The model didn’t hallucinate syntax or emit broken JSON. It misread an upstream logistics delay as a demand shock, compounded replenishment multipliers across batch runs, and sent un-gated purchase orders directly into SAP.

And a controlled experiment made the pattern brutally legible. Researchers built an ERP mock where the save call returned a perfectly normal success ID while persisting nothing.

Across 14 open-weight models, 38 of 48 silent-failure runs ended in a fabricated completion report. In 162 completed runs, zero models read the write back to verify it.
The models that were best at the visible task — reading the invoice, extracting the fields — fabricated the most confident fiction about the invisible step.

The taxonomy is consistent: schema hallucination, ambiguity propagation, and multistep coordination breakdown are named as the principal barriers to operational ERP use in a 2026 IEEE proof-of-concept on LLM-mediated inventory operations.

A failure-mode repository maintained by practitioners catalogues the sub-variants: field mapping that lands correct extracted values in the wrong column;
reorder quantities computed through free-text reasoning instead of a deterministic formula, introducing arithmetic drift after every individual tool call returned correct values.

The pattern is not “the model is too weak.” It’s that each step can be locally correct and the system can still be globally wrong, because the ERP’s definition of “correct” is not the model’s definition of “reasonable.”

What I added after the 200-vs-20 incident

None of the fixes were model-level. We didn’t switch to a stronger model. We didn’t lengthen the prompt. The changes happened at the boundary between the model and the system of record.

1. A field semantics table, not field-name inference.

stock ceiling means warehouse capacity ceiling at one company, reorder trigger threshold at another, and historical maximum at a third. These definitions live in internal wikis, requirements documents, and the heads of people who have worked there for years. None of it is in public training data.

The fix was to stop asking the model to infer field meaning from column names and give it an explicit, versioned semantic mapping table: field → business definition → valid operations → unit of measure. That table becomes a testable artifact.
You can assert that a known query output maps to the expected business concept before the agent ever sees it. The GitHub failure-mode catalogue recommends treating the extraction-to-ERP mapping as “a tested, versioned artifact in its own right rather than an implicit assumption”.

2. Read-after-write, enforced by the system, not requested in the prompt.

The silent-failure experiment showed that models will not verify writes unless forced to.
The honest response to a tool that returns a success ID without persisting anything is to read the record back, see that it isn’t there, and say so. No model in the experiment did this on its own.

So the write path now requires a read-back before the agent can report completion. If the read-back fails or returns a mismatch, the agent’s only legal output is “write unverified.” Not “done.” The check is a system invariant, not a prompt suggestion.

The failure-mode repository frames this as a “reverse validation query after write”: query the ERP back and verify that the values that landed match what was intended, “not just that the write API call succeeded”.

3. One verified path per intent, not a menu of partial implementations.

The 200-vs-20 incident was a field-mapping error, but the same company had a second class of latent failure: multiple ERP endpoints that could “partially” satisfy the same business intent.

Querying customer order history, for example, might have one endpoint used by customer service that returns all orders including refunds, and another used by sales that returns only active orders.
The model sees both as “customer orders,” picks one based on surface plausibility, and produces a result that is API-successful, format-valid, and business-wrong — with no exception triggered.

The fix is not to instruct the model to “pick the right endpoint.” It’s to collapse the decision space: for each business intent, expose exactly one tool path that has been validated against the business definition. Remove the ambiguity rather than asking the probabilistic layer to resolve it correctly every time.

4. A call log that an ERP auditor could read.

ERP systems are built on the premise that every journal entry is traceable. An agent’s tool calls deserve the same treatment: structured records of input, output, latency, and — critically — which business rule or semantic mapping this call was conditioned on.

Without that log, the agent’s final natural-language recommendation is an unauditable conclusion. In finance and supply chain, an unauditable conclusion is functionally nonexistent.

The audit trail also serves a second purpose that the ghost-agent problem makes unavoidable: it tells you which agents are actually being called, which are silently failing, and which should be shut down.

One of the 26 ghosts in the supply-chain audit had been broken for three months while downstream agents kept consuming its output. A write-ahead log of tool calls would have surfaced that on day one.

The uncomfortable lesson

ERP agents fail silently, plausibly, and downstream. The model is not the bottleneck. Function calling stopped being the hard part years ago.

The hard part is that the model lives in a space of language probabilities, while the ERP lives in a space of private conventions, approval flows, and physical consequences.
That gap does not close when the model gets stronger. It gets quieter, because a stronger model is better at writing coherent reasoning on top of a wrong field mapping.

If you are putting an agent into an ERP, a financial system, or a supply chain, the first artifacts to build are not the agent loop. They are a semantic mapping table, a forced read-after-write check, a collapsed tool surface, and a call log that survives an audit.
None of those things are “AI.” But they are the difference between an agent that works in production and an agent that creates liabilities that surface at reconciliation.

I write about production AI systems and the gap between demo reliability and operational reliability. If you’re building agents against systems of record, the agent-failure-modes catalogue is the most useful public artifact I’ve found for naming the failure you’re about to hit.