What the LLM Guard JSON scanner does and when you still need it
The LLM Guard JSON scanner detects JSON structures in model output with regular expressions, validates them with Python's built-in json library, and repairs malformed output with json_repair. The No Refusal scanner detects refusals in model output, which can signal that someone is pushing the model toward harmful content. LLM Guard is archived as of 9 July 2026, and its owner no longer maintains the project or its models on Hugging Face, so no new rollouts are recommended. Teams still running these output scanners usually do so because downstream systems depend on the shape and behavior of the output while a replacement is being built.
The JSON scanner matters most where a parser sits behind the model. If a pipeline expects a fixed schema, a repaired object can pass silently while the schema has drifted. Before changing anything, confirm which fields your consumers read, whether json_repair is silently fixing truncated or unbalanced output, and how often that repair path runs. Those counts tell you how much of your structured output currently depends on repair, which is the first number to capture before a migration. Keep the scanner enabled during the transition so that malformed output is still caught in the same place it is caught today.
The No Refusal scanner is worth keeping for the same reason: it records a signal your team may already use in monitoring, escalation or abuse review. Removing it changes what gets logged and flagged, so compare alert volumes before and after any switch. Confirm the scanner's refusal detection against your own sample of prompts and responses rather than assuming it covers your refusal wording. Your team should also decide who owns the outputs of this scanner once LLM Guard is no longer maintained, because a silent gap in refusal monitoring is harder to notice than a failed request.
Where the JSON and No Refusal scanners sit in the output path
The diagram starts with the model response, which LLM Guard passes to its output scanners before anything reaches the application. The JSON scanner checks whether the output contains JSON structures and whether they parse, repairing them with json_repair when possible. The No Refusal scanner runs as its own check and flags refusals that can signal someone pushing the model toward harmful output. Each scanner returns a pass or block decision, and only passed output reaches the downstream parser. Check how your application handles a blocked response and whether a repaired JSON value is still the value you expect.
Output scanners run as separate checks before the application parses the response.
Which configuration options fit JSON and No Refusal
Validation without repair suits workflows where a downstream parser expects strict JSON and a malformed response should fail. The JSON scanner finds JSON-like structures with regular expressions and checks them with Python's built-in json library, so a response that does not parse is flagged and left as the model produced it. That keeps failures visible in logs and test results.
- Strict consumers: Use it when a pipeline, tool call or API client rejects anything that does not parse, so a failure can stop the flow and trigger a retry or error path.
- Visible failures: Flagged output stays unchanged, so the team can see exactly what the model returned during testing.
- Retry cost: Each flagged response usually needs another model call or an error path, so measure the failure rate on your own prompts before using this on high-volume workflows.
- Detection limits: Regular expression detection can treat text that only resembles JSON differently than you expect, so test with representative samples.
Confirm the exact parameter names that control validation in the JSON scanner documentation, then test a malformed sample before go-live.
Repair fits workflows where the model is usually correct but sometimes drops a closing brace or adds a trailing comma, and where a human reviews results later. The JSON scanner passes malformed structures to json_repair, which attempts to produce valid JSON. The trade-off is that the repaired object may differ from what the model meant, and consumers cannot tell unless you log the change. See the JSON scanner documentation for the supported behavior.
- Batch and review jobs: Summarization or extraction jobs with a human check afterward can tolerate occasional lost fields.
- Silent alteration: A repaired object can parse while carrying wrong or missing values, so check required fields after repair.
- Raw output retention: Store the original and repaired text together so incidents can be reconstructed.
- Security impact: Repair can accept input that a strict parser would reject. Where JSON controls permissions or tool arguments, use validation only.
Confirm how the scanner exposes the original and repaired text, and run a sample set through repair to compare what changed.
The No Refusal scanner detects refusals in model output. In a user-facing product, a refusal can be a signal that someone is pushing the model toward harmful output, so flagging it gives security and product teams an event to review. The trade-off is that refusals also occur in ordinary interactions, such as declining an out-of-scope request, so the scanner will raise matches that need triage.
- Public assistants: Enable it where anonymous or lightly authenticated users can reach the model, so repeated refusals can be linked to a session.
- Event routing: Send matches to a log or alerting pipeline along with the user identifier and the prompt, not just the output.
- False positives: Benign refusals will match, so review a sample before setting alert thresholds.
- Response behavior: Decide whether a match blocks the response, adds a warning or only logs. Blocking changes the user experience, so product and security owners should agree on it in writing.
Confirm the detection behavior and any match settings in the No Refusal documentation before you rely on it for alerts.
For internal tools used by vetted staff, such as analysts evaluating models or developers working in a sandbox, refusals are often expected and frequent. Turning the scanner off reduces alert noise and avoids blocking legitimate security testing, but it removes an output-side signal that some teams still want. The decision should follow the threat model for the tool, including who can reach it and what data it touches, not only the user group.
- Trusted populations: Developers and analysts generate many refusals during testing, and those alerts can hide actual misuse signals.
- Reduced visibility: Without the scanner, an insider's attempt to push the model toward harmful output has no automatic output-side marker, so audit logs and access controls must carry that load.
- Red team work: Testers may need unfiltered refusals to measure guardrail behavior, so keep that traffic on a separate evaluation path.
- Re-enable conditions: Document what would turn the scanner back on, such as a new user group, external access or a change in the data the tool handles.
Confirm which users, API keys and services reach the scanner in your deployment, and record the decision with an owner and a review date.
How to configure and test both scanners in an existing deployment
This sequence pins the Python environment, turns on the JSON and No Refusal output scanners, and checks their behavior against a fixed test set so the team has recorded pass or fail evidence before relying on them. It applies to deployments that already run LLM Guard and does not recommend new rollouts.
Confirm the Python environment falls in the supported range
The platform or application team checks the Python version used by the LLM Guard host or container. The last PyPI release, 0.3.16, uploaded on 19 May 2025, requires Python 3.10 or newer but below 3.13, so the interpreter must fall inside that range. Record the interpreter version and the installed llm-guard version with
pip show llm-guard. The step is done when both values are written into the change record and match the range. If the version is outside it, stop here and move to the rollback plan before changing anything else.Pin the LLM Guard and dependency versions
The platform team pins llm-guard to 0.3.16 in the requirements file or lock file, and pins the transitive packages the JSON and No Refusal scanners load, including json_repair. Rebuild the environment from the lock file on a clean host so that no drifting package is picked up silently. Check the result by running
pip freezeand comparing it with the committed lock file. The step is done when a fresh build reproduces the same package set, and the archived status of the project is noted in the runbook so future changes are reviewed with that in mind.Enable the JSON scanner in the output pipeline
The application engineer adds the JSON scanner to the output scanner list in the existing configuration, using the scanner's documented settings for required and repaired output. The scanner detects JSON structures with regular expressions, validates them with Python's built-in json library, and repairs malformed output with json_repair. Decide in advance whether the application should receive repaired output or reject it, and write that choice into the configuration comments. The step is done when the configuration loads without error in a test process and the scanner appears in the active output chain.
Enable the No Refusal scanner in the output pipeline
The application engineer adds the No Refusal scanner to the same output chain, with its threshold and settings taken from the documentation for the installed version. The scanner detects refusals in model output, which the security team uses as a signal that a user may be pushing the model toward harmful content. Confirm the order of scanners so that a refusal is evaluated before any downstream logic treats the response as an answer. The step is done when a test process reports both scanners as active and the order is recorded.
Build a fixed test set of outputs
The security or QA engineer assembles a fixed set of model outputs stored in version control. It should include valid JSON, malformed JSON that json_repair can fix, malformed JSON that cannot be fixed, ordinary answers, and clear refusals in several phrasings. Label each item with its expected result before running anything, so the labels are not shaped by the scanner's behavior. The set is illustrative until the team reviews it, and the reviewer signs off on the labels. The step is done when the file is committed and each item has an expected outcome.
Run the test set and record pass or fail results
The QA engineer runs every item through the configured output pipeline and records the scanner decision, any repaired text, and the expected result for each case. Compare the results with the labels and mark each item pass or fail. Investigate every failure, deciding whether the scanner, the configuration, or the label is wrong, and fix it in the same change set. Save the output as a dated report alongside the pinned versions. The step is done when every item has a recorded result and each failure has an explained disposition.
Confirm the results in a staging run and set a rollback point
The platform team repeats the test set against a staging copy of the deployment and checks that results match the recorded run. They record the previous configuration and the last known good image or environment as the rollback point, and document how to restore it, including the command or deployment step. The owner signs the report and a reviewer confirms the rollback path is tested. The step is done when staging results match production configuration, the rollback point is recorded, and the owner approves the change for production.
Security risks when relying on archived output scanners
LLM Guard's JSON and No Refusal scanners are running on a project that no longer receives fixes. The cards below cover the risks that follow from that status, plus the design choices around the scanners that teams control directly.
No upstream fixes ship
The repository was archived by its owner on 9 July 2026, and the README states the project is no longer maintained. Any flaw found in the JSON or No Refusal scanners will stay open unless your team patches it. Record who owns the fork or pinned copy, and who will triage a new bypass report.
LLM Guard on GitHubRepair can hide bad payloads
The JSON scanner uses json_repair to fix malformed output, so a payload that fails strict parsing may be silently corrected and passed downstream. A repaired object can differ from what the model meant, and the scanner's result may not show that the original output was broken. Compare raw and repaired output in logs, and decide whether repaired JSON should be accepted at all.
Refusal detection can be evaded
The No Refusal scanner flags refusal language in model output, which is a signal that someone may have pushed the model toward harmful content. Attackers can rephrase requests or wrap them in role-play so refusals take a different form, and the scanner will miss them. Treat a clean result as one signal among several, and test it with your own adversarial prompts before relying on it.
Blocked outputs stored in logs
When a scanner blocks an output, the blocked text often lands in application logs, traces or review queues. If that text contains personal data, credentials or internal content, the blocked response becomes a new data store. Confirm what your deployment logs on a block, set retention for those records, and restrict who can read them.
Python version pinned in place
The last PyPI release, 0.3.16, uploaded on 19 May 2025, requires Python 3.10 or newer but below 3.13. Operating system upgrades or base image changes can push the runtime outside that range, and the scanner may stop installing or running. Pin the interpreter and the dependency set together, and keep a tested rebuild path.
- Supported Python range
- 3.10 to 3.13
Open access to the scanner API
LLM Guard can run as an API server, and any service that can reach that endpoint can submit text for scanning and read the verdicts. Without authentication and network limits, the scanner becomes an unmonitored entry point that other systems or users can probe. Place it behind your gateway or service mesh, require authentication, and log which callers scan which outputs.
JSON scanner docsHow to replace JSON and No Refusal checks with maintained guardrails
Treat the JSON and No Refusal scanners as a baseline to replace, not a control to keep extending. The first step is to record what each scanner currently does in your deployment: the input and output it receives, the fail_fast and threshold settings in use, and what happens to a response it flags. Capture real traffic samples, including malformed JSON that the json_repair path quietly fixed and refusal phrasings that triggered blocks. Those samples become your regression set. Because the LLM Guard project is archived and no longer maintained, DeployOpen does not recommend new LLM Guard rollouts, so this inventory should feed a decision about where each behavior will live next.
Map each behavior to a maintained home. JSON validation is usually better placed in the application itself: parse the model response with a schema validator, reject or retry on failure, and decide explicitly whether silent repair is acceptable for your data. Do not assume that repair is harmless, since a repaired payload can change meaning without any error. Refusal-based detection of harmful pressure is a different problem. NeMo Guardrails is a maintained option for programmable output rails, and you should confirm with its documentation which rail types, and which model or classifier calls, fit your application. Confirm the model dependencies and latency cost of any guardrail before you commit to it.
Prove the replacement blocks at least what the scanners blocked. Run the regression set through the old and new controls side by side, and record every case where the old scanner blocked output and the new control does not. Treat each gap as a failure until someone signs off on it. Add adversarial cases that a refusal classifier would miss, such as harmful content delivered after a partial refusal, so you are not only copying the old scanner's behavior. Keep the results as evidence for your security and compliance reviewers, and rerun the suite after every model or prompt change.
Questions teams ask before replacing or hiring help for these scanners
What drives the cost and effort of replacing the JSON and No Refusal scanners?
The main drivers are how many LLM Guard deployments call these two output scanners, how many applications depend on their output format or refusal handling, and how much existing behavior must be proven before the switch. The JSON scanner is mostly a parsing and repair step, so its replacement is usually small in code but large in test cases, especially where downstream systems expect a particular repaired shape. The No Refusal scanner depends on a model-based refusal check, so its replacement needs a documented baseline of what it blocked. Costs split into internal engineering time, any partner fees under a written scope, and recurring costs for hosting and monitoring the replacement. Ask any quote to itemize the number of applications, the test cases, and the monitoring it includes.
How long does it take to move from these scanners to a maintained guardrail?
The duration depends mainly on test coverage and approvals. Teams with a recorded set of prompts and outputs, and a clear owner for sign-off, can usually move faster than teams that must first build that evidence. Approvals from security, compliance and application owners often set the pace more than the code change does. Before accepting any timeline, confirm how many applications use these scanners, whether the output format is checked downstream, and which review steps your change board requires. A fixed-scope quote should state the duration it assumes, and the assumptions behind it.
What does the work need from our internal team?
The work needs a named application owner who can describe expected JSON structures and acceptable refusal behavior, an engineer who can change how the application calls its guardrail, and a reviewer who can approve test results. Security or compliance staff should confirm which blocked outputs must still be caught after the switch. You will also need access to a staging environment that resembles production and to logs from the current deployment, so the replacement can be compared against real traffic. Confirm these roles early, because missing reviewers are a common cause of delay.
Can our own team replace these scanners without a partner?
Yes, if your team has engineers who know the application, can write regression tests, and can run the change through your approval process. The JSON scanner replacement is typically a contained change to parsing and validation code, while the No Refusal replacement needs more evaluation work to show it catches what the original did. Teams without a test suite, or without capacity to maintain a new guardrail after go-live, usually find an outside partner useful for the evidence and handover. Decide based on your staff capacity and the number of deployments, not on the scanner names alone.
Does the MIT license let us keep running LLM Guard?
The LLM Guard code is licensed under the MIT license, which permits use, copying and modification, subject to keeping the license notice. That lets you keep running an existing deployment. The license does not cover the models hosted on Hugging Face, which carry their own terms, and the project no longer receives updates. Read the separate licensing guidance for these models and confirm the terms with your legal team before relying on them. Continuing to run an archived version also means you own any security fixes, so plan a replacement even if you keep the current deployment for now.
What does a fixed-scope quote for this work cover?
A fixed-scope quote covers the agreed list of applications, scanners and environments, the deliverables, and the timeline assumptions, all written before work starts. For this work, expect it to name the baseline tests, the replacement design, the change steps, the evidence package for your reviewers, and handover to your operations team. It should also state what is excluded, such as scanners outside this scope or changes to the models your applications call. Ask the quote to list the assumptions about your test coverage and approvals, and what happens if those assumptions change during the engagement.
Will the replacement catch everything the No Refusal scanner caught?
Not without testing. The only way to know is to run a recorded set of prompts and outputs through both the original scanner and the replacement, then compare what each one flags. Differences should be reviewed by the owners of the application and security. Ask any provider to show the comparison method and the test set it used, rather than accepting a general claim about detection quality.
How DeployOpen scopes and delivers LLM Guard output scanner work
DeployOpen approaches LLM Guard JSON and No Refusal scanners as part of a wider guardrail replacement plan, not as a standalone configuration task. We scope what each output scanner must catch in your environment, build and test replacements in infrastructure you control, and document the result so your own team can run it. Engagements are fixed-scope, with a written scope agreed before work starts.
How we scope
- Inventory which output scanners run in your deployment, including JSON and No Refusal, and where their results change responses.
- Record the exact output behavior each scanner enforces today so the replacement has a documented baseline to match.
- Agree deliverables, environments and acceptance tests in a written scope before any build work begins.
How we build
- Replace JSON validation and repair logic with a tested parser and an explicit policy for malformed model output.
- Map No Refusal detection to a maintained guardrail option, then tune refusal-signal rules against your own prompt samples.
- Run both old and new scanners side by side on recorded traffic, and confirm the replacement blocks at least what LLM Guard did.
How we hand over
- Deliver configuration, source code and runbooks for each replaced scanner, stored in repositories your organization controls.
- Provide a test report listing each sample prompt and output, the expected result and the observed result.
- Walk your engineers through operation, alerting and rollback, and document open risks that remain after handover.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer after handover.
- Retesting covers guardrail changes, model updates and new prompt patterns your application adds over time.
- Ask any quote to name the environments, test cases and retest cycles included, so support boundaries are clear.

