What the LLM Guard Factual Consistency scanner does
The LLM Guard Factual Consistency scanner is an output scanner that uses natural language inference to score whether a model's response contradicts the prompt it was given. It does not check the response against an external knowledge base, so it answers a narrower question than most teams assume. The project was archived by its owner on 9 July 2026, and the README states that it and its Hugging Face models are no longer maintained, so DeployOpen does not recommend new rollouts of this scanner. If your organization is considering it for a new system, start with a maintained guardrail instead.
Existing teams still rely on the scanner when it is already wired into an output pipeline and replacing it has not been scheduled. In that situation, the practical job is to confirm what it flags in your own traffic: pull a sample of recent flagged and unflagged outputs, check how the scanner behaves on the prompt types your users send, and record which decisions the business relies on it for. Confirm the exact model and threshold settings in your deployment configuration, since those determine the results. Keep the Python version and model artifacts pinned so the behavior does not drift while the scanner stays in service.
What the scanner does not cover matters as much as what it does. It does not establish that a claim is true in the world, so a fluent, confident, wrong answer that is consistent with the prompt will pass. It also depends on the prompt containing the information the answer should be consistent with. Treat it as one contradiction signal among others, and document that limit in the risk register so reviewers do not read a pass as verified accuracy.
Configuration options and when each fits
This table lists the settings the Factual Consistency scanner exposes and when a stricter or looser choice fits. Confirm every option name, default and model identifier against the LLM Guard documentation for your installed version, since this page does not state those values from memory. Treat the threshold as the main tuning lever and re-test any change against your own sample outputs.
| Setting | What it controls | When a stricter or looser setting fits |
|---|---|---|
| Threshold | Score above which output is flagged as contradicting the prompt. Confirm the default value in the documentation. | Stricter suits outputs where any contradiction matters, such as policy or medical summaries. Looser suits creative or conversational output where false alarms cost more than misses. |
| Natural language inference model | The NLI model that scores each prompt and output pair. Confirm the model name and whether it can be swapped. | Keep the default for a documented baseline. Change it only after testing on your own outputs, and record the change for your assessor. |
| Model loading and cache location | Where the model weights are downloaded and stored, and whether they load at startup or on first use. | Preload in air-gapped or locked-down environments so no outbound download happens at runtime. Confirm the cache setting for your version. |
| Device selection (CPU or GPU) | Whether inference runs on CPU or an accelerator. Confirm the supported options. | CPU fits low-volume or batch checks. A GPU fits high-volume API traffic where latency per response matters. |
| Input length handling | How long prompts and outputs are truncated or split before scoring. Confirm the limit and behavior. | Review this for long documents, since truncation can hide a contradiction that appears late in the text. |
| Scanner in the output pipeline | Whether the scanner runs alone or alongside other output scanners, and its position in the chain. | Place it after output sanitization steps when you want the scanned text to match what users see. |
Why it is not a full hallucination check
The Factual Consistency scanner answers one question: does the output conflict with the prompt it received? The limits below mark where that answer stops being useful. Each one names a control that has to sit alongside the scanner in production.
Compares output to the prompt only
The scanner checks the model's answer against the text it was given and nothing else. A response can agree with the prompt and still be wrong, because the prompt itself may be incomplete or outdated. If a support assistant repeats an outdated policy line from its context, the answer passes cleanly. Treat a pass as evidence of agreement with the input only, not as proof that the answer is true.
Misses unsupported additions
A model can add a date, a figure, a product feature or a citation that the prompt never mentions. Because nothing in the prompt is contradicted, the scanner has no basis to flag the addition. Illustrative example: a summary that states a refund window the policy never mentions can pass. Build a test set with invented-looking details, and check whether each added claim appears in the source before you rely on the scanner for that category.
Depends on prompt context quality
The scanner's judgment is only as good as the context you send with each request. If retrieval returns a stale article, a partial chunk or the wrong document, the output can match that context and still mislead users. Log the exact context sent with every request, so reviewers can trace a flagged or missed answer back to the source passage that shaped it.
Cannot verify external facts
The scanner does not check current prices, legal text, drug interactions or records in your systems. It only sees what you pass in as prompt context. Any claim that depends on information outside the prompt needs a separate check, such as a retrieval step against a governed source or a reviewer with access to that source. Confirm the scanner's documented behavior in the LLM Guard documentation before you describe it to auditors.
LLM Guard docsThreshold sets the trade-off
The score cutoff decides how many outputs are flagged. A low cutoff sends more answers to review and slows users down, while a high cutoff lets borderline contradictions through. Set the value from labeled examples taken from your own traffic, not from generic samples. Record who approved the threshold, the date it was set, and every later change, so the setting can be defended during a review.
Complementary checks and human review
Pair the scanner with a check for unsupported claims, a verification step that matches citations to retrieved sources, and a human review queue for high-impact answers such as financial, medical or legal guidance. Sample outputs the scanner passed, at a fixed rate that your risk owner signs off, because a scanner that rarely flags anything still needs evidence that it works.
How to set up and verify the scanner
This sequence confirms that an existing LLM Guard deployment runs a supported Python version and a pinned scanner release, then measures the Factual Consistency scanner against a labeled set of contradictory and consistent pairs. The result is a threshold you can defend and a test record your team can repeat after any change.
Confirm the Python runtime version
The platform or ML engineer who owns the deployment checks the interpreter in the environment that runs the scanner. LLM Guard's last PyPI release, 0.3.16, requires Python 3.10 or newer but below 3.13, so run python --version and confirm the result is 3.10, 3.11 or 3.12. If the runtime is outside that range, stop and plan a runtime change before continuing. Done when the version output is inside the supported range and is recorded in the deployment notes.
Pin the installed LLM Guard release
The same engineer confirms the installed package version with pip show llm-guard and pins it in the lockfile or requirements file. The expected value is 0.3.16, the last release on PyPI. Because the project is archived, no later fixes will arrive, so the pin also documents exactly what your tests cover. Done when pip freeze lists llm-guard at the pinned version and the file is committed to version control.
Load the scanner through the documented API
Next, the engineer imports the Factual Consistency scanner from the output scanners module in the LLM Guard documentation and creates an instance with an explicit threshold argument. Check the exact class name and parameters against the documentation for your pinned version. The first load may download the natural language inference model from Hugging Face, so on restricted networks, stage the model in advance. Done when the scanner instance builds without errors in a clean environment.
Set and record the threshold
The team confirms the default threshold in the documentation for the pinned version, then sets an explicit value in configuration rather than relying on the default. Record the value, the reason for it and the owner who approved it. Treat the threshold as a risk decision: a lower setting flags fewer pairs, and a higher setting flags more. Done when the configuration file holds the explicit value and a test confirms the same number reaches the scanner instance.
Build a labeled test set
The application owner and a second reviewer assemble pairs of prompts and model outputs, labeled as contradictory or consistent. Draw them from representative traffic where possible, and include paraphrases, negations, numbers and dates, and short answers that are correct but unusual. Two reviewers should agree on each label, with disagreements resolved and recorded. Done when the set contains both classes, every label has a reviewer sign-off, and the file is stored with a version identifier.
Run the test set and record results
The engineer runs every pair through the scanner at the configured threshold and compares each result with its expected label. Count misses (contradictions the scanner passed) and false positives (consistent pairs it flagged) separately for each class. Review every miss by hand to see whether the cause is the threshold, the wording or the model. Done when a report shows counts per class, the individual misses are documented, and the run can be repeated with the same inputs.
Adjust the threshold and rerun
If misses or false positives exceed the acceptance criteria your team set in advance, the engineer changes the threshold in one controlled step and reruns the complete test set, not only the failed pairs. Acceptance criteria belong to your risk owner and should be written down before testing starts. Repeat until results meet the criteria or the team decides the scanner cannot meet them. Done when the before and after reports, both run on the same pairs, are saved with the configuration change.
Confirm the flag reaches the application
Last, the engineer checks that the scanner result drives the application's behavior in a staging environment. Send one known contradictory pair through the full path and confirm that the flag is logged, the response is withheld or marked as your policy requires, and the event appears in your monitoring. Done when the staging log shows the flag for the contradictory pair and a consistent pair passes through unchanged.
Security and operational considerations
LLM Guard is archived, so the scanner runs as frozen code and frozen weights that no one is fixing. The cards below cover the operational points that follow from the archive notice: where model weights come from, what text gets logged, what the host has to absorb, and how far the scanner should be trusted to reach.
Model loading from the archive
The Factual Consistency scanner downloads its natural language inference model from Hugging Face when it first loads. The LLM Guard README states that the project and its associated Hugging Face models are no longer under active development or maintained. Pin the model revision you tested, load it from an internal mirror or a vetted local copy, and disable outbound downloads at runtime so a pull cannot change what the scanner runs.
- Repository archived
- 9 July 2026
Risk of unmaintained weights
No one will retrain the model, patch a loading bug or publish a fix for a new failure pattern. Factual consistency judgments will drift from the language your users write in over time, and nothing in the project will flag that. Record the model hash, the Python and library versions, and the threshold you accepted, then re-run your own test set after any change to the host or dependencies.
Logging prompt and output text
Factual consistency checks compare the prompt with the model output, so the scanner sees both texts in full. Any log line that records scanner inputs, scores or exceptions can therefore hold personal data, business content or sensitive answers. Decide what your logging layer captures, mask or hash the text fields, set a retention period, and confirm who can read the scanner logs before the service goes live.
Resource use on the host
The scanner runs a transformer model on each call, so CPU or GPU memory, latency and concurrency depend on the model size and request volume. Size the host for the model plus headroom for peak traffic, and set limits on worker processes so one scanner cannot starve the application beside it. Load the model once per worker rather than per request, and measure p95 latency under realistic prompt lengths before you rely on the scanner in a request path.
Containing the scanner process
The scanner receives untrusted model output and runs inference on it, so treat it as an exposed component. Run it under a dedicated service account with no write access to application data, restrict its network egress to what the model download needs, and keep it out of the same container as credentials. Review these controls with your security team, since the scanner itself will not be patched if a parsing issue appears.
Confirming the Python ceiling
The last PyPI release requires Python 3.10 or newer but below 3.13. Your operating system or base image may move to a newer interpreter during routine patching, which breaks installation or runtime behavior. Pin the Python version in your image, keep the dependency lockfile under source control, and test any base image update in staging before it reaches the scanner host.
- Supported Python range
- 3.10 to 3.13
Factual Consistency sits between the model and the user, and only the threshold decides what gets flagged
The diagram starts where the application holds a user prompt and a model response, before the response reaches the user. Both texts go to the Factual Consistency scanner, which runs inside the LLM Guard API server or Python process. The scanner pairs them and passes the pair to a natural language inference model whose files were downloaded from Hugging Face and sit inside the trust boundary. The model returns a score, and the threshold decides whether the output passes or is flagged. Flagged output is blocked or logged according to your policy. Check that the model files are pinned and that the log records the prompt, the output and the score.
Output path showing where the NLI model scores a prompt and output pair before release.
Limits to confirm in your environment
The Factual Consistency scanner's behavior depends on your languages, your content, your hardware and your Python environment, not only on the code in the repository. Each card names one limit to test with your own data, and the results should go into the same evidence record you keep for your security review.
Language and domain coverage
The scanner compares an output against its prompt using a natural language inference model, so its accuracy depends on how well that model handles your languages, terminology and document types. Build a labeled set from prompts your users actually send, including abbreviations, regulated terms, tables and code-heavy answers. Confirm accuracy for each language and domain before you rely on it, and record which combinations fail. Check the model's published documentation for the languages it was evaluated on, and treat anything not listed as untested.
Latency under your load
Every output passes through the scanner, so its inference time adds to each response your application returns. Measure p95 latency at peak concurrency using your expected output lengths, request volume and hardware, on CPU and on GPU if you plan to use one. Confirm whether the scanner runs inside the API server or inside your application process, because that changes how concurrency and memory behave under peak traffic. Don't extrapolate from a single developer machine, since results from one test host rarely carry over to production nodes.
Threshold behavior on your data
The scanner flags an output when its score crosses a threshold you set, so that value decides how many good answers are blocked and how many contradictions get through. Run a labeled set of consistent and contradictory answers, plot the score distribution, and choose the threshold from that data. Record the chosen value along with the false positives and misses it produced. Don't adopt a default because it appeared in a tutorial, and re-test whenever the model, prompt templates or content mix changes.
LLM Guard docsModel artifacts and Python versions
The last LLM Guard release on PyPI is 0.3.16, uploaded on 19 May 2025, and it requires Python 3.10 or newer but below 3.13. Test a clean install on the exact interpreter your servers run, and confirm that the model files download or mirror correctly for offline hosts. Pin the package and its dependencies, then verify that the model still loads after OS patches, container base image updates or changes to the Hugging Face cache path. The model files are maintained separately from the code, so check them as their own dependency.
PyPI packageWhat the scanner does not catch
The Factual Consistency scanner checks whether an output contradicts its prompt. It does not verify claims against your knowledge base, the public web or your source documents, so an invented fact that the prompt never mentioned can pass. Test this gap with fluent, plausible answers that are wrong on outside facts, and record how many get through. Decide what covers that gap, such as retrieval grounding checks or human review for high-impact answers, and document the boundary so reviewers know what the control claims.
Evidence for security review
Security reviewers will ask how you know the scanner works on your system, so keep the test corpus, labeled results, latency measurements, threshold decisions and version pins in one dated record. Store the corpus in version control, rerun it after each dependency or model change, and keep the outputs with your release notes. Because the project was archived on 9 July 2026, the same record also shows how long the current setup has been stable and when replacement planning should begin.
Questions teams ask before replacing or keeping this scanner
Can we keep running LLM Guard ourselves after the archive?
Yes, the MIT license allows your team to keep running the code in your own infrastructure, but nobody maintains it anymore. The archived repository was archived on 9 July 2026, and its README states that the project and its Hugging Face models are no longer under active development or maintained. The last PyPI release, 0.3.16, was uploaded on 19 May 2025 and requires Python 3.10 or newer but below 3.13, so that release runs on Python 3.10 to 3.12. Security fixes for dependencies, model issues and compatibility with future Python versions will fall to your team. Confirm the license terms of any model files you download with your legal team before you rely on them.
What drives the effort of replacing the Factual Consistency scanner?
The biggest driver is how far the scanner reaches into your systems. A single output check in one service is a small change. Effort grows when the scanner runs in several applications, when its threshold reflects business rules that someone must restate, or when flagged outputs are logged and reviewed as evidence. Other drivers include whether the scanner runs as a Python library or as an API server, the model dependencies of the replacement, and how much representative test data you already hold. Ask any partner to split the work into an inventory of call sites, threshold decisions, replacement design, comparison testing and staged rollout, so you can see where the effort sits.
What does a replacement need from our team?
A replacement needs five things from your side:
- A named owner for the LLM application and its output path
- Access to a representative set of prompts, model outputs and known contradictions, handled under your data rules
- Engineers who can run the service in your environment and change its configuration
- A decision-maker who signs off on the accepted threshold and on what counts as a failure
- Reviewers who can judge whether a flagged answer is actually wrong
The reviewer time is often the least visible cost. Agree these roles before work starts so that testing does not stall while people are found.
How long does a test cycle take for our data volume?
Duration depends on the size of your sample, the compute available to run the natural language inference model, and how many results need a person to label. Each test cycle replays prompt and output pairs through the scanner and the replacement, then compares the results against labeled cases. Labeling is often the longest step, and it grows with sample size. Ask for the test plan to state the sample size, the labeling method, the compute assumed, and the number of review rounds. Agree the timeline in writing before work starts, and check it again if your data volume changes during the project.
When is outside help worth scoping for this scanner?
Outside help is worth scoping when the scanner guards customer-facing output, when it sits in a regulated workflow that needs evidence of testing, when several applications depend on it, or when your internal staff do not have the time to run a migration alongside daily work. DeployOpen plans and implements replacements of self-hosted platforms in your infrastructure, runs security testing of AI systems, and prepares evidence for compliance assessments. It does not issue audit reports or certifications, which independent auditors and certification bodies provide. Most engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
Does the Factual Consistency scanner catch every hallucination?
No. The scanner uses natural language inference to flag output that contradicts the prompt, which covers only one part of hallucination. It can miss fabricated details that do not conflict with the prompt, errors about facts outside the prompt, and plausible statements that a reader would still accept as true. Treat it as one signal in a wider evaluation. Include these missed categories in your replacement test set, and decide with your risk owner which failures must be blocked, which must be logged and which can be accepted.
Which Python version should we use for the last LLM Guard release?
Use Python 3.10, 3.11 or 3.12. The last PyPI release, 0.3.16, requires Python 3.10 or newer but below 3.13, so Python 3.13 is outside its supported range. Pin the interpreter version in your container image, pin the package versions in a lock file, and rebuild the image on a schedule so that base image patches reach you. Scan the image for known vulnerabilities before each deployment, because the upstream project will not publish fixes. Keep the pinned environment documented so that the decommission plan can reproduce it while you test the replacement.
What does replacing the scanner cost, and what recurs afterward?
The cost has two parts. One-time work covers the inventory of call sites, threshold decisions, replacement design, comparison testing and rollout. Recurring costs cover the compute that runs the replacement's models, staff time for reviewing flagged outputs, maintenance of the replacement, and any ongoing support retainer you choose. DeployOpen does not publish a price list. A quote follows from the written scope, so ask for it to show the one-time work, the recurring running costs, the assumptions behind the test effort, and which items you can take over in-house.
Replacing Factual Consistency with a maintained guardrail
Replacing the Factual Consistency scanner means proving that the new control blocks at least the contradictions the old scanner caught. Start by building a representative test set from production logs. Pull prompt and output pairs where the scanner flagged a response, along with a sample it passed, and have reviewers who know the application label each pair as contradicting the prompt or not. Record the threshold and the input and output scanner settings in use at the time, because a flag is only meaningful against the configuration that produced it. Include the awkward cases too, such as short answers, answers that restate the prompt, and answers in languages your users write in. Without this baseline, you cannot say whether the replacement is better, worse or simply different.
NeMo Guardrails is a maintained open-source toolkit for adding programmable guardrails to LLM applications, and it is the option to evaluate first. Its rails are defined in configuration and code, so the evaluation question is whether your contradiction rules can be expressed in it and whether they run at acceptable latency in your environment. Confirm the exact capabilities, supported models and any model dependencies with the project's own documentation before you commit. Then replay the full test set against the candidate. Measure misses as closely as catches: every contradiction the Factual Consistency scanner blocked and the candidate lets through is a regression, and each one needs a documented decision before cutover.
The replacement scope must be confirmed in a written plan before any change reaches production. The plan should name the output scanners being replaced, the contradiction categories the replacement must cover, the test set and its labeling rules, the pass criteria, who signs off, and the rollback path. It should also state how long LLM Guard stays in place alongside the new control. LLM Guard is archived; the protectai/llm-guard repository states that the project and its Hugging Face models are no longer maintained, so any fix you depend on will be your own. Treat the plan as the document that decides when the LLM Guard component can be removed, not as a formality.
How DeployOpen scopes and supports LLM Guard replacements
DeployOpen treats the Factual Consistency scanner as one part of an existing LLM Guard deployment that needs a maintained replacement. We start from the scanner's current settings and the output paths it covers, then agree in writing what gets replaced, tested and handed over.
How we scope
- Inventory where the Factual Consistency scanner runs, which applications call it and which output paths it covers today.
- Record the threshold, model version and failure behavior in use, so the replacement can be compared against the current setup.
- Agree a fixed scope in writing that names the scanner, the replacement guardrail and the test cases that define success.
How we build
- Build the replacement guardrail in your infrastructure, with the output checks wired into the same response path as today.
- Run a side-by-side test of contradicting and consistent answers, comparing what the old scanner flagged with what the new control flags.
- Document where the replacement is weaker, such as checks that compare output with the prompt but do not verify facts against outside sources.
How we hand over
- Deliver configuration, test cases, results and a runbook that your platform and security teams can review and operate.
- Provide a decommission plan for the LLM Guard scanner and any model it still loads in your environment.
- Confirm with your security and compliance teams which evidence they need, since DeployOpen prepares evidence but does not issue audit reports.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers, scoped separately from the initial engagement.
- Retest the guardrail after changes to the model, the threshold or the applications that call it.
- Ask us to confirm support terms, response expectations and retainer scope in the written quote before work begins.

