What the LLM Guard Toxicity scanner does and when teams still meet it
If your team inherited an LLM Guard deployment, the first decision about the Toxicity scanner is whether it still belongs in the pipeline at all. The scanner is one of the 15 input scanners and one of the 20 output scanners the project documents, so it is one of many checks you will meet, but it is the one that decides whether abusive or hateful text is passed on to a user or a model. It applies to both directions: prompts sent in and completions returned. Its job is to score text for toxic content using a RoBERTa classifier, then block or allow it against a threshold you configure. Before you keep it, confirm which direction and which scanner instance your application actually calls, because a scanner that is configured but never invoked protects nothing.
Treat the scanner as a legacy control. The LLM Guard repository was archived by its owner on 9 July 2026, and the README states that the project and its Hugging Face models are no longer under active development or maintained. That means the RoBERTa model will not receive fixes, and the last PyPI release, 0.3.16, dates from 19 May 2025. DeployOpen does not recommend new LLM Guard rollouts. For an existing deployment, the practical question is how long you can run it safely and what would replace it. Ask your security team to record the current version, the Python runtime and the model files in your environment, so the replacement scope is known before you start the migration.
Teams still meet this scanner in three situations: a compliance reviewer asks how user-facing toxicity is controlled, an incident involves harmful output that the scanner did or did not catch, or a migration needs an inventory of every guardrail the application relies on. In each case, document the threshold, the match type and the direction the scanner covers, then compare those settings with the maintained guardrail you select. Confirm the behavior against your own test set rather than relying on the published documentation alone, and keep the evidence for the migration decision.
Toxicity scanner options and when each fits
This table compares the two match types, the threshold setting and input versus output placement for the Toxicity scanner. Read each row as a choice you make for a specific user population, then check what that choice misses before you rely on it.
| Option | What it does | When it fits | What it misses |
|---|---|---|---|
| MatchType.SENTENCE | Checks each sentence separately and flags the text if any sentence scores above the threshold | Chat prompts and replies where toxic content is usually a single clear sentence | Abuse spread across several neutral-looking sentences, which no single sentence triggers |
| MatchType.FULL | Scans the entire text as one unit | Short inputs or outputs where the overall tone matters more than any one sentence | Isolated toxic sentences inside long passages, which can be diluted by surrounding text |
| Default threshold of 0.5 | Flags text whose toxicity score meets or exceeds 0.5 in the scanner's configuration | A starting baseline for a general audience before you review real traffic | Calibration to your users, languages or domain, so expect false positives and negatives |
| Lower threshold (tuned) | Flags more text, including borderline content | Consumer or youth-facing products where false negatives carry higher risk | More legitimate messages blocked, including discussions of abuse, medicine or safety |
| Higher threshold (tuned) | Flags only strongly toxic text | Internal tools for professional users who use blunt language | Mild harassment and coded abuse that scores below the cutoff |
| Input placement | Screens user prompts before they reach the model | Stopping abusive requests and protecting the model context | Toxic content the model generates from benign prompts, which needs the output scanner |
| Output placement | Screens model replies before users see them | Preventing the application from displaying harmful model text | Abuse already sent in the prompt, and replies blocked after the model has already processed it |
Tuning the threshold for your users
The Toxicity scanner's default threshold is a starting point, not a policy. Who sees the application, what content they legitimately send, and how each block is handled should decide whether you move it. The cards below cover the decisions that connect those factors.
Audience sets the baseline
A consumer chatbot open to the public faces a different mix of abusive input than an internal assistant used by trained staff. Decide first who the users are, whether they are authenticated, and how much abuse you expect. Write that down as the reason for any threshold you choose, so a later reviewer can see why it was set. Treat a change as a policy decision, not a tuning tweak.
Quoted and moderated content
Support teams, trust and safety analysts and content moderators often paste abusive text on purpose, and legal or HR staff may quote threats. A stricter threshold blocks these legitimate requests as false positives. Build a small set of these examples and check how often each threshold stops them. Decide whether the application should refuse, warn, or route the request to a reviewer instead of silently dropping it.
Sentence or full-text matching
The scanner can check each sentence with MatchType.SENTENCE or scan the entire text with MatchType.FULL. Sentence matching flags a single abusive line inside a long message, which suits chat logs and long documents. Full-text matching judges the overall tone and may miss one harmful sentence in otherwise neutral text. Test both modes on the same sample before you pick one, because the choice changes what the threshold means.
Toxicity scanner docsSeparate input and output thresholds
Input and output carry different risks. Input thresholds protect the model and your users from abusive prompts, while output thresholds protect readers from toxic model replies. A model may produce offensive text from a neutral prompt, so the output side may need a different setting. Record the threshold for each scanner direction separately so changes to one do not silently alter the other.
Test with representative prompts
Before changing the default, assemble prompts that match real traffic, including slang, multilingual text, quoted abuse and benign messages that contain sensitive words. Run them through the scanner at the current and candidate thresholds and compare the blocked and allowed results. Ask the business owner to label disputed cases. The sample should be large enough to show the trade-off clearly, and it should be refreshed as usage changes.
Log decisions and review them
Log each scanner decision with its score, direction, match mode and threshold so that blocked requests can be reviewed later. Without these records you cannot measure false positives or justify a change to auditors. Set a review owner and a schedule, and confirm your logging meets your data retention and privacy rules, since prompts may contain personal data. Because LLM Guard is archived, plan this review alongside any move to a maintained guardrail.
Setting up the Toxicity scanner in an existing deployment
This sequence confirms the pinned LLM Guard version and Python runtime, configures the Toxicity scanner on both sides of the model, and proves with labeled test cases that it loads and logs each decision. It gives you a record you can review before the deployment is contained or replaced.
Confirm the pinned version and Python runtime
The platform team checks which LLM Guard version the deployment installs and records it in the change log. 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, so confirm the interpreter in the runtime image falls in that range. Done means the version string and interpreter version are written down together, and any mismatch is raised before anything else changes.
Install or review the package in a locked environment
An engineer installs the pinned package into an isolated virtual environment, or reviews the existing environment with pip freeze and compares the output to the recorded version. Keep the lock file under version control so the dependency set can be reproduced. Done means the environment resolves without conflicts and the record matches the running package, with the source of the install noted.
Locate the Toxicity scanner in input and output configuration
The engineer finds where the application constructs the input and output scanner lists, then confirms the Toxicity scanner appears in each one. Input scanning covers user prompts before they reach the model, and output scanning covers model responses before users see them. Done means you can point to the two configuration locations and state which side each scanner guards.
Set the match type and threshold explicitly
Set the Toxicity scanner's match type and threshold as named configuration values rather than relying on defaults. The Toxicity scanner supports MatchType.SENTENCE, which checks each sentence, and MatchType.FULL, which scans the entire text, so record which one is in use and why. The default threshold is 0.5, so record that value or your agreed override. Done means the configuration file shows both values and a reviewer can read them without running code.
Confirm the model loads at startup
Start the service and watch the startup logs for the Toxicity model download or load, using the model cache location your environment defines. In an air-gapped or restricted network, confirm the model files are already present in the approved location. Done means the scanner initializes without errors, and a single test prompt returns a scored result rather than an exception.
Run a labeled test set through input and output
Assemble a labeled set of benign prompts, clearly toxic prompts and borderline cases, and run each through the input scanner and a matching set of model outputs through the output scanner. Record whether each item was flagged and compare that with the label. Done means you have a results table with false positives and false negatives counted per side, and the borderline cases are noted for threshold review.
Verify that logs record every decision
Check that each scanner decision, including the score, the threshold applied, whether the text was flagged and a request identifier, appears in the application or API server logs. Confirm that logs do not store the raw user text beyond what your data handling policy allows. Done means a sample of test requests can be traced end to end from the log entry back to the labeled test case.
Where the Toxicity scanner sits in the request flow
The flow starts with a user prompt arriving at the application, which passes it to the input Toxicity check before any model call. A clean prompt continues to the model, and the model's reply goes to the output Toxicity check before the user sees it. A flagged prompt or reply is blocked and replaced with a refusal, and both outcomes are written to the log. Check that the block branch returns a safe message and that the log records the scanner name and score.
Toxicity checks run on both sides of the model call, with blocked traffic logged.
Security and operational risks of the Toxicity scanner
The Toxicity scanner is a classifier that makes judgments about text, so its failures are both technical and operational. The cards below cover where it misses abuse, where it misjudges users, and where the archived project leaves you exposed. Review each one before the scanner sits in a production path.
False negatives on coded abuse
A classifier trained on common phrasing can miss abuse written in slang, leetspeak, misspellings, or indirect wording that avoids obvious toxic terms. Sentence-level matching can also miss hostility that only appears when several sentences are read together. Test the scanner against a set of abusive examples written the way your users actually write, and record which ones pass. Treat the result as a filter that reduces volume, not as a guarantee that abuse is caught.
Bias against dialects and identity terms
Toxicity models can score neutral text as toxic when it contains identity terms, regional dialects, or non-standard grammar, which means some user groups are blocked more often than others. The effect is hard to see in aggregate totals. Build a labeled sample of benign messages across the dialects and communities your product serves, then compare block rates between groups before setting a threshold.
Model loading from external sources
The scanner downloads its RoBERTa model from Hugging Face on first use unless you pre-stage it. That makes the model a supply chain dependency: a changed or unavailable artifact changes how your application behaves. Pin the model revision, mirror the files into storage you control, and verify checksums before the container starts. Confirm that outbound access to model hosts is blocked in production so the scanner cannot fetch new code at runtime.
No security patching of the archived model
The archive notice means the project and its Hugging Face models are no longer maintained, so no fixes will arrive if a weakness is found in the model, its tokenizer, or the Python dependencies that load them. Your team owns patching of the base image, the Python packages, and the model files. Record which versions you run, subscribe to advisories for the libraries, and set a date to move the function to a maintained guardrail.
LLM Guard repositoryLogging of user content
Scanner logs, API server logs, and tracing tools can record the prompts and responses that the Toxicity scanner evaluates, including abusive messages that users sent and personal data inside them. Decide which fields are logged, where they are stored, and how long they are kept before you enable debug logging. Route logs through the same retention and access rules that apply to your other customer data, and confirm the behavior in your own configuration.
Fail-open versus fail-closed behavior
When the scanner errors, times out, or cannot load its model, the application either passes the message through (fail-open) or rejects it (fail-closed). Neither default fits every product, so the choice must be made deliberately per route. Test the failure path by stopping the model service during a rehearsal, and confirm that the chosen behavior produces a visible alert rather than silent acceptance of unscanned content.
Questions buyers ask before replacing or tuning the Toxicity scanner
What drives the cost of replacing or tuning the LLM Guard Toxicity scanner?
The cost depends mainly on how many applications call the scanner, how many input and output paths you need to cover, and how much evidence your risk or compliance team expects before a change goes live. Tuning a threshold on one application is small work. Replacing the scanner across several applications, with test sets, logging and sign-off, takes more effort. No price is set for this work here. A written scope should list the applications in scope, the input and output points, the test data you will provide, and the deliverables, so you can compare quotes on the same basis. Ongoing model hosting and monitoring are recurring costs that a quote should separate from one-time work.
How long does a Toxicity scanner tuning or replacement project take?
Duration depends on the number of scanner call sites, the quality of your existing test prompts and outputs, and the review steps your organization requires before a threshold change is approved. A tuning exercise on a single application with a labeled sample set is usually shorter than a replacement that must be proven against the existing behavior across several products. No duration is stated here. Ask for a timeline in the written scope that names the test set, the review gates and who signs off each stage.
What does our team need to provide for the work?
You will need to name the applications and endpoints that use the scanner, the current configuration (including the match type and threshold), and representative prompts and model outputs from your users. Your security or trust and safety team should supply the categories of harm they care about and the cases they have already seen in production. You also need access to the environment where LLM Guard runs, including logs and the Python version in use, and a named reviewer who can approve threshold changes. Without labeled examples from your own users, threshold decisions remain guesses.
Can our internal engineering team tune the Toxicity scanner without a partner?
Yes, a capable internal team can change the threshold and match type on a single application, because these are configuration values in the scanner setup. The harder part is building a representative test set, measuring false positives and false negatives on your own traffic, and documenting the result for reviewers. Internal teams often underestimate that evaluation work. If the scanner also has to be replaced, the team needs to cover the model dependency, the Python version limit and the replacement guardrails. Decide early which of these you will own and which you want a partner to carry.
Is LLM Guard still maintained, and should we keep using the Toxicity scanner?
The protectai/llm-guard repository was archived by its owner on 9 July 2026, and the README states that the project and its associated Hugging Face models are no longer under active development or maintained. Existing deployments can keep running while you plan, but no new rollouts are recommended. Treat the scanner as a component to contain and replace, and avoid building new products on it. Confirm the current status of the repository and models directly before you make a decision, since your compliance team will ask for this evidence.
How does the Toxicity scanner relate to a migration to NeMo Guardrails?
NeMo Guardrails is an open-source toolkit for programmable guardrails, and it works differently from LLM Guard scanners. A migration therefore means mapping what the Toxicity scanner blocks today to rules, classifiers or checks in the new toolkit, not swapping one configuration value for another. Start by recording the current match type, threshold and the sample of blocked and allowed outputs. Then build a test set that the replacement must handle at least as well. Confirm the capabilities you need in NeMo Guardrails against its own documentation before committing to a design.
What is the difference between sentence and full-text matching, and does it change the migration?
LLM Guard's Toxicity scanner supports MatchType.SENTENCE, which checks each sentence, and MatchType.FULL, which scans the entire text. The match type changes what gets flagged, so a switch can alter the blocking rate for the same input. Record which mode each application uses before any change, and include both long and short texts in your test set. The match type must be carried into the migration test plan, because a replacement that behaves differently on multi-sentence outputs will not match the protection you had.
What licensing questions should we check before reusing LLM Guard code or models?
LLM Guard is licensed under the MIT license, which allows use, modification and redistribution with the license notice kept. The models it uses on Hugging Face are a separate question and may carry their own terms. Check the license of each model the Toxicity scanner loads before you reuse, copy or fine-tune it. Your legal team should review this with the project's license text and the model cards. This page does not give legal advice.
Replacing the Toxicity scanner with a maintained guardrail
Replace the Toxicity scanner only after you can prove the replacement blocks at least what it blocked. Start by recording a set of prompts and model outputs that the Toxicity scanner flagged in your own traffic, along with the scanner's score and the decision your application made. Include borderline cases that were allowed through, and remove personal data before the set is stored or shared. This recorded set is your acceptance baseline, and it is the only fair way to compare a new guardrail, because a generic public toxicity dataset will not reflect how your users actually write. Confirm with your security and privacy teams where the set may be kept and who may read it.
The maintained direction named in the LLM Guard pillar is NeMo Guardrails, an open-source toolkit for programmable guardrails. Its configuration and rails differ from a single classifier call, so plan the change as a design task rather than a drop-in swap. Replay the recorded set against the candidate configuration, then compare each result with the original LLM Guard decision. Review every case where the candidate allows content that LLM Guard blocked, and every case where the candidate blocks content that was previously allowed, since both change user experience and risk. Confirm the current capabilities and supported model options in the NeMo Guardrails documentation before you commit to a design.
Keep the evidence that an auditor or internal reviewer will ask for. That means the baseline set with its redaction record, the replay results for both scanners, the list of accepted differences with a named approver for each, the configuration version under test, and the date of the test. Also keep the threshold or rail settings used in both systems, so the decision can be reproduced later. Store these records with the change ticket for the decommission. A reviewer should be able to see what LLM Guard blocked, what the replacement blocks, and why any remaining gap was accepted.
How DeployOpen works on this
DeployOpen plans, implements and supports self-hosted open-source platforms inside your own infrastructure, including the LLM Guard Toxicity scanner where it still runs. Because LLM Guard is archived, the work centers on keeping an existing scanner contained and on replacing it with a maintained guardrail under a written scope.
How we scope
- Inventory every place the Toxicity scanner runs, including input and output paths, thresholds and match types.
- Record which users, languages and applications the scanner must protect, and which false positives are acceptable.
- Agree deliverables, timelines and acceptance tests in writing before any work starts, since most engagements are fixed-scope.
How we build
- Test the current scanner against a labeled sample of your real traffic to set a baseline for blocked and allowed messages.
- Tune the threshold and match type in a staging copy, then document each change with the test results behind it.
- Deploy in your cloud accounts, data centers or air-gapped network, and confirm that the RoBERTa model loads from storage you control.
How we hand over
- Deliver configuration files, a runbook for threshold changes, and the test suite used to measure false positives and misses.
- Document the model version, Python runtime and dependency pins so your team can reproduce the deployment later.
- Walk your engineers through the replacement plan so the move to a maintained guardrail can proceed without DeployOpen.
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer if you want DeployOpen to keep the scanner contained.
- Re-run the toxicity test set after any change to models, Python versions or application prompts.
- Confirm with your own security and compliance teams how scanner results will be logged, reviewed and retained.

