You manage LLM hallucinations in production with controls around each release, because no test set catches every wrong answer. Four controls do most of the work: a release gate agreed before the results arrive, a staged rollout that starts in shadow mode, monitoring of the answers users actually receive, and an incident and rollback routine your team has rehearsed.
The controls below assume you already have an evaluation set. Our companion guide explains how to build one and how to choose the hallucination metrics and slices a gate reads.
Any change that can alter an answer is a release and goes through the same gate as a new feature. Teams tend to gate features and wave the quieter changes through, although these move answers just as much:
- a new model version, or a provider's update to the model you already call
- an edited system prompt or answer template
- a new chunking rule, embedding model or retrieval setting
- a new tool, or a changed tool definition
- a large batch of documents added to the index
- a change to how permissions sync from the source systems
Give each one a version identifier and a short change note. Pin model versions where your provider allows it, and log which model, prompt, retrieval configuration and index version produced every answer. When someone investigates a bad answer three weeks later, they can rebuild the exact conditions.
If your model calls run through the adapter-service architecture, one service sits between your application and the model. That service is the natural place to stamp versions on each request and to switch configurations without redeploying the main application.
Keep the release record short: what changed, which evaluation-set version you ran, the results per slice, and who approved the release and why. A governance reviewer will ask for exactly this record.
A release gate is a written list of conditions that a change must meet before more users see it, agreed and signed by a named owner before the evaluation runs. Write it first. Criteria written after the scores arrive tend to bend toward whatever the new version happened to achieve.
Separate blocking conditions from advisory ones. An illustrative gate for an HR policy assistant that answers in Arabic and English might read:
| Condition | Type | Why |
|---|---|---|
| Every permission test passes | Blocking | Better answers elsewhere cannot offset restricted content shown to the wrong employee. |
| No new unsupported claims in the pay and leave slice | Blocking | An error there costs the most, in money and in trust. |
| The assistant still declines questions no accessible document covers | Blocking | Fewer declines usually means the assistant is answering without a source. |
| A person has reviewed both the Arabic and English slices | Blocking | One language can regress while the other improves. |
| Answer length, latency and cost per answer | Advisory | The owner may accept a time-limited exception. |
The thresholds depend on what an error costs in each slice. That is a business decision, so a named business owner approves them; the engineering team should not sign its own gate.
When a blocking condition fails, fix the cause and run the gate again, or narrow the release if you can isolate the failing capability and ship the rest safely. A permission failure always blocks. For an advisory condition, the owner may record an exception with the remaining risk and a review date. No exception waives a security or legal requirement, and nobody can override the gate without leaving a record.
Roll it out in stages, because passing the offline gate says little about live traffic: real questions drift away from any test set. Each stage widens exposure only after the previous one shows no new failure pattern.
- Shadow run. The new version answers real questions in parallel while users still see the current one. Reviewers compare the two on a sample. Our staged rollout guide explains running the model in shadow mode first inside an existing system.
- Internal users. Staff who know the domain use the new version and report problems through a visible channel.
- Small group. A limited set of real users, behind a feature flag you can switch off at once.
- Wider release. Only after the earlier stages show nothing new.
At every stage, keep the previous model setting, prompts, retrieval configuration and index snapshot ready to restore. Before you restore them, apply current permissions, required deletions and security fixes. An old index must not bring back access that someone has since revoked.
In a shadow run, the new version answers the same real questions in parallel while users still see the current version. Reviewers compare a sample before any wider stage; no comparison result is shown.
You monitor them by combining a sampled human review with automatic checks and user reports, because no single automatic metric can confirm that every live answer is correct. Each signal catches something different and misses something different:
| Signal | What it catches | What it cannot tell you |
|---|---|---|
| Sampled human review, by slice and language | Unsupported claims, wrong policy, awkward Arabic | Anything outside the sample |
| Automatic checks: cited passage exists, the user may see it, numbers and units match the source | Invented citations, permission leaks, mangled figures | Whether a correctly cited answer is the right answer |
| User reports routed to the document owner | Outdated sources and errors reviewers missed | Silence does not mean the answers are right |
| Rate shifts: declines, empty retrievals, tool errors, latency, cost | Drift after an upstream change | Whether quality went up or down |
Reviewers should label the live sample with the same guide you used for the evaluation set, so the numbers stay comparable. A changed rate tells you where to look; it does not prove that quality rose or fell.
Watch upstream changes too. Edited documents, reorganised permissions and provider model updates can change answers without any release on your side. Monitoring logs hold real questions, so restrict who can read them, keep only what you need and set a retention limit.
Treat it as a production incident: contain the harm first, then investigate. Harm here means a wrong policy sent to many employees, restricted content shown to the wrong person, or a tool action taken on bad information.
Contain. Prepare the options before launch, so nobody improvises at midnight:
- switch the feature off behind its flag
- fall back to a safer mode, such as search results with links and no generated answer
- remove or restrict the document involved
- disable one specific tool
- roll back to the previous release
Investigate. Preserve the evidence under access control: the question, the retrieved and permitted passage IDs, the answer and the versions involved. Find which stage failed: the document, retrieval, permissions, the prompt or the model. Add the case to the evaluation set so the gate catches it next time, and decide with the owner whether to tell the affected users.
Actions raise the stakes. If the system can send messages or change records, go back to deciding whether you need an AI agent at all, and put human approval in front of any action with external effects.
Rollback can restore settings that carry versions, such as the model setting, prompts and index. It cannot recall a message a tool already sent, so the approval belongs before the send. The gate is shown closed; no message has been approved.
Rollback restores the previous behaviour only if you version every answer-changing component together: model setting, prompts, retrieval configuration, tool definitions and the index. Write a one-page runbook that names who may trigger a rollback and how, then rehearse it in a non-production environment before launch.
Rollback cannot undo what the system already did. Restoring the old code does not unsend an email, reopen a ticket or restore a record a tool changed. You can repair some changes with a compensating action that you validate separately. Sent messages and their consequences may be beyond repair, which is the strongest argument for human approval before external actions. We write down which actions wait for a person's approval before we connect agents that send messages or change records.
Both describe the same controls in their own vocabulary, and neither is a law or a certification. NIST says its AI Risk Management Framework (AI RMF 1.0, released 26 January 2023) is intended for voluntary use. It is organised into four functions: Govern, Map, Measure and Manage. Several subcategories match the controls in this guide:
- MEASURE 2.4: the system's functionality and behaviour are monitored in production.
- MANAGE 2.4: mechanisms and assigned responsibilities exist to supersede, disengage or deactivate a system whose performance or outcomes are inconsistent with intended use. That is your feature flag, fallback mode and rollback.
- MANAGE 4.1: post-deployment monitoring plans cover user input, appeal and override, incident response, recovery and change management.
- MANAGE 4.3: incidents and errors are communicated to the relevant people, and the response is followed and documented.
NIST's Generative AI Profile (NIST AI 600-1, published 26 July 2024) extends the framework to generative AI. As of October 2026, NIST states that AI RMF 1.0 is being revised under the White House AI Action Plan, so check the current version before you quote a subcategory number in a policy.
The OWASP Top 10 for LLM Applications 2025 lists misinformation, including hallucination, as LLM09. Its suggested mitigations include human review of sensitive content, automatic validation of key outputs and telling users about the system's limits.
These frameworks help you organise controls and evidence; they do not guarantee safe behaviour. The practices in this guide are TecnoStack's recommendations, not NIST or OWASP requirements. For ownership, inventories and legal scope, read our guide to AI governance for boards.
Before an LLM feature reaches its first real users, you should be able to say yes to each line:
- Every answer-changing component has a version, and each answer is logged with those versions.
- The release gate is written, its blocking conditions are named, and a business owner has signed it.
- The shadow run and internal stage have an owner and a review sample.
- The feature flag, safer fallback mode and rollback have been tested outside production.
- Restoring an old index reapplies current permissions and deletions.
- Monitoring combines human review, automatic checks and user reports, with access limits and a retention period on the logs.
- Tools with external effects need human approval.
- The incident runbook names who contains, who investigates and who decides on telling users.
If you are taking an AI feature from pilot to live users, our custom AI systems service includes an evaluation set and a version review, and we can set up the gate, monitoring and rollback with your team.
- National Institute of Standards and Technology. AI Risk Management Framework: intended for voluntary use; AI RMF 1.0 released 26 January 2023 and, as of October 2026, under revision.
- National Institute of Standards and Technology. Artificial Intelligence Risk Management Framework (AI RMF 1.0), NIST AI 100-1: the MEASURE 2.4 and MANAGE 2.4, 4.1 and 4.3 subcategories.
- National Institute of Standards and Technology. Generative Artificial Intelligence Profile (NIST AI 600-1), published 26 July 2024.
- OWASP GenAI Security Project. LLM09:2025 Misinformation, part of the OWASP Top 10 for LLM Applications 2025.






