The model prepares a draft; it does not post the order
An incoming email may contain a customer, SKU, quantity, price, and delivery date in free text. A model can extract these fields, but similar products or “the terms from last time” can turn missing context into an error.
The safety boundary is proposal versus action. The model prepares a draft and shows the email excerpt behind each value. A validator and employee retain control over binding records, stock changes, and terms. OWASP classifies insufficient validation of LLM output before downstream components as Improper Output Handling.
Processing flow
1. A service stores the original email and assigns an identifier.
2. The model extracts customer, items, quantity, price, currency, and date into a fixed schema.
3. A validator independently checks types, required fields, reference data, and business rules.
4. The interface shows each value beside its source excerpt.
5. An employee resolves discrepancies and approves the order.
6. A separate adapter sends the approved structure to ERP through its supported API.
If a field lacks evidence, leave it blank and route it to a person. JSON Schema validates response shape, not truth. Before writing, check the customer, SKU, price, totals, duplicates, and conflicts with existing documents.
Permissions and pilot
Do not give the model an ERP password or let it generate SQL. The adapter account needs permission to create an order for the relevant organization. Protect retries with an idempotency key. Log schema and model versions, validator decisions, employee actions, and ERP results without copying full emails or secrets.
Start with one order type and a de-identified sample in shadow mode. Measure unchanged fields, price and quantity errors, review time, ambiguous emails, duplicate writes after failures, and cost per accepted order. Enable writes only after failure tests and end-to-end savings are demonstrated.
