What the LLM Guard Prompt Injection scanner does and when you still meet it
If your team already runs LLM Guard in front of a model, the Prompt Injection input scanner is the control that inspects user-supplied text for attempts to override the model's instructions before the prompt reaches the model. It is one of the 15 input scanners LLM Guard documents, and it works alongside the others rather than replacing them. LLM Guard was archived by its owner on 9 July 2026, and its README states that the project and its associated Hugging Face models are no longer under active development or maintained. DeployOpen recommends no new LLM Guard rollouts, so this section supports existing deployments and planning for their replacement.
LLM Guard can run in two modes. It can be installed as a Python library with pip and called from application code, or deployed as an API server that services call before forwarding prompts to a model. The mode determines who owns the model load, the Python runtime and how the scanner scales. The last PyPI release, 0.3.16, was uploaded on 19 May 2025 and requires Python 3.10 or newer but below 3.13 (see llm-guard on PyPI). Confirm the interpreter version in every environment, including build images and API server containers, before you change any platform component.
Map where the Prompt Injection scanner sits in your request path, which other input scanners run before or after it, and which downstream steps rely on its verdict. Review logged blocks to learn which injection patterns it has already caught. Because the project is archived, expect no upstream updates for new injection techniques. The OWASP Top 10 for LLM Applications 2026 lists LLM01 Prompt Injection first, and MITRE ATLAS tracks indirect prompt injection as AML.T0051.001, so treat the scanner's coverage as a dated baseline. Agree on replacement criteria with security and platform owners now, while the deployment is still stable.
How the scanner separates direct and indirect injection
Prompt injection reaches a model through two different paths, and the scanner's job is the same on both: examine text before it reaches the model. The cards below describe how each path arrives, what the documentation says about classification, and what to confirm against your pinned version before you rely on the scanner for either path.
Direct injection from the user's input
Direct injection is text the user types into the prompt field, such as an instruction to ignore earlier rules or reveal the system prompt. It reaches the model in the same message that carries the user's request, so the scanner receives it as ordinary input text. Check that your application passes the full user message to the scanner unchanged, including any text the front end has reformatted.
LLM Guard documentationIndirect injection from retrieved content
Indirect injection hides instructions inside material the application pulls in, such as a retrieved document, a web page or the output of a tool call. The user never typed it, so a check on the user message alone misses it. Confirm which content sources your pipeline sends to the model and whether each one passes through a scanner call.
Tool output as an injection path
Tool and API responses can carry instructions that a model may follow as if they came from the user or developer. This path grows with agents, because each tool result becomes new model input during a single task. Map every tool whose output returns to the model and decide where scanning happens for each one.
Where the scanner sits in the request path
The scanner only classifies the text it is handed, so placement decides coverage. An input scanner placed before the model sees the user message, while retrieved or tool text needs its own call before it is added to the prompt. Document the call order in your application so reviewers can confirm each input source is covered.
Confirm the classification behavior
The exact labels, model inputs and decision rules depend on the LLM Guard version and the model files you pinned. Read the scanner documentation for your version and test a sample set of direct and indirect payloads against it. Record the results so you can compare them later if you replace the scanner.
LLM Guard on PyPIHow the DeBERTa classifier and thresholds produce a verdict
The Prompt Injection scanner passes each prompt through a DeBERTa-based text classifier trained to separate injection attempts from ordinary text. The classifier does not follow the prompt's instructions. It returns a score for how likely the input is an injection, and the scanner compares that score with a configured threshold. If the score crosses the threshold, the scanner reports the prompt as failing the check and the application should block or route it. Before you rely on this, confirm in the LLM Guard documentation the exact model identifier the scanner downloads, the default threshold, and whether a higher score means higher risk in your installed version. Record these values from your deployment, not from memory, because the project is archived and the pinned release is the behavior you will operate.
The threshold is where security and product requirements trade off. A lower threshold flags more text, which catches more attacks but also blocks benign prompts, such as a support question about how prompt injection works or a pasted email that contains instructions. A higher threshold reduces false positives but lets more injections through. The score is a model output, and you should not read it as a calibrated probability unless the documentation says so. The same number can mean different things on a different mix of traffic, so a default or a value copied from a demo will not carry over to your users unchanged. Build a labeled set from your own traffic, with benign prompts (including security training and developer content) and attack prompts drawn from your threat model. Run it at several thresholds and record both false positives and missed attacks for each setting.
Treat the threshold as a setting under change control. Store the model identifier, scanner version, threshold and labeled evaluation results together, so any later change can be compared with a known baseline. Because LLM Guard is archived, the model will not receive updates for new injection techniques, so threshold tuning can manage current drift but does not replace a maintained control. Expect a replacement guardrail to produce different scores, which means the threshold tuned here will not transfer and must be re-evaluated against the same labeled set. Ask your team to confirm which test results are required before a threshold change goes live, and who approves the false positive rate that users will experience.
Match modes, thresholds and settings to review
This table lists the configuration choices for the Prompt Injection scanner, from match mode and threshold to model selection, long-input handling and the action taken on a flagged prompt. Read each row as a decision to make and record for your pinned version. Option names and defaults must be checked against the LLM Guard documentation for version 0.3.16, the last PyPI release.
| Setting | What it controls | When it fits |
|---|---|---|
| Match mode | Whether the scanner checks the whole prompt or splits it into chunks before classifying | Use the mode that matches how your application builds prompts; confirm the exact option names in the 0.3.16 documentation |
| Threshold | The score above which a prompt is flagged as injection | Lower values catch more attacks but raise false positives; tune against a labeled set of your own prompts |
| Model selection | Which classifier model the scanner loads, and whether the default DeBERTa model is pinned | Pin the exact model revision in config; check the archived Hugging Face model status before relying on it |
| Long input handling | How prompts beyond the model's context length are truncated, chunked or skipped | Decide whether an attack hidden late in a long document must still be caught, then test that case directly |
| Action on flag | Whether the request is blocked, sanitized, logged only or sent for review | Block for user-facing inputs with tool access; log-only fits a shadow period while you measure false positives |
| Fail behavior | What happens if the model fails to load or the scanner errors | Fail closed for high-risk applications so an error does not pass unscanned prompts |
| Logging and retention | What scan scores and prompt fragments are written to logs | Record scores and rule IDs; limit stored prompt text because prompts often contain personal or confidential data |
Setting up the scanner in an existing deployment
This sequence enables or audits the Prompt Injection scanner in a pinned environment and produces a recorded set of verdicts and thresholds that your team can review. It is written for deployments that already run LLM Guard and need to confirm the scanner behaves as expected before anyone relies on it.
Confirm the Python version
The platform engineer checks the runtime that hosts LLM Guard and confirms it is Python 3.10 or newer and below 3.13, the range stated for the last PyPI release, 0.3.16, uploaded on 19 May 2025. Run the interpreter version command inside the same image or virtual environment that serves traffic, not on a developer workstation. The step is done when the recorded interpreter version matches that range in every environment that will run the scanner.
Pin the package and its dependencies
The engineer records the exact llm-guard version installed, including transitive dependencies, in a lock file or requirements file kept under version control. Confirm the version against the project page on PyPI before pinning. The check is a clean build from the lock file that installs the same versions in staging and production, with a diff showing no unplanned upgrades.
Load the model from a controlled artifact store
Download the Prompt Injection model from Hugging Face once, store it in your own artifact repository or object storage, and configure the deployment to load it from that location. Record the model identifier, revision hash and file checksums. Because the project and its models are no longer maintained, confirm that you hold a copy you can restore if the upstream source changes or disappears. The check is a load test that reproduces the recorded checksums on a fresh host.
Build a labeled set of direct and indirect attacks
The security engineer assembles a test set with labeled examples of direct injection, where the user prompt tries to override instructions, and indirect injection, where the attack sits in retrieved documents, web pages or tool output. Include benign prompts that look similar, so false positives are measured too. Keep the set in version control with its labels and source notes. The set is ready when each category has examples reviewed by a second person.
Run the scanner against the labeled set
Run every example through the scanner in the pinned environment with the match mode and threshold you intend to use in production. Capture the score, the verdict and the expected label for each item in a results file. Note the ones that are missed or wrongly flagged. The check is that every example produces a recorded result, with no run skipped or edited after the fact.
Set thresholds from the results
Review the results to choose a threshold that balances missed attacks against blocked legitimate prompts for your application. Record the chosen threshold, the match mode and the reason for each choice. Treat the result as applying only to the test set, since the scanner's blind spots remain and attackers can rephrase. The check is a second reviewer who can trace each threshold back to specific rows in the results file.
Record the verdicts and the configuration
Store the package version, model checksum, configuration, labeled set version, results and approved thresholds together as one evidence bundle, with the approver and date. Link the bundle to the change record for the deployment. The step is done when someone outside the project can reproduce a verdict from the bundle, and when the bundle is reviewed again on any upgrade or model change.
Where the scanner sits in the request path
The flow starts with user input and content retrieved for the prompt, both of which pass through the application before reaching the LLM Guard scanner service. Flagged items are blocked or logged at the scanner, clean prompts continue to the model, and the model's response returns to the application for the output scanners. The trust boundary sits between the application and the scanner, so check what data crosses it, which logs keep the scanned text, and how the service fails when it cannot respond.
Input and output scanning around a model call, with the trust boundary marked.
Where the scanner misses attacks
A prompt injection classifier judges the text it receives, in the form it receives it. The cards below describe where that narrow view breaks down, so teams can test each gap against their own deployment rather than assume the scanner covers it. They map to the OWASP LLM01 Prompt Injection entry, which describes direct and indirect injection as a risk to design around, not a problem one filter solves.
Phrasing outside the training data
The Prompt Injection scanner classifies input against patterns its model learned during training. Attacks written in an unusual style, with new wording, role-play framing or indirect requests for the same action, may score below the threshold. Build a test set of paraphrased injections drawn from your own use cases, run it through the scanner at your chosen threshold, and record which variants pass.
Multilingual and encoded payloads
An instruction written in another language, or wrapped in Base64, hex, ROT13 or character substitutions, may not look like an injection to a classifier trained mainly on the phrasing it expects. Whether the model you serve decodes or follows the payload is a separate question. Test each language your users write in, and each encoding your application might pass through, before you rely on the scanner for that traffic.
Instructions split across chunks
When long documents are chunked for retrieval or streaming, an injection can be split so that no single chunk contains a complete instruction. If each chunk is scanned alone, the scanner sees harmless fragments. Confirm how your pipeline chunks input, whether the scanner sees the assembled prompt, and whether retrieved passages are scanned before they are joined into context.
Attacks that act through tools
An injection can succeed without producing any suspicious text: the model is steered into calling a search, email or file tool with attacker-chosen arguments. The OWASP LLM01 guidance treats this as an excessive agency problem as well as an input problem. A text scanner does not inspect tool calls, so test each tool's permissions, arguments and approval steps separately from the scanner results.
Content that never reaches the scanner
The scanner only protects paths routed through it. Documents loaded by a retrieval index, tool outputs, uploaded files, webhook payloads and conversation history loaded from storage may bypass the input scanner entirely. Map every route into the model, compare it with the calls to the scanner, and treat any unscanned route as an open test case for indirect injection.
Questions teams ask before replacing or hardening the scanner
How much does it cost to replace the LLM Guard Prompt Injection scanner?
No public figure exists for this work, and DeployOpen does not publish a price list, so the cost comes from a written scope. The main cost drivers are the number of deployments that call the scanner, the size and quality of your prompt-injection test corpus, how many other scanners are replaced alongside it, and how much retesting is required after each change. Ask any partner, including DeployOpen, to price these items separately: discovery of current usage, the replacement build, the regression test suite, the retest, and any recurring support. The replacement work is one-time, while monitoring, model updates and retesting recur for as long as the guardrail runs.
How long does a prompt injection scanner replacement take?
Duration depends on scope, so no fixed timeline applies here. The work typically follows the order of inventory, baseline testing, parallel run, cutover and decommission. Inventory time grows with the number of applications, API clients and pipelines that call the scanner. Baseline testing depends on how large your corpus of direct and indirect injection samples is. Parallel running needs enough traffic to produce meaningful comparisons, which can take longer than the build itself. Confirm the milestones and their acceptance criteria in writing before work starts.
What does our team need to provide before an engagement starts?
A partner needs access and context more than new tooling. Expect to provide a list of every application and API path that calls the LLM Guard API server or library, the scanner configuration in use, the Python and model-loading environment, logs of blocked and allowed prompts where you can share them, and a named owner who can approve the acceptance criteria. Security or compliance reviewers should also state which injection categories they consider in scope, mapped to the OWASP LLM01 Prompt Injection entry where that helps. Hosting and secrets access must stay inside infrastructure you control.
Can our own engineers replace the scanner without a partner?
Yes, if your team has the skills and capacity to run the work, and many do. The task needs engineers who can read the Python integration code, stand up a maintained guardrail, build a test corpus, and run a parallel comparison without weakening controls. The harder part is usually proof, not coding: showing the replacement blocks at least what the old scanner blocked. Teams that lack an adversarial testing background often find that a partner's testing and retest cycle covers the gap. Decide early which parts stay in-house, such as ownership and sign-off, and which are contracted.
What is the difference between match modes and thresholds in the Prompt Injection scanner?
Match mode decides how the scanner splits and evaluates text, while the threshold decides how confident the classifier must be before it flags the input. Tuning one without the other changes results in ways that are hard to predict. Engineers should record the chosen mode and threshold for every deployment, test both against the same corpus, and document the false positive and false negative counts that result. Any change to these settings should be treated as a configuration change that passes the regression suite before reaching production.
What does the scanner miss, and how do we harden around those gaps?
A classifier-based scanner cannot reliably catch every injection, especially indirect injection hidden in retrieved documents, tool outputs, or encoded text, and attackers adapt their phrasing. Hardening means layering controls: strip or flag invisible characters, restrict what tools and data the model can reach, apply least privilege to agents, and validate outputs before any action. The MITRE ATLAS entry for indirect prompt injection (AML.T0051.001) and the OWASP agentic risk ASI01 Agent Goal Hijack are useful references for mapping these gaps. Treat the scanner as one control among several, not as the boundary.
Do we need to retest after the scanner is replaced?
Yes. A replacement changes what gets blocked, so the regression suite and a fresh injection test should run against the new guardrail before cutover and again after any model or configuration update. Ask for test results that include both blocked-attack rates and false positives on normal traffic. Retesting recurs as long as the guardrail is in use, so include it in any ongoing support plan. For detail on sequencing, read the LLM Guard migrations notes alongside the running-deployments guidance, and check the current LLM Guard documentation for the configuration your version uses.
How DeployOpen approaches this work
DeployOpen supports existing LLM Guard deployments under a fixed scope agreed in writing before work starts, and that written scope sets the deliverables. For a team running the Prompt Injection scanner, the usual starting point is an inventory: which applications call the scanner, whether it runs as a Python library or behind the API server, which input and output scanners sit alongside it, and which model versions are loaded. We then test how the current setup behaves against direct and indirect injection, including payloads hidden in retrieved documents, web pages and tool results. The output is a findings report that separates what the scanner catches from what it misses, so the client can see the gaps before deciding anything else.
The second part of the engagement covers the move to maintained guardrails. Because the LLM Guard repository was archived on 9 July 2026 and its models are no longer maintained, DeployOpen helps plan replacement of the Prompt Injection control with a maintained option such as NeMo Guardrails, which we would confirm against the current toolkit documentation for the rails and classifiers in use. Replacement is tested the same way as the original control: the same attack set is run against the old and new configurations, and the client confirms that the replacement blocks at least what the scanner blocked. Fixes are applied where agreed, and a retest closes each finding. Ask any provider to state which deliverables, retest rounds and handover materials are included in the written scope.

