LLM Guard Invisible Text scanner explained

The Invisible Text scanner removes non-printable Unicode, including Private Use Area characters, that can hide instructions in prompts. This page explains what it does, how to configure it, and what to use when LLM Guard is replaced.

On this page

What the LLM Guard Invisible Text scanner does and when you need it

The LLM Guard Invisible Text scanner detects and removes non-printable, invisible Unicode characters, particularly those in the Private Use Areas, to counter steganography-based prompt injection. Hidden characters can carry instructions that a person reviewing the prompt never sees, so the scanner is a input control that runs before text reaches a model. If your application passes user content, retrieved documents or pasted text into an LLM, this scanner addresses a specific risk that sits within the broader prompt injection category in the OWASP Top 10 for LLM Applications.

LLM Guard was built by Protect AI and released under the MIT license, but the project was archived by its owner on 9 July 2026 and its README states that it is no longer under active development or maintained. That matters for this scanner in particular. Unicode handling depends on the scanner code and the libraries under it, and no new fixes will arrive from the upstream project. Any character range the scanner misses, or any encoding trick it does not anticipate, will stay open unless your team patches it. DeployOpen does not recommend new LLM Guard rollouts, so the Invisible Text scanner should be treated as a control to keep running while you plan its replacement, not as a basis for a new design.

Before you decide how long to keep it, confirm three things in your own environment: whether prompts from untrusted sources reach the model through this path, whether your logs show any hidden-character content already, and which Python version your LLM Guard deployment runs on, since the last PyPI release supports Python 3.10 through 3.12. If untrusted input is in scope, plan a replacement control now, including a simple normalization step that strips or flags the same character classes in your own code, and then test it against the characters your current scanner blocks. The replacement work is covered in the migration section of this page.

Scanner options and when each fits

This table compares the main configuration choices for the Invisible Text scanner: where it runs, whether it strips or flags, and how it treats multilingual and emoji-heavy input. Read each row as a decision with its trade-off and the item to confirm in the LLM Guard documentation before you commit.

ChoiceTrade-offWhat to confirm in the LLM Guard docs
Library step in your applicationRuns in the same process as your code, so you control error handling and logging, but every service that calls the model must include the same scanner setup.Which scanner arguments and version your Python environment needs, given the 3.10 to below 3.13 Python range
Behind the API serverOne scanner configuration serves many clients, which makes policy changes central, but it adds a network hop and a server to secure and patch.The API server endpoint for input scanning, its authentication options and how scanner settings are loaded
Strip charactersRemoves hidden Private Use Area and other invisible characters before the model sees them, which closes the hiding channel but changes the text the model receives.Whether stripping removes only the characters the scanner flags and how the sanitized prompt is returned to your code
Flag onlyKeeps the original text intact and reports a finding, so you can log or review it, but a flagged prompt still reaches the model unless your code blocks it.Whether the scanner returns a validity result alongside the sanitized output, and how your application must act on it
Multilingual inputScripts that use private or uncommon code points, and some legitimate symbols, may be affected, so test with real user languages before enforcing.Which Unicode categories the scanner targets and whether any language or script is excluded by default
Emoji-heavy inputSome emoji sequences use joiner and variation selector characters that are invisible on screen, so stripping them can alter intended messages.How the scanner treats zero-width joiners and variation selectors, and whether there is an option to allow them
Scanner as a sole controlInvisible characters are one hiding technique among many, so this scanner alone does not cover prompt injection or jailbreak attempts.Which other input scanners you run alongside it and what your threat model assigns to each

How to set up the Invisible Text scanner in an existing deployment

This sequence adds the Invisible Text input scanner to a running LLM Guard deployment on a supported Python version, and confirms with test prompts that hidden characters are stripped and logged. It is meant for keeping an archived deployment contained while it is replaced, not for new rollouts.

  1. Confirm the Python version range

    Before touching the environment, check that the interpreter the deployment runs on is Python 3.10 or newer and below 3.13, the range the last LLM Guard release on PyPI requires. Your platform or DevOps engineer should run the interpreter version command inside the same virtual environment or container image that serves the API. Done means the reported version falls inside that range. If it does not, pin a compliant interpreter in the image or virtual environment before going further, because the install will not resolve against an unsupported version.

  2. Pin and install the LLM Guard package

    Install the last published release, 0.3.16, which was uploaded on 19 May 2025, into the pinned environment. Record the exact version in your requirements file or lock file so rebuilds do not pull a different build. Run the package show command and confirm the installed version matches the pin. Keep a copy of the lock file in your change record, since the project is archived and a silent dependency change would be hard to explain during an audit.

  3. Add the Invisible Text input scanner

    Import the Invisible Text input scanner in the code path that handles user prompts, and add it to the input scanner list that runs before the prompt reaches the model. Keep the scanner's default settings for the first pass so that the baseline behavior is documented. Where the deployment exposes the API server, add the same scanner to the server's configured input scanners so both entry points behave alike. Done means the scanner appears in the active pipeline configuration and a test request passes through it without raising an error.

  4. Test with prompts containing hidden characters

    Build a small test set of prompts that contain zero-width characters and characters from the Private Use Areas, plus a set of ordinary prompts as a control. Include a few prompts that mix visible text with hidden characters between words, since that is how injected instructions are usually concealed. Send each prompt through the pipeline and record whether the scanner removed the characters and what text reached the model. The check passes when the hidden characters are gone from the sanitized output and the control prompts are unchanged. Store the test set in version control so it can be rerun after any change.

  5. Confirm logging of stripped and blocked input

    Run the test set again with logging turned on and confirm that each sanitized or blocked prompt produces a log entry with the scanner name, the decision and a timestamp. Check that the log records the outcome without writing the raw hidden characters or sensitive prompt content in clear text beyond what your data handling policy allows. Ship the entries to the log store your security team already monitors and confirm they appear there. Done means an analyst can find an entry for each test case and trace it to the scanner decision.

  6. Record the baseline and limits

    Write down the scanner version, the configuration used, the test results and the known limits in the deployment record. The Invisible Text scanner targets invisible Unicode, so it does not judge visible instructions, and that gap needs a separate control such as the Prompt Injection scanner or a maintained guardrail. Ask your security team to confirm the record matches what they will review. The sequence is complete when the record is filed and the test set passes on the current build.

Where the Invisible Text scanner sits in the request flow

The flow starts with the user prompt arriving at the application, which passes it to the LLM Guard input scanners, where the Invisible Text scanner runs alongside the others. Clean text then crosses the trust boundary to the model provider, and the model's reply returns through the output scanners before reaching the user. Check that the input scanners run before any model call, so hidden characters are stripped before the model sees them, and that every reply passes the output path.

Invisible Text runs in the input path, before the prompt crosses to the model.

Security risks of relying on this scanner alone

The Invisible Text scanner removes one class of hidden characters from input. It does not stop prompt injection on its own, and the risks below are the ones a team should check before treating it as a control. Each one points to a separate control that has to exist alongside it.

One input control, not a full defense

The scanner only removes invisible characters from text it receives. Injection written in ordinary visible language passes through untouched, and so does any instruction that is hidden in a way the scanner does not cover. The OWASP LLM01 Prompt Injection entry treats injection as a class of attack that needs layered controls, including constraints on model behavior, output checks and privilege limits. Ask your team to name which layers exist besides this scanner, and test a set of plain-language injections against the full pipeline.

OWASP LLM Top 10 2026

Stripping can change legitimate meaning

Removing non-printable characters is not always neutral. Some scripts, emoji sequences and text pasted from word processors depend on joiners or directional marks to render correctly, and removing them can alter names, search terms or code snippets. Hidden characters can also appear in legitimate content, so a user's query may be silently changed. Before enabling the scanner on production traffic, test representative multilingual input and decide whether the scanner blocks the prompt, strips the characters or only logs the finding.

Logs may hold sensitive prompts

Prompts pass through the scanner and often reach application logs, tracing tools and error reports. If a prompt contains personal data, credentials or internal documents, those values can be stored in places with weaker access controls than the model itself. Check what is written when the scanner flags or changes input, how long those records are kept, and who can read them. Limit what the scanner logs to finding types and counts where possible.

Invisible Text docs

Archived project receives no fixes

The LLM Guard repository was archived by its owner on 9 July 2026, and its README states that the project is no longer under active development or maintained. Any bypass technique discovered after that date will not produce a patched scanner, and the last PyPI release, 0.3.16, dates from 19 May 2025. Treat the scanner as a fixed snapshot in your risk register, record the version in use, and plan a replacement guardrail rather than waiting for upstream changes.

Indirect injection needs separate controls

Most damaging injections arrive through documents, web pages, emails, tool outputs and memory rather than the user's own prompt. The scanner only sees what is passed to it, so content retrieved by a tool or read from a file may bypass it entirely. The OWASP Top 10 for Agentic Applications describes agent goal hijack and tool misuse, which require limits on what an agent can do with tool results, not only input filtering. Confirm which data sources feed the model, which tools it can call, and which of those actions need a human approval step.

Agentic Top 10 2026

Simple replacements for the Invisible Text scanner

The simplest replacement for the Invisible Text scanner is a small normalization step that your own team owns and tests. Before a prompt reaches the model, the step removes or flags code points in the Unicode control, format and Private Use Area categories, which are the ranges used to carry hidden instructions. Because the logic is a short function that runs in your application or gateway, it has no model to load, no Python ceiling to track and no dependency on the archived package. The main cost is one-time: someone must choose which categories to block, decide whether to strip or reject, and write the tests. Ongoing cost is mostly review, since Unicode assignments change and the rule set needs to be revisited when your input sources change.

The replacement must be proven against the same sample set you used to evaluate LLM Guard, not assumed to match it. Run every sample that LLM Guard flagged through the new step and record which ones are still caught, which ones pass and why. Add samples that cover the categories you chose, plus mixed-script and ordinary multilingual text, so you can see false positives on legitimate input. Exact character coverage is something to confirm by testing in your own environment, not something to infer from the category names. Ask your team to document the Unicode version and library they relied on, because the set of assigned code points differs between versions and a rule that passes today may need retesting after a runtime upgrade.

A normalization step covers only one class of hidden content, so pair it with a maintained guardrail for broader input checks. NeMo Guardrails is the option to evaluate first because it is maintained and supports programmable input rails that can sit alongside your own function. Treat the pairing as a layered design: the in-house step handles invisible characters deterministically, while the guardrail handles instructions in visible text, such as the injection patterns that the LLM Guard Prompt Injection scanner covered. Confirm the guardrail's current features and supported integration points with its project documentation before you commit, and keep both layers under the same test set so a regression in either one shows up in one place.

Limits to confirm in your environment

The Invisible Text scanner is simple, but its behavior depends on the exact release, the Python runtime and the text your users send. Treat each question below as a test to run against your own prompts before the scanner is relied on as a control.

Which character ranges does your version strip?

Ask which Unicode categories and code point ranges the installed release removes, and whether Private Use Area characters are covered in full. Read the scanner source for the version you run, then build a test set of zero-width, bidirectional control and Private Use Area characters. Record which ones pass through unchanged, because those are the gaps an attacker can use.

Last PyPI release
0.3.16
Scanner docs

Does legitimate multilingual text get altered?

Some scripts, emoji sequences and typography use joiners, marks or other characters that sit near the ranges a scanner removes. Test representative text in every language your users write, including right-to-left scripts, emoji with skin tone or zero-width joiner sequences, and copied text from office tools. Measure how often a prompt is rejected or silently changed when a user did nothing wrong.

How the scanner behaves on your Python version

The last release supports Python 3.10 or newer but below 3.13, so a runtime outside that range is a deployment decision, not a configuration detail. Confirm which interpreter your container image or service uses, install the pinned package in a clean environment, and run the full test set there. Document the result so a later interpreter upgrade triggers a retest.

Is stripping applied before or after tokenization?

Confirm where in the pipeline the scanner runs relative to the model tokenizer, and whether it sees the same string the model sees after any preprocessing. If a template, retrieval step or Unicode normalization runs later, hidden characters may reappear or change meaning. Trace one hidden payload from user input through every transformation to the model call.

Does sanitized text still reach the model?

Check whether the scanner returns the cleaned prompt or only a pass or fail verdict, and whether your application uses the cleaned value. A scanner that flags text but leaves the original in the request does not protect the model. Verify that the downstream call receives the output the scanner produced, and log both the original and cleaned lengths for review.

Does it stop the attack you care about?

Invisible characters are one way to hide instructions, not the only one. Test visible injection text, encoded payloads and instructions carried in retrieved documents or tool results, since those do not depend on hidden characters. Compare results with the rest of your input controls so you know which attacks this scanner does not address.

Questions teams ask before replacing the Invisible Text scanner

What drives the cost of replacing the Invisible Text scanner?

The main driver is how many places call the scanner and how much of the surrounding pipeline depends on its exact behavior. The scanner itself is a small text-cleaning step, so the work is mostly in finding every input path, deciding what the replacement must strip or flag, and proving that nothing downstream breaks. Costs fall into four parts: discovery of where prompts enter the application, design of the replacement rule set, test runs against sample traffic, and rollout with monitoring. Ask any provider for a quote that separates these parts and states who runs the test harness after handover. Most of the cost is one-time, while ongoing rule updates and log review recur.

How long does a test run take for an invisible text replacement?

Duration depends on prompt volume, the number of integrations and how many of them accept content from outside your organization. A single application with one prompt path and a modest sample set can be tested quickly, while several applications that share a gateway, use different languages or accept files and retrieved documents need more runs and more review time. Plan for at least one run against captured production-like traffic and one run against adversarial samples that use Private Use Area characters and zero-width characters. Ask the provider to state the test matrix and the exit criteria in the written scope before work starts.

What must our team provide before a replacement starts?

The work goes faster when your team supplies three things early. First, sample prompts and inputs from each entry point, including user chat, API calls, uploaded documents and retrieved content, with consent and data handling agreed for any personal data. Second, logs from the current LLM Guard deployment showing which inputs the Invisible Text scanner flagged or altered, so the replacement can be checked against real behavior. Third, named owners for each application, for security review sign-off and for on-call response when a rule blocks legitimate content. Without owners, test results tend to stall at the approval step.

Can our internal team replace the Invisible Text scanner without a partner?

Yes, a team with application security and platform skills can do this internally, provided it has time to test and the authority to change prompt handling. The replacement is a normalization step, not a model deployment, so the technical effort is modest compared with replacing the model-based scanners. The harder part is evidence: someone must show that the new control blocks at least what the old scanner blocked, document the rules, and keep them current as attack techniques change. If your team lacks security test experience or cannot dedicate people to this across the test cycle, a fixed-scope engagement can cover the testing and evidence work while your engineers keep ownership of the application.

Does the Invisible Text scanner alone meet a compliance review?

No. A scanner that removes invisible characters is one control among several, and it does not on its own establish compliance with any framework. Reviewers usually want to see how the control maps to risks such as prompt injection under LLM01 in the OWASP Top 10 for LLM Applications, how it is tested, who approves changes and how events are logged. Independent auditors and certification bodies make the assessment decision. DeployOpen prepares the systems, controls and evidence for that review, but it does not issue audit reports or certifications. Ask your assessor early which evidence they expect for guardrails in general.

Which attacks does an invisible text replacement not stop?

Stripping invisible characters addresses one hiding technique. It does not detect visible instructions written in ordinary language, encoded payloads that a model decodes, or indirect injection carried in documents, web pages and tool output. Those risks need separate controls such as input classification, tool permission limits and output checks. The OWASP Top 10 for Agentic Applications lists Agent Goal Hijack as ASI01, which shows why a single character filter is insufficient for agents. Your test plan should include these cases and record which ones the replacement does not cover, so the residual risk is explicit for the owner.

Should we keep the Invisible Text scanner running while we replace it?

Usually yes, until the replacement has passed its test cycle and has been monitored in a controlled rollout. Running both in parallel lets you compare what each one flags and reveals false positives before users see them. Record the differences, decide which behavior is correct for each application, and only then switch the enforcement point. Keep in mind that LLM Guard is archived and its dependencies will age, so the parallel period should be planned rather than open ended. Include the decommission date in the written plan.

Primary sources for the Invisible Text scanner

Start with the LLM Guard Invisible Text documentation, which describes what the scanner detects and removes: non-printable, invisible Unicode characters, particularly in the Private Use Areas, used to smuggle instructions past reviewers and filters. Read it against your own deployment, not as a general guide. Confirm the scanner's configuration options, default behavior and how it reports removed characters in the version you run, since the project is archived and its documentation will not change to match later releases. Record the exact LLM Guard version and Python environment next to your notes, because the last PyPI release is 0.3.16 and that is the build you are auditing.

The second read is the OWASP GenAI LLM Top 10 2026, which places hidden-text tricks in context. Look first at LLM01 Prompt Injection, then at LLM08 Hidden Context Exposure, which is new in the 2026 edition and sits alongside the other risks your application handles. Use the list to decide whether a character-level control is enough for your threat model or whether you also need controls on tool permissions and output handling. Map each risk to the controls you already run so the Invisible Text scanner is one documented layer among several, not the answer to prompt injection on its own.

Keep the mapping as evidence for your security review. Ask your security team which framework version your assessors expect, and confirm whether they want references to the OWASP 2025 edition, which ranked LLM07 System Prompt Leakage differently, or the 2026 numbering used here. Any replacement you adopt should be checked against the same list, so the record shows which risks each control addresses and which remain open.

How DeployOpen scopes and delivers Invisible Text scanner work

DeployOpen approaches Invisible Text scanner work as a fixed-scope engagement that starts with the LLM Guard deployment you already run. We confirm where the scanner sits in your request path, what it blocks and what it should keep blocking, then plan the replacement or containment work in writing before anything changes.

How we scope

  • Inventory where the Invisible Text scanner runs, which applications call it and which input paths it covers.
  • Record the stripping behavior you depend on, including which character ranges are removed and what happens to flagged prompts.
  • Agree the written scope, deliverables and timeline with you before work starts, with no prices in the scope document.
  • Confirm whether the scanner is used alone or alongside Prompt Injection and other input scanners in the same pipeline.

How we build

  • Build a replacement or containment layer that normalizes or removes invisible and Private Use Area characters before prompts reach the model.
  • Test the new control against sample prompts that hide instructions in non-printable Unicode and in Private Use Area characters.
  • Compare results with the existing scanner on the same inputs so behavior differences are documented, not assumed.
  • Keep the build inside your infrastructure, with configuration held in your own version control and deployment tooling.

How we hand over

  • Deliver written documentation covering the scanner logic, configuration keys, test cases and known gaps.
  • Provide a test set and run record showing which invisible-character inputs were blocked or cleaned, and which were not.
  • Walk your engineers through operation, logging and how to add character ranges or rules later.
  • Document how the change fits your OWASP LLM01 Prompt Injection controls and what your assessors should review.

How we support

  • Support is available as a retainer for monitoring, updates to character rules and retesting after application changes.
  • Ask for a clear list of what stays in your team's hands after handover and what a retainer would cover.
  • Confirm with us how changes to the scanner, the application or your threat model trigger a retest.
  • Plan a retest whenever the input pipeline changes, so the control keeps covering the same prompt paths.

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.