Field notes: from an AI answer to a safe purchase
A lesson from an ongoing journey into forward-deployed engineering. The shop and products are fictional. The ideas below describe a proposed future flow; the current lab only searches products and calculates a simulated quote. It does not reserve stock, hold prices, charge money or create an order.
Where an answer comes from
A language model generates text from the context it receives. A large language model is a language model built at larger scale; the label does not mean it automatically knows current stock.
If someone asks whether a blue notebook is available, the application can let the model propose a stock-checking tool. The application calls the tool; the shop's inventory system returns the result; and the application gives that result to the model to use in its answer. MCP provides a standard way to discover and call tools, but the shop remains responsible for the underlying facts and rules.
RAG (retrieval-augmented generation) also brings information into a model's context. It is useful for searching a set of documents, such as a returns policy. A live stock check may be more appropriate for a fast-changing inventory: a retrieved index can be out of date. Either way, check the freshness and permissions of the source.
Stock is a snapshot
One notebook on a shelf can be taken while a shop employee is walking back to tell a customer it is available. A stock result is a snapshot, not a guarantee. Adding an item to a cart may indicate interest, or the shop may reserve it: those are different product rules.
Rechecking at checkout is necessary but is not enough on its own. If two customers both check the last item before either purchase is recorded, both could see one available. The shop needs a protected operation that checks and claims the stock together, so both requests cannot claim the same last item. Reservations also need rules for expiry and release.
Prepare, then confirm
A safer transaction can separate preparation from submission:
- The shop prepares a draft containing the item, quantity, delivery details and total.
- The application presents the draft and obtains the customer's confirmation.
- The shop verifies the customer's identity and authority, checks the specific confirmed draft and its validity, then attempts to claim stock and coordinate payment.
- The shop records and communicates the outcome.
An assistant's claim that a customer said “that looks good” is not, by itself, a dependable confirmation. The trusted application should capture confirmation and the shop should bind it to the specific draft. A CAPTCHA can be an anti-automation signal; by itself it does not establish the customer's identity or their agreement to a particular item and amount. The shop must enforce authorization regardless of whether the request arrives through an AI assistant or another interface.
Confirmation needs protections against expiration, changes and unintended repeat submissions. For example, a confirmation for one draft should not authorize a changed price or be reused to create duplicate purchases.
Our design decision: a five-minute price hold
For the fictional shop, a prepared quote would hold its quoted price for five minutes. If a customer approves a notebook at $20 and the listed price becomes $25 during the valid period, the shop would honor the $20 quote. If the quote expires before checkout completes, the shop would stop and show a new quote for approval.
A price hold is not automatically a stock reservation. Whether to reserve the item for those five minutes is a separate decision. Even with a valid price and confirmation, checkout must handle cases such as unavailable stock or a declined payment.
Payment and personal information
The assistant should have only the information it needs for the task. Sensitive card details should be collected and handled through an appropriate payment-provider flow, rather than sent to a language model. A provider can report a payment outcome or reference back to the shop. Valid-looking payment details do not guarantee that an attempted payment will succeed.
Questions to carry forward
- Should a five-minute price hold also reserve stock? What should happen when the hold expires?
- Which actions should the assistant be allowed to take without explicit confirmation?
- How do we test that an expired, changed or repeated confirmation cannot create the wrong purchase?
- What evidence tells us the answer came from the right source, and how fresh was that source?