Hallucination detection without source documents in NeMo Guardrails
Choose the self-check hallucination rail when your assistant answers from model knowledge alone and there are no retrieved chunks to check against. In that setup, the question is not whether an answer matches a source, but whether the model is consistent with itself. NeMo Guardrails documents a self-check hallucination rail that works this way: it samples several alternative generations for the same prompt, then checks whether the original answer agrees with them. Where the samples disagree, the answer is treated as suspicious. This is a different job from the RAG fact-checking rails covered elsewhere on this page, which compare an answer against evidence that was retrieved for the question. Without evidence, the rail can flag unstable answers, but it cannot tell you whether a consistent answer is true.
Plan the rail's behavior before you enable it. The rail is typically attached to the output flow, and the main decision is whether a flagged answer is blocked or only annotated with a warning. Blocking suits high-stakes answers where a wrong statement is worse than no statement, while warning suits assistants where a human reviews the answer or the user can see a visible caveat. Each sampled generation is an extra call to your model, so latency and cost grow with the number of samples and with the length of answers. Ask your team to measure both on representative prompts before choosing the sample count. Confirm the exact configuration keys, default sample count and output options in the current NeMo Guardrails documentation, because these details change between releases.
Treat the rail as one signal, not a verdict. Consistency checks catch confident fabrication that changes from run to run, but they miss errors the model repeats every time. Build a test set of questions with known answers, include questions the model should refuse or qualify, and record how often the rail blocks correct answers as well as wrong ones. Log the sampled generations and the verdict for each flagged response, so reviewers can see why an answer was stopped. If the assistant needs grounded accuracy, plan a retrieval step instead, because consistency checking without evidence has limits that no threshold tuning removes.
Request flow for a no-evidence hallucination check
The check starts when the application sends a user question to NeMo Guardrails, which passes it to the main LLM call. The answer from that call is not returned yet. The self-check hallucination rail then samples alternative generations for the same question, and a separate consistency judgment LLM call compares them with the original answer. Only after that judgment does the rail choose to warn or block, and the application receives the result. Check where each extra LLM call happens, since each one adds latency and token cost.
Extra LLM calls run after the main answer, before the warn or block decision.
Blocking versus warning modes and when each fits
In warning mode, the application delivers the generated answer to the user and records that the hallucination check flagged it. The user sees the same response they would have seen without the rail, so the assistant keeps its normal flow. The value of this mode is evidence: you learn how often the check fires, on which questions, and with which model, before you decide to stop answers from reaching users. The trade-off is that flagged answers can still be wrong, and a user who does not read a warning may act on them.
- User experience: The answer appears unchanged. Any indicator, such as a banner or metadata field, must be designed by the application team, and the rail itself does not decide how users see it.
- Monitoring needed: Log each flag with the question, the answer, the generating model and the check result, and review a sample regularly. Without this log, warning mode produces no benefit.
- False positive risk: Low user harm, because a wrong flag does not remove a correct answer. The cost is review workload and alert fatigue if flags are frequent.
- False negative risk: Higher than in blocking mode, because flagged content reaches users and any unflagged error is equally visible.
- Good fit: Early rollouts, internal assistants, and workloads where you are still measuring how the check behaves on your own data.
Before you rely on this mode, confirm in the NeMo Guardrails documentation for your version how flags are surfaced and logged, and which configuration keys control the behavior, since these details change between releases.
In blocking mode, the rail replaces an answer the check considers unsupported with a fallback message, so the user never sees the flagged text. This gives the strongest protection against confident errors reaching users, and it fits assistants where a wrong answer causes harm. The cost is that correct answers can be replaced too, which makes the user experience depend heavily on how accurate the check is for your questions and models.
- User experience: Users receive a fallback message in place of the answer. Wording should explain that the assistant could not verify a response and suggest the next step, such as contacting a person or rephrasing.
- Monitoring needed: Track block rates by topic and model, log the blocked text for reviewers, and watch for sudden jumps after a model or prompt change. Users who hit fallbacks repeatedly need a route to report them.
- False positive risk: High impact, because a correct answer is withheld and the user receives no information. Frequent false positives push users toward other tools.
- False negative risk: Lower than in warning mode for the flagged categories, but the check still misses some errors.
- Good fit: Customer-facing or regulated answers where an unsupported statement is costly, after warning mode has shown acceptable rates on your data.
Before you enable blocking, confirm with the NeMo Guardrails documentation for your version the fallback behavior and the configuration keys that switch modes, and test the fallback path under your real traffic patterns.
Most teams do not pick one mode for every workflow. The decision depends on what a wrong answer costs in each use case, how much your check's behavior on your own questions is known, and whether a reviewer can act on flags in time. A common sequence is to run in warning mode first, measure flag rates and review a sample of flagged and unflagged answers, then move high-risk workflows to blocking mode while leaving low-risk ones in warning mode. This split keeps the friction of false positives where the stakes justify it.
- Risk tiering: Assign each assistant or topic a consequence level, and set its mode from that level rather than from a single global default.
- Reviewer capacity: Warning mode only reduces risk if someone reviews flags. Confirm who owns the queue and how quickly they act.
- Evidence for auditors: Keep the mode decision, the test results and the review records together so the choice can be explained later.
- Change control: Treat a mode change as a configuration change with testing and approval, because it changes what users see.
- Re-evaluation trigger: Revisit the choice after model upgrades, prompt changes or a shift in user questions.
Ask your implementation partner or internal platform team to document the mode for each workflow, and confirm the configuration keys and defaults in the NeMo Guardrails documentation for the version you run.
Configuration options and when each fits
This table compares the main settings that shape a self-check hallucination rail when no retrieved evidence is available. Read each row as a decision: when to change the setting, what it costs in extra model calls or false positives, and what to confirm in the current configuration reference before you lock it in. The main takeaway is that sampling count and temperature drive most of the added cost, while the judge prompt and the block or warn choice decide how often users see the effect.
| Setting | When to change it | Trade-off |
|---|---|---|
| Output rail enabled | Answers are generated from model memory and a wrong answer would mislead users or staff | Every answer triggers extra LLM calls, so latency and token spend rise for all traffic |
| Number of sampled generations | Raise it when a single extra sample misses contradictions in confident but wrong answers | Each added sample is another model call, so cost and latency scale with the count |
| Sampling temperature | Raise it when alternative answers look too similar to show inconsistency; keep it low for stable, repeatable answers | Higher values produce more varied samples and more noise; lower values can hide real disagreement |
| Consistency threshold | Adjust it after reviewing labeled examples of correct and incorrect answers from your own domain | A stricter threshold blocks more correct answers; a looser one lets more hallucinations through |
| Block versus warn behavior | Use block where a wrong answer is costly; use warn while you collect data on false positives | Blocking protects users but frustrates them on false positives; warning keeps answers visible but relies on people to act |
| Judge prompt | Change it when your domain terms, languages or answer formats confuse the default judging wording | A custom prompt needs its own testing and can drift from the wording used in published examples |
| Judge model | Use a stronger or separate model when the application model cannot reliably judge its own consistency | A stronger judge raises per-call cost and may need separate capacity or hosting approval |
What the extra LLM calls cost in latency and tokens
Self-check hallucination detection adds model calls on top of the answer the user already waits for. The cost depends on how many alternative generations you sample, how many judge calls follow, and where those calls sit in the response path. Measure each component in a pilot before you commit to a configuration.
Additional generation calls for samples
The self-check approach samples several alternative generations for the same prompt and compares the original answer against them. Each sample is a full call to the application model, so the sample count multiplies that model's token spend. Ask your team which model serves the samples, whether they run in parallel, and how many samples the configuration requests. Record the input and output tokens per sample during the pilot, since prompts that include long context make each sample expensive.
Judge calls on the response path
After sampling, a judge step asks an LLM whether the original answer is supported by the consistent samples. This is a separate call with its own prompt, so it adds tokens and a sequential wait unless the judge runs concurrently with other rails. Confirm which model acts as the judge, whether it is a reasoning model, and how its output is parsed. A judge that returns malformed output can cause retries or unexpected blocks, so count those retries in the pilot.
Added latency on the response path
Because sampling and judging happen before the answer leaves the rail, they add time that the user feels directly, unlike logging or background checks. The added delay grows with the sample count, the model's response time under load, and any queueing on shared inference capacity. Measure end-to-end time at the 50th and 95th percentiles, with the hallucination rail on and off, using the same questions so the comparison is fair.
Token spend on the application model
Every extra sample and judge call is billed or metered against the same model capacity that serves your users. For hosted APIs, that means a direct increase in cost per answer. For self-hosted models, it reduces throughput available for other workloads. Ask for a token forecast based on expected daily questions, sample count and average prompt length, and compare it with a baseline run without the rail. Watch for prompt growth when conversation history is included.
Effect of streaming on perceived delay
Streaming sends tokens to the user as they are generated, but a hallucination check that runs on the complete answer has to finish before safe output can be released. This means streaming does not remove the check's latency, it changes when the user sees text. Test whether your deployment streams before the rail completes, and decide whether a blocked answer that was already partly shown is acceptable for your users and your compliance team.
Pilot measurements to take
Before scaling, run a fixed question set through the rail with blocking and warning modes, and log per-call latency, token counts, retries and block rates. Keep the question set representative of real traffic, including long questions and ambiguous ones. Ask your vendor or partner to show the logged counters for each component, so the quote reflects measured usage rather than assumptions. Repeat the run after any change to the model, sample count or prompt.
How to set up the hallucination rail step by step
This sequence takes a team from a clean Python environment to a self-check hallucination rail that flags ungrounded answers, first in warning mode and then in blocking mode. Each step closes with a check so you know whether to continue to the next one.
Install nemoguardrails on a supported Python version
Create a virtual environment on Python 3.11, 3.12 or 3.13, the versions that NeMo Guardrails 0.25.0 requires, then install the package from PyPI with pip. The library is Apache 2.0 licensed and developed in the NVIDIA-NeMo/Guardrails repository, so your platform team can review the source before installation. Confirm the version against your approved release list. The step is done when
pip show nemoguardrailsreports the version your team approved and the interpreter matches a supported Python version.Create the config.yml with the application model
Create a configuration folder with a
config.ymlfile that names the model your application uses to generate answers. Guardrails are configured withconfig.yml, optional Python actions and Colang files. Colang 1.0 is the default, so keep the first build on that default unless you have a specific reason to change it. Point the model entry at the same provider and model your application calls in production, because the rails send their own checks through the configured LLM. The step is done when the configuration folder loads without errors and a test message returns an answer.Enable the self-check hallucination output rail
Add the self-check hallucination rail to the output rails in
config.yml, so each generated answer is checked after the model writes it. Because no retrieved documents are supplied, the rail samples alternative generations for the same prompt and looks for statements that those samples do not consistently support. Each guarded answer adds LLM calls for the samples and the check, so record that cost in your model before you scale the test. Confirm the exact rail name and settings in the documentation for your version. The step is done when a sensible prompt passes through the rail and the logs show that the rail ran.Build a test set of prompts
Write a test set with two groups. The first group contains questions the model should answer from well-established general knowledge. The second group contains questions where a fabricated answer is likely, such as obscure entities, invented identifiers, or events after the model's training data. Label each prompt with the answer you expect, so reviewers can tell a false flag from a missed hallucination. Keep the set in version control. The step is done when reviewers have approved the labels and the set covers each use case in scope.
Run the test set in warning mode
Run the test set through the configuration with the rail set to report flags without blocking responses. Confirm in the NeMo Guardrails documentation how warning behavior is configured in the version you installed, because the setting should be verified against that version before you rely on it. For each prompt, capture the answer, the flag and the rail's log output, and store these results alongside the labels. The step is done when every prompt has a recorded answer and flag status and the run completes without errors.
Review flags against the labels
Compare each flag with its label and sort the results into four groups: correct flags, false flags on accurate answers, missed hallucinations, and correct passes. Review the false flags first, since they show where the rail would block good answers once blocking is on. Adjust prompts, the model choice or the rail settings only after you record the cause of each group. The step is done when every flagged result has a reviewer decision and the team agrees on the failure patterns to address before blocking.
Switch the rail to blocking mode
Change the rail from warning to blocking for the scope you have reviewed, and define a fallback response that tells users the answer could not be verified. Enable blocking for one application or one user group first, since blocking changes what users see. Confirm that each blocked answer is logged with enough context to investigate it later. The step is done when a rerun of the labeled test set produces the blocked responses you expect, with the fallback text and a log entry for each one.
Rerun the test set after each change
Rerun the full labeled test set after every change to the configuration, the model or the rail settings, and compare the results with the previous run. Track blocked answers and false flags in production logs on a review schedule your team sets, because a model update can change which answers the rail flags. Include the extra LLM calls in capacity and budget reviews. The step is done when the monitoring owner knows where blocked-answer counts are reviewed and each change has a recorded comparison against the test set.
Limits to confirm before relying on the check
A sampling-based hallucination check measures consistency across generations, not truth. The cards below cover the gaps that remain after the check runs, and what to confirm in your environment before a blocking or warning mode goes to users.
Consistent wrong answers pass
If the model repeats the same false statement across every sampled generation, the check sees agreement and passes the answer. Because there is no retrieved evidence to compare against, nothing outside the model confirms the claim. Test with questions where you know the correct answer and the model is likely to be confidently wrong, and record how often the check passes them.
NeMo Guardrails docsDependence on the judge model
The consistency judgment is made by an LLM, so its accuracy, language handling and bias shape every verdict. A weaker or differently tuned judge can flag correct answers or miss contradictions. Confirm which model is configured for the check, whether it differs from the answering model, and how its outputs are validated before you trust the scores.
Language and domain coverage
Consistency checks written around a general-purpose judge may perform unevenly in languages other than the one you tested, or on specialized terminology such as clinical codes, legal citations or product part numbers. Build a test set in each language and domain your users write in, and include paraphrases, abbreviations and negations.
Nondeterminism from sampling
Because the check depends on alternative generations, two runs on the same question can return different verdicts. Fix sampling parameters where your provider allows it, and repeat the same test cases several times to measure variance. A single passing run does not show the rail is reliable for that question.
Retest after model or prompt changes
Changing the answering model, the judge model, the self-check prompt, the temperature or the number of samples changes behavior even when the Colang and config files stay the same. Keep a versioned regression set and rerun it before each change reaches production. Record the NeMo Guardrails version (currently 0.25.0 on PyPI) alongside each run.
Guardrails releasesCost and latency under load
Each check adds extra LLM calls that recur on every answer, so the bill and response time grow with traffic and sample count. Ask your provider for per-call pricing, confirm rate limits for the judge endpoint, and load test the full pipeline before deciding which answers the check should cover.
Questions teams ask before adding hallucination detection
How much does it cost to add hallucination detection with NeMo Guardrails?
The NeMo Guardrails library is free to use under the Apache 2.0 license, so the spending goes to work and model calls. Engineering time covers writing the config.yml and Colang files, any custom action, test cases and the review of blocked answers. Model usage is the recurring part: a self-check hallucination rail sends additional LLM requests for every checked response, either to a hosted API billed per token or to models you run on your own GPUs. The main cost drivers are how many alternative generations the rail samples, how many user requests are checked, how long each response is, and whether the checking model is a reasoning model. Ask any quote to separate one-time build effort from monthly model and hosting costs, and to show the number of model calls per answer.
How long does a pilot of this rail take?
The duration depends mostly on what exists before the rail is switched on. A team with an application that already calls a model, a set of representative questions and a named reviewer can move faster than one that must build those pieces first. Drivers include the Python version in use (NeMo Guardrails 0.25.0 requires Python 3.11, 3.12 or 3.13), whether the application uses Colang 1.0, the default, or Colang 2.x, how many user intents the rules must cover, and how quickly reviewers can label sample answers as grounded or unsupported. Access approvals for model endpoints and quota increases often take longer than the configuration work itself. Confirm durations with any internal lead or partner by asking for a milestone plan that lists each dependency and the person who owns it.
What must our team provide before a pilot starts?
Three inputs decide whether a pilot produces useful results:
- Test prompts covering normal questions, edge cases and questions the assistant should not answer without evidence, with the expected behavior written beside each one.
- Model access: API keys or endpoints for the application model and the checking model, with rate limits and budget approved by the owner of each account.
- Reviewers who know the subject matter and can label sampled answers as supported or unsupported, so thresholds and rail outcomes can be checked.
Also provide the code path where answers are generated and a staging environment with logging turned on. Without a reviewer, the team can only observe that the rail blocks answers, not whether it blocks the right ones.
Can our own engineers add hallucination detection without a partner?
Yes, if the team has Python and LLM application experience and time to test. The library is open source and documented, and the rail is configured through config.yml and Colang files, with optional Python actions. The skills that matter most are prompt design, writing test cases for unsupported answers and operating the model calls in production. Teams that run the guardrails server instead of the Python API also need container and HTTP operations skills. NVIDIA has retired the NeMo Guardrails microservice, so plan around the open-source library or server that you host yourself. A partner is useful when the team lacks reviewers, when evidence must be produced for a compliance review, or when the work must follow a fixed scope agreed in writing. DeployOpen plans, implements, tests and documents self-hosted platforms in your own infrastructure, and most engagements are fixed-scope.
How does this rail differ from checking answers against source documents?
Without retrieved evidence, the rail cannot confirm an answer against a source. It works on consistency instead: the application generates several alternative answers to the same question, and a checking model judges whether the original answer agrees with them. An answer the model states differently each time is likely to be unsupported, but agreement does not prove the answer is true, because a model can be consistently wrong. When you have retrieved chunks, grounded checks against that evidence are the stronger option, and the RAG fact-checking pages compare self-check, AlignScore, Patronus Lynx and Cleanlab for that case. Use this rail for open-ended assistants where no document set exists, and treat its output as a signal for human review. The NeMo Guardrails documentation describes the available rails.
What is the difference between blocking and warning modes?
In blocking mode, a response that fails the check is replaced before the user sees it, so the rail controls what is delivered. In warning mode, the response is delivered and the failed check is recorded, which gives visibility without changing the user experience. A common approach is to start in warning mode during a pilot, measure how often the check fires and on which kinds of questions, then move to blocking for the categories where a wrong answer is costly. The replacement message for blocked answers needs an owner, because a generic refusal can frustrate users and hide a gap in the product. Logs for both modes should record the question, the answer, the checking outcome and the configuration version so reviewers can audit each decision. Confirm in the documentation for your installed version how each mode is set.
What extra latency and model spend should we expect from the extra calls?
Each checked response adds model calls, so latency and spend rise with traffic. The added time covers the alternative generations and the checking call, and it depends on model speed, whether the calls run in parallel and where each model is hosted. Measure this in your own environment before go-live, using traffic shapes that match peak use. Hosted APIs add rate limits, which can cause failed checks during bursts, so decide in advance whether a timed-out check blocks the answer, passes it with a warning or falls back to another check. Logging volume also grows with every additional call. Ask any partner or internal team for the expected number of model calls per answer, the latency at peak load and the fallback behavior when the checking model is unavailable.
Which NeMo Guardrails version should we confirm before testing?
Confirm the version you will install and read its release notes before writing configuration. The current release, 0.25.0, was published on 19 November 2026, and the previous release, 0.24.1, on 16 September 2026. Version 0.25.0 deprecates the LLMRails class in favor of Guardrails, with removal planned no earlier than 0.27.0, and NVIDIA publishes a 0.25 migration guide. Colang 1.0 is the default, and the nemoguardrails convert tool can help move configurations to Colang 2.x, although converted files still need manual review. Pin the version in your environment so test results stay repeatable, and rerun the hallucination tests after every upgrade.
How DeployOpen scopes and delivers grounding checks
DeployOpen plans, builds and hands over NeMo Guardrails configurations that run self-check hallucination detection for assistants without retrieved evidence, inside infrastructure you control. The work starts with a written scope that sets which answers are checked, which mode blocks or warns, and what the extra model calls cost in your environment.
How we scope
- Written scope listing which assistant flows run hallucination detection and which ones are excluded
- Agreed decision on blocking or warning mode for each flow, with the fallback response wording
- Inventory of the LLM endpoints that will serve the sampled and checking calls, with capacity and rate limits
- Confirmation of the self-check prompt, sample count and threshold, documented before build starts
How we build
- Configuration of config.yml and Colang files with the self-check hallucination rail enabled for in-scope flows
- Deployment of the guardrails server or Python integration in your cluster, cloud account or data center
- Latency and cost measurement of the extra LLM calls under expected traffic, reported before go-live
- Review of Python version support (3.11, 3.12 or 3.13) and dependency pinning in your build pipeline
How we hand over
- Test suite with sample prompts that should pass, should warn and should block, run against your model endpoints
- Runbook covering mode switches, threshold changes, logging of flagged answers and rollback steps
- Architecture notes on where generations, samples and checks travel, so your security team can review data flows
- Knowledge transfer sessions with the engineers who will operate the rail after handover
How we support
- Fixed-scope engagements with deliverables and timelines agreed in writing before work begins
- Ongoing support, version upgrades and continuous testing available as a retainer
- Retest of the hallucination rail after NeMo Guardrails version changes or model endpoint changes
- Quote built from the written scope, so you can compare effort against running the checks with your own team

