Migrating from LLM Guard to Guardrails AI validators

Moving an archived LLM Guard deployment to Guardrails AI validators means remapping each scanner, checking every validator's license and upkeep, and proving the new guards block at least as much. This page explains how the work is scoped.

On this page

Migrating from LLM Guard to Guardrails AI validators starts with a scanner-by-scanner map

The first step in moving from LLM Guard to Guardrails AI validators is a scanner-by-scanner map of what your deployment actually runs, not a choice of replacement library. The protectai/llm-guard repository was archived by its owner on 9 July 2026, and its README states that the project and its Hugging Face models are no longer under active development or maintained. Any team inheriting that deployment needs to know, for each input and output scanner, what it checks, what threshold it uses, which model it loads and whether it blocks traffic or only logs it. Only then can a team judge which Guardrails AI validators are close matches and which scanners have no direct equivalent and need a different design.

Guardrails AI is licensed under Apache-2.0, and it is built around guards. A guard is assembled from validators published on Guardrails Hub, such as regex matching or toxicity detection. Validators are installed separately after pip install guardrails-ai and can be chained together, so each LLM Guard scanner usually maps to one validator or to a small chain. Effort depends on two things: how many scanners are in use, and how many have no close validator equivalent, which will need custom validators. The Guardrails AI README says users can write custom validators, so that work is possible, but its size is not something this page can estimate. Confirm scope against your inventory before asking anyone for a quote.

Before you adopt any validator, check its license and maintenance status on Guardrails Hub, since validators are published by different authors than the core project. Record the license, last update and open issues for each one in the map. Ask any partner to deliver the map as a written artifact with one row per LLM Guard scanner, the proposed validator or custom build, the blocking or logging mode, and the test set that will prove coverage. That map becomes the basis for the proof that the replacement blocks at least what LLM Guard did.

Which LLM Guard scanners have a Guardrails Hub validator to compare against

This table pairs common LLM Guard scanners with the nearest Guardrails AI validator type. Treat the match column as a starting point for evaluation, since even a close match needs the same test set, thresholds and failure behavior. Where no validator is confirmed, check the Guardrails Hub before adopting anything, and plan a custom validator or a control elsewhere if nothing fits.

LLM Guard scannerGuardrails Hub validator to checkMatch
ToxicityToxicity detection validator, named as an example in the Guardrails AI READMEClose match
SecretsRegex matching validator for known credential formats; coverage depends on your patternsPartial match
Sensitive (output)Regex matching for fixed formats; entity-level PII validators need confirmation on the HubPartial match
JSONStructured output from Pydantic models is a separate Guardrails AI function; confirm a JSON validatorPartial match
Malicious URLsNo validator confirmed for this page; check Hub listings for URL or domain checksConfirm on the Hub
Prompt InjectionNo validator confirmed for this page; test any candidate against your own attack setConfirm on the Hub
Ban TopicsNo validator confirmed for this page; topic-based validators need Hub confirmationConfirm on the Hub
Token LimitMay be handled in application code or the model call; confirm whether a validator existsConfirm on the Hub

Which documented Guardrails AI paths carry the migration

Guardrails AI offers a small set of documented paths for building guards, serving them and extending them. Each path maps differently from LLM Guard, and LLM Guard has no automated export to Guardrails AI, so every scanner has to be mapped by hand to a validator or a custom check.

Install the core library and validators

Guardrails AI installs with pip install guardrails-ai, and validators are installed separately from Guardrails Hub after that. Treat the core package and each validator as its own dependency with its own version and license. Record the exact validator names and versions in your migration map, since a scanner that LLM Guard ran from a single package may map to several validators you must install and pin.

Guardrails AI on GitHub

Run guardrails configure first

The guardrails configure command asks whether to enable anonymous metrics reporting. Decide the answer before the first run in a regulated environment, and record it in the deployment baseline. Confirm the setting in your own environment, because a prompt that reaches production hosts without review can send usage data outside the boundary your security team approved.

Guardrails AI quickstart

Serve guards with guardrails start

The guardrails start command runs a standalone Flask REST service that applications can call through the OpenAI SDK. This is the closest match to LLM Guard's API server mode. Plan the service's network placement, authentication, logging and process supervision yourself, and test that blocked requests return the same status and payload shape your clients already expect.

Chain validators into one guard

Guardrails AI guards are built from validators that can be chained together, for example a regex match followed by a toxicity check. LLM Guard ran its scanners in a sequence defined in code, so the chain order, short-circuit behavior and which validators log instead of block must be rebuilt explicitly. Compare decisions for each chain against your scanner inventory before cutover.

Write custom validators

Scanners with no matching validator on Guardrails Hub, such as an internal policy or a company-specific secret format, can be written as custom validators. Keep the detection logic, thresholds and test cases in your repository, and test each custom validator against the attack and benign sets you use for LLM Guard. Contributing a validator to Guardrails Hub is optional and makes it public, so decide that with legal and security review.

Guardrails AI repository

Map scanners by hand

LLM Guard has no automated export to Guardrails AI, so there is no tool that converts LLM Guard configuration into validators. Build a table with one row per LLM Guard scanner, the Guardrails AI validator or custom check that replaces it, and the owner who signed off. Gaps in this table are the scanners that need a custom validator or a different tool before cutover.

How to check validator licenses and maintenance before adopting them

The Guardrails AI core is Apache-2.0 licensed, but every validator on Guardrails Hub carries its own license and maintenance status, and each one has to be read on its own. Installing the core under a permissive license tells you nothing about the validator you chain onto it. Before a validator replaces a scanner you run today, open its Hub listing and its source repository, find the license file in that repository, and confirm the license allows your intended use, including internal hosting and any redistribution of your container image. If the license is unclear, unusual or missing, treat the validator as unapproved until your legal or compliance team has reviewed it.

Next, judge whether the validator is still being kept alive. Look at the date of the last commit, the recent release history, the number of open issues about breakage, and whether the maintainer responds to them. A validator that has not changed in a long time may still work, but you then own every fix it will ever need. Also check what the validator downloads at runtime. Some validators pull model weights from third-party hubs, and you need to know the source, the license of those weights, and whether your network policy allows the download. Confirm the Python version the validator requires as well, since it may conflict with the version your platform team has standardized on, and the LLM Guard archive already shows how an unmaintained Python ceiling can stall a deployment.

Finally, pin everything. Guardrails AI published v0.10.0 on April 3, 2026, v0.10.2 on June 4, 2026, and v0.11.0 on August 14, 2026, so release timing shows that the core moves often enough to matter. Pin the core version and each validator version in your lock file, then rerun your attack and benign test sets after any upgrade, because a validator update can change which inputs it blocks. Check the Guardrails AI GitHub releases page before each planned upgrade and record the license and maintenance findings for each validator in your migration map so the review is repeatable.

How a scanner-by-scanner cutover runs with a parallel period

The sequence moves an LLM Guard deployment to Guardrails AI validators one scanner or endpoint at a time, using a period where old and new guards run on the same traffic so each switch is backed by comparison data rather than assumption.

  1. Inventory every scanner and its thresholds

    Your team lists each input and output scanner in use, the threshold and model settings for each, and every place the LLM Guard library or API is called from. Mark which scanners actually block requests and which only log. The step is done when every call site maps to a named scanner with recorded settings, and the blocking scanners are separated from the logging ones. This inventory becomes the baseline for every later comparison.

  2. Map each scanner to a validator or rail

    For each scanner, decide whether a Guardrails Hub validator, a NeMo Guardrails rail or a direct library call is the closest replacement. Check each candidate validator's license and maintenance status on Guardrails Hub before adopting it, and note any model it downloads. The output is a mapping table with one row per scanner, the chosen replacement, its license, and any gaps where no maintained option matches the old behavior.

  3. Build a pilot validator chain

    Your engineers install the chosen validators with pip, chain them into a guard for one low-risk endpoint or one scanner, and wire in the same thresholds recorded in the inventory. Where a validator's default behavior differs from the LLM Guard scanner, record the difference. The step is done when the chain runs locally against sample inputs and returns structured pass or fail results your logs can capture.

  4. Run old and new guards side by side

    Send the same production traffic, or a copy of it, through both the LLM Guard scanner and the new validator chain. The new chain does not yet affect users, and its decisions are logged alongside the LLM Guard decisions. Confirm that the copy respects data handling rules before any prompt leaves its normal boundary. The parallel period runs until enough traffic has been seen in each scanner's category to support a decision.

  5. Compare blocked and allowed decisions

    Compare the two decision logs for each scanner. Count requests that LLM Guard blocked but the new chain allowed, which are gaps in coverage, and requests the new chain blocked but LLM Guard allowed, which are potential false positives. Review samples of both groups with the people who own the application. The output is a written comparison per scanner that states the gaps, the agreed fixes and the decision to cut over or keep tuning.

  6. Cut over one scanner or endpoint at a time

    Once a scanner's comparison is accepted, switch that scanner or endpoint to the validator chain and keep the LLM Guard path available for rollback. Monitor blocks, errors and latency after each switch. Move to the next scanner or endpoint only after the previous one has run cleanly. The step is complete when every endpoint in the inventory is served by the new guards with a tested rollback path.

  7. Decommission LLM Guard after the replacement holds

    After all cutovers have held, remove LLM Guard from the call paths, retire its API server, and keep the archived package pinned and documented for any historical audit needs. Remove the parallel logging and any unused model downloads. The step is done when no production path calls LLM Guard, the decision records from the parallel period are retained under your own retention policy, and the change is recorded in your inventory.

How traffic flows through LLM Guard and Guardrails AI during the parallel run

The application sends each prompt to the live path, which still runs the LLM Guard scanners and returns their decision to the user. A copy of the same request also goes to a shadow path that runs the Guardrails AI validator chain. Both decisions are written to one comparison log, so the team can check missed attacks and false positives before any client moves its endpoint. Only the live decision is ever enforced until the comparison passes.

Live LLM Guard decisions are enforced while Guardrails AI decisions are only logged for comparison.

What drives the cost and duration of the migration

This table lists the factors that change the effort of moving from LLM Guard to Guardrails AI validators, who carries each cost, and whether the cost is one-time or recurring. Use it to shape the questions you put to a partner and to your own team's estimate. The main takeaway is that scanner count and validator gaps set most of the work, while retesting and validator upkeep keep costing money after cutover.

DriverWhy it changes cost or effortOne-time or recurringHow to keep it down
Number of input and output scanners in useEach scanner in production needs a mapping, a validator choice, a threshold decision and a test set. Scanners that only log need less work than scanners that block traffic.One-timeInventory only the scanners that are enabled, and confirm which ones block versus log before quoting.
Scanners with no close Guardrails Hub validatorA gap means a custom validator must be written, reviewed and tested, which is usually the largest build item.One-timeCheck the Guardrails Hub for each scanner early and separate matches from gaps in the scope.
Custom validators to writeCustom validators need code, unit tests, documentation and a decision on who owns them after handover.One-time build, then recurring upkeepReuse existing internal rules and keep custom validators small and single-purpose.
Threshold re-tuning on real trafficValidators do not produce the same scores as LLM Guard scanners, so thresholds must be set again against your own prompts and responses.One-time, repeated if traffic shiftsCapture a representative traffic sample and agree acceptance criteria before tuning starts.
Parallel-run periodRunning old and new guardrails side by side means two sets of logs, extra compute and staff time to compare decisions.One-time, with ongoing compute cost while it runsSet a fixed end date and a clear rule for when the old scanner is switched off.
Hosting and Python version constraintsLLM Guard's last PyPI release requires Python 3.10 or newer but below 3.13, which may differ from the Python version the new validators need. Build environments may need to be split.One-time, then recurring when runtimes are upgradedConfirm the Python version each validator and the guardrails-ai package support before pinning the runtime.
Validator license and maintenance reviewEach Hub validator has its own license and maintenance status. Guardrails AI itself is Apache-2.0 licensed. Reviews take legal and engineering time for every validator used.One-time review, recurring when validators changeRecord license, source and last-update date for each validator in the migration map and ask the partner to include this review in scope.
Integration changes in client codeClient applications may call LLM Guard as a library or over its API server. Changing calls, error handling and response formats touches every consuming team.One-time, with recurring cost if clients change againList every caller in the inventory and move them endpoint by endpoint with a shared contract.
Validator upkeep and version pinningGuardrails AI publishes frequent releases, and validators change over time. Pinned versions must be tested before each upgrade.RecurringPin versions in a lockfile and schedule a regular upgrade and retest cycle with an owner.
Retesting after changesModel, prompt, or traffic changes and dependency upgrades can shift detection results, so the attack and benign test sets must be rerun.RecurringKeep the test sets under version control so reruns take less effort.

What usually goes wrong when replacing LLM Guard with validators

Most failed LLM Guard replacements do not fail loudly. They pass a demo, then leak attacks, block legitimate users, or quietly drop a control nobody listed. The six risks below are the ones to plan for before any scanner is switched off.

Missed attacks after cutover

Validators from the Guardrails Hub rarely match LLM Guard scanners one for one, so a detection that worked before can disappear without an error. Attack coverage often narrows when a scanner such as Prompt Injection is replaced by a regex or a generic toxicity check. Run your own attack set against the old and new guards before cutover, and record every attack that only LLM Guard caught.

Guardrails AI repository

False positives from untuned thresholds

LLM Guard thresholds were set for its own models and your traffic at that time. Validators ship with their own defaults, and a threshold copied across tools can block ordinary support questions or code snippets. Tune each validator on a sample of real, anonymized prompts and track the block rate per validator during the parallel run.

Unmaintained or restrictively licensed validators

Guardrails Hub validators are published by different authors, and each carries its own license and maintenance history. A validator under a restrictive license, or one that has not been updated in a long time, can become a compliance problem even when the core Guardrails AI package is Apache-2.0. Check each validator's license file, last commit and open issues before adopting it, and record the result in your inventory.

Guardrails AI releases

Silent loss of log-only scanners

Some LLM Guard scanners only logged findings and never blocked traffic. Those scanners often disappear during migration because nobody treated them as controls, yet security teams may rely on their alerts. Carry every log-only scanner into the new design as an explicit logging rule with an owner, a destination and a review date.

Latency added by chained validators

Guardrails AI validators are chained within a guard, and each additional validator runs on every request. Several model-based checks in sequence can add noticeable delay to each prompt and response, which users notice in chat interfaces. Measure end-to-end latency with the full chain enabled, then reorder or drop validators that add cost without catching anything unique.

Clients still calling the archived API

Applications often keep calling the LLM Guard API server long after a replacement is ready, especially when the endpoint is hard-coded in several services. Once the archived server is retired, those calls fail or fall back to no scanning at all. Inventory every client that calls the API, move them endpoint by endpoint, and confirm with logs that no traffic still reaches the old server before decommissioning it.

Questions buyers ask before moving from LLM Guard to Guardrails AI

How much does it cost to move from LLM Guard to Guardrails AI validators?

No fixed figure applies, because cost follows the scanners in use, not the framework. Guardrails AI itself is Apache-2.0 licensed, so the software carries no license fee, and the spend goes to the work around it. Budget for inventory of current scanners, validator selection and installation, custom validators for scanners with no direct match, tuning on real traffic, and the parallel run. Recurring costs are the infrastructure to host the service and the time to keep validators updated. Ask any partner for a quote built from a written scope that lists each scanner and its replacement path.

How long does a migration from LLM Guard take?

Duration depends on how many input and output scanners are live, how many clients call the API, how thresholds were tuned, and how much attack and benign test data already exists. Scanners that only log can often be retired faster than those that block traffic, because the blocking ones need evidence before cutover. Teams with a current inventory and a labeled test set move faster than teams starting from scratch. Ask for a timeline tied to specific scanners and a defined cutover gate, not a single calendar date.

What does the migration need from our team?

Expect to supply people and data rather than only access. You will need an owner who understands the application flows that call LLM Guard, a security reviewer who can approve which attacks must be blocked, and engineers who can change client code or gateway configuration. Provide the current scanner configuration, model files, thresholds, logs of blocked and allowed traffic, and any internal attack or benign samples. Without those inputs, the team cannot tell whether a validator blocks what LLM Guard blocked.

Can our own engineers do the migration without a partner?

Yes, if the team has Python engineers, someone who can build a test set, and time to run a parallel comparison. The steps are the same whether an internal team or a partner performs them: inventory, map each scanner, install validators from Guardrails Hub, build a custom validator where needed, and compare decisions before cutover. A partner adds the most value where the scanners are numerous, where regulated evidence is needed, or where the team lacks capacity to run the comparison. Ask for a written scope either way so the handover is clear.

Can Guardrails AI validators replace every LLM Guard scanner?

Not necessarily with a one-to-one match. Guardrails AI guards are built from validators published on Guardrails Hub, and some LLM Guard scanners, such as ones tied to specific models or to vault-style restore, may have no published validator with the same behavior. Check each scanner against the hub, then decide whether to use an existing validator, write a custom one, or pair Guardrails AI with another tool. Hub validators differ in maintenance and license, so confirm both before relying on any of them.

Does the Apache-2.0 license of Guardrails AI settle the licensing question?

It settles the license of the core framework only. Guardrails AI is Apache-2.0 licensed, but each validator on Guardrails Hub carries its own license and maintenance status, and some models or dependencies it calls may have separate terms. Inventory every validator and its transitive dependencies, read each license, and record the date of the last update. The LLM Guard buyer's guide covers how the MIT license of LLM Guard and its models applied to the old setup, which helps frame the review.

How does a parallel run prove the replacement blocks at least what LLM Guard did?

Send the same attack and benign prompts through both LLM Guard and the Guardrails AI setup, then compare each decision. Count attacks that LLM Guard blocked and the new setup allowed, which is the critical failure, and count benign prompts blocked by the new setup, which measures false positives. Record latency for both paths. Shadow mode lets production traffic go to LLM Guard while the new path only logs decisions, so the team reviews gaps before any client moves. Cutover should wait until missed attacks are resolved and the security reviewer signs off on the results.

When Guardrails AI validators fit better than NeMo Guardrails

Choose Guardrails AI when your team wants scanning logic expressed as validators chained into existing application code, or wants a standalone REST service that other applications call. Guardrails AI guards are assembled from validators published on Guardrails Hub, installed separately after pip install guardrails-ai, and they can be chained together. That suits a team whose LLM Guard calls already sit in Python request handlers and who want each LLM Guard scanner replaced by a validator with a similar role. The service mode, started with guardrails start and called through the OpenAI SDK, suits organizations where several applications need one shared guard endpoint and the calling code should change as little as possible.

NeMo Guardrails takes a different shape. It configures input, dialog, output, retrieval and execution rails in the Colang language, so policy lives in a rails configuration rather than in application code. It is the more common comparison for teams leaving LLM Guard, and the sibling topic on migrating to NeMo Guardrails covers that path in full. Both projects are Apache-2.0 licensed, so license alone should not decide between them. Either can be the target of your migration. The practical test is where your team wants the policy to be reviewed and changed: by developers in code, or by security and product owners in a shared configuration.

Before committing to validators, confirm each Guardrails Hub validator you need. Check its license, when it was last updated, whether its models are downloaded at runtime, and whether it covers the same detection your inventory marked as blocking. Some LLM Guard scanners may have no validator equivalent, in which case you will need a custom validator or a different tool for that scanner. Record the Guardrails AI release you test against, since v0.11.0 was published on August 14, 2026, and pin the version you approve.

How DeployOpen works on this

DeployOpen approaches this migration as a written, scanner-by-scanner replacement inside infrastructure you control. We start from your existing LLM Guard inventory, map each scanner to a Guardrails AI validator or another maintained option, and prove the replacement blocks at least what LLM Guard blocked before cutover.

How we scope

  • Engagements are fixed-scope, with the scanners, validators, deployment targets and deliverables agreed in writing before work starts.
  • The written scope lists every LLM Guard scanner in use, the validators chosen for each, and which ones are only being logged today.
  • Validator licenses, Guardrails Hub maintenance status and Python version constraints are reviewed and recorded as part of scoping.

How we build

  • Validators are installed and chained in a non-production environment that mirrors your application's calling pattern.
  • Each replacement is tested against your own attack set and benign traffic sample, with missed attacks and false positives recorded.
  • Where Guardrails AI is run as a standalone service, the REST endpoint configuration, authentication and logging are built to your internal standards.

How we hand over

  • Handover includes a scanner-to-validator mapping, configuration files, and the test results comparing each replacement with its LLM Guard predecessor.
  • Runbooks cover validator version pinning, the steps to add or retire a validator, and how to re-run the comparison tests.
  • Documentation records which validators were licensed under which terms and the maintenance status reviewed at the time of handover.

How we support

  • Ongoing support, validator upgrades and continuous testing are available as retainers after handover.
  • Retainer work can cover re-running the attack and benign test sets when Guardrails AI or a validator publishes a new release.
  • Ask us to confirm the support boundaries, response expectations and upgrade cadence in the written quote before engaging.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.