LLM Guard Secrets scanner explained

The LLM Guard Secrets scanner uses detect-secrets to redact tokens, private keys and high-entropy strings from prompts. This page explains how it works, how to configure it, and what to plan now that the project is archived.

On this page

What the LLM Guard Secrets scanner does before a prompt reaches a model

The LLM Guard Secrets scanner is an input scanner that looks for credentials inside user prompts and redacts them before the prompt is sent to a model. It targets API tokens, private keys and high-entropy strings, which are the values most likely to be pasted into a chat by accident, such as a configuration snippet, a stack trace or a debugging log. Teams need it when their LLM Guard deployment forwards raw user text to a model provider and the users, or the applications calling the model, may carry credentials that should never leave the organization. The scanner is part of the 15 input scanners LLM Guard documents, and it runs in the same pipeline as the other input checks. Note that the LLM Guard documentation describes the scanner and its settings, and that the project was archived on 9 July 2026, so DeployOpen does not recommend new LLM Guard rollouts that depend on it.

Because the scanner works on text patterns and entropy rather than on a model's understanding of the context, its results depend on what the detection rules recognize. Confirm which secret types your deployment's detection library covers, and test the scanner against samples of your own credentials, including internal token formats that no public rule will match. Also confirm what happens to the redacted value after the scan, since a redacted prompt can still be logged by the API server, a proxy or the application. Ask your team to list every place where prompt text is written, from request logs to tracing tools, so the scanner is not the only control between a secret and a third-party model.

For an existing deployment, the Secrets scanner is one of the controls to preserve while the deployment is contained and planned for replacement. Record its current configuration, including the enabled options and any custom detection settings, so a maintained replacement can be checked against the same inputs. Do not treat it as the only protection for credentials. Pair it with rotation of any token that has appeared in a prompt, restricted credentials for model access, and secret scanning on the sources that feed prompts. Confirm with your security team which secret types must be blocked outright and which may be redacted, because that decision drives both the scanner settings and the test cases used to prove the replacement works.

Configuration options and when each one fits

This table compares the main Secrets scanner choices: which detect-secrets plugins run, how custom configuration is maintained, what happens on a match, and whether high-entropy strings are flagged. Read each row for its trade-off in false positives, missed credentials and operator effort. Settings marked to confirm should be checked against the LLM Guard documentation for your installed version before you rely on them.

OptionTrade-offOperator effortWhen it fits
Default detect-secrets pluginsBroad coverage of common token and key formats, but more matches on ordinary text and more false positives to review.Low to set up, but outputs need periodic sampling for over-redaction.Early pilots that need a baseline and can tolerate some over-redaction.
Custom plugin selectionFewer false positives when only matching detectors run. Any credential format left out goes undetected.Medium. You must inventory credential types and test each enabled plugin.Stable environments where credential types are known and documented.
Custom detect-secrets configurationReviewed findings can be excluded so they stop recurring. Broad exclusions can hide real credentials.Medium to high. Exclusion files need an owner and regular review.Teams with recurring false positives from internal identifiers. Confirm how your version loads it.
Redaction of matched valuesThe prompt continues with the value replaced, so the model still sees the request. A missed credential still reaches the model.Low. Confirm the replacement text and the redact mode setting names in the documentation.Workflows where the request still makes sense without the secret value.
Blocking the whole promptAny match stops the request, so false positives cost user requests. Nothing from the prompt reaches the model.Low to medium. Users need a clear rejection message and a retry path.Hard-control paths where a refused request is preferable to exposing a secret.
High-entropy string detection onCatches unknown token formats, but also flags hashes, random IDs and encoded data, raising false positives.Medium to high. Expect sample review and threshold tuning.Environments with unknown or custom token formats and capacity for review.
High-entropy string detection offFewer false positives on IDs, hashes and logs. Tokens in unrecognized formats can be missed.Low, but depends on plugin coverage for every credential format in use.Prompts that carry many identifiers, such as logs, traces or code.

Custom detect-secrets configuration by deployment situation

Teams that issue their own tokens with a known prefix and length can make detection precise. Custom plugins are where those formats are encoded, and the baseline file records which built-in detectors stay enabled. Illustrative example: a service issues tokens that start with a fixed prefix followed by a fixed-length alphanumeric string, and the custom pattern should describe exactly that shape.

  • Custom regex plugin: Encode each internal prefix and length in a custom plugin so the match reflects the format your services issue, and avoid patterns copied from other vendors without checking them against your own tokens.
  • Keep the built-in detectors: Internal formats rarely cover every secret type, so keep keyword and private key detection enabled unless testing shows a clear reason to remove them.
  • High-entropy detector decision: Random internal tokens often trigger entropy checks, so decide deliberately whether this detector stays on for this format set and document the decision.
  • Baseline review: Commit the .secrets.baseline file to version control and review every change, so each accepted finding is a deliberate decision rather than an accident of scanning.

Test with tokens issued by each internal service, plus near-miss strings that share the prefix but differ in length, and confirm that every real format is caught while ordinary identifiers pass.

Setting up and verifying the Secrets scanner in an existing deployment

This sequence enables the Secrets scanner in a library install or API server, pins a supported Python version, and confirms that secrets are redacted before a prompt leaves your boundary and never reach logs in raw form.

  1. Confirm the runtime and pin Python

    Confirm that the LLM Guard host runs Python 3.10 or newer and below 3.13, the range that release 0.3.16 requires according to its PyPI listing. Pin that interpreter in your virtual environment or container image so that a host upgrade cannot move the deployment out of range. Done means the interpreter version is recorded in your configuration management and a fresh environment installs without resolver errors. Because the project is archived, also record the exact package version and its hash so you can rebuild the same environment later.

  2. Install the pinned package and dependencies

    Install llm-guard at the pinned version in a clean environment, either as a Python library with pip or as the package used by your API server image. Keep the detect-secrets dependency version recorded alongside it, since the Secrets scanner delegates detection to that library. Confirm the install by importing the scanner module in a short script and listing the available scanners. Done means the import succeeds and the scanner class loads without warnings about missing models or packages.

  3. Enable the Secrets scanner in the input pipeline

    Add the Secrets scanner to the input scanner list in the code path or API server configuration that handles prompts before they go to a model. Set its behavior to redact detected values rather than only flag them, so the model receives a placeholder instead of the credential. Keep the scanner order explicit, and place it ahead of any step that forwards prompts to an external provider or logs the request body. Done means the configuration file or code diff is reviewed and the scanner appears in the active chain at startup.

  4. Load a custom detect-secrets configuration if needed

    If your organization uses internal token formats, add or adjust detect-secrets plugins and filters in a version-controlled configuration file, and reference that file from the scanner setup. Review any allowlist entries with the security owner, because each exclusion removes detection for that pattern. Done means the configuration loads in the test environment and the team can name every custom plugin and every allowlist entry with its owner.

  5. Test with synthetic credentials in a non-production environment

    Build a test set of synthetic credentials that match the formats you care about, such as an example API token, a private key header, and a random high-entropy string, all generated for testing and never copied from live systems. Send each one through the scanner and record whether it is detected and what the output looks like. Illustratively, a test prompt containing a fake key should return the same prompt with a placeholder where the key was. Done means every synthetic case has a recorded result, and any miss is logged as a finding with an owner before go-live.

  6. Verify redaction happens before data leaves the boundary

    Capture the exact payload your application sends to the model provider or local model endpoint during the test run, using a network capture or a proxy in the test environment. Search that captured payload for each synthetic credential. Done means no synthetic secret appears in outbound traffic, and the team has saved the capture and the search result as evidence. Repeat this check after any change to the scanner order or the provider client library.

  7. Confirm logs do not store raw secrets

    Check every place the prompt may be written, including application logs, API server access logs, tracing or observability tools, and any stored request history. Search those stores for the synthetic credentials after a test run. If a raw value appears, change the logging configuration to record the scanned output rather than the original input, and rerun the test. Done means no raw synthetic secret is found in any log or trace store, and the logging settings are committed to configuration management. Ask your platform team to confirm retention periods for these stores, since those are set in your environment rather than by LLM Guard.

Security and operational risks of relying on the Secrets scanner

The Secrets scanner is a pattern and entropy filter, so its gaps are predictable. The cards below cover the failure modes that matter most when it sits in front of a model, and the control that addresses each one. Several of them stack: a credential that no plugin recognizes, split across two messages, and logged before redaction can leak with no alert at all.

Credentials outside plugin patterns

The Secrets scanner relies on detect-secrets plugins that match known token formats and on entropy checks. A vendor key with an unusual prefix, a internal token with no fixed shape, or a short password pasted into a chat can pass through untouched. Treat the scanner as a filter for common formats only. Check which plugins are enabled in your configuration, test each credential type your staff actually use, and keep a list of gaps that secrets managers and access policy must cover instead.

Secrets split across messages

Each prompt is usually scanned on its own. A user who pastes the first half of a key in one message and the second half in the next may evade detection entirely. Illustrative case: a token split over two turns of the same conversation would be scanned as two harmless fragments. Test multi-turn sessions during rollout, and pair the scanner with a policy that tells users never to paste credentials and with rotation for any secret that is found in a log.

Redaction applied after logging

If request bodies are written to application logs, tracing tools or a proxy access log before the Secrets scanner runs, the raw secret is stored even though the model never sees it. Confirm where the scanner sits in your request path and which components record input before it. Move redaction to the earliest point in the pipeline, restrict log access, and set retention limits on any store that holds prompts.

False positives that break workflows

Entropy checks flag random-looking strings such as hashes, build identifiers, base64 image data and test fixtures. When these are replaced with placeholders, code review, debugging and data tasks can fail in ways users find confusing. Measure how often legitimate content is altered during a pilot, record which plugins cause it, and agree on an exception path that is logged and reviewed rather than an informal bypass.

Behavior changes after plugin updates

Redaction output depends on the detect-secrets version and the plugins and filters enabled in your configuration. An update can add or remove detections without any change in your application code. Pin the library version, keep the configuration in version control, and rerun a fixed set of test prompts before each upgrade so that a change in what gets redacted is visible before it reaches users.

Dependence on an archived project

The protectai/llm-guard repository was archived by its owner on 9 July 2026, and the README states that the project is no longer under active development or maintained. Security fixes for new credential formats will not arrive from upstream. Keep the Secrets scanner in place only as a contained interim control, record it as an accepted risk with an owner, and plan its replacement with a maintained guardrail or secrets detection tool.

LLM Guard on GitHub

Where the Secrets scanner sits in the prompt request flow

The diagram starts with the user or calling application sending a prompt to the LLM Guard input scanner stage, where the Secrets scanner runs before anything leaves the organization's network. Check that redaction happens before the prompt crosses the trust boundary to the model provider, and that the logging step records the redacted prompt rather than the original. The output path runs back through the output scanners, so confirm that model responses are scanned before they reach users.

Secrets scanner placement in the input path, with the trust boundary to the model provider.

Limits to confirm in your environment before you rely on it

The Secrets scanner depends on detect-secrets plugins, prompt chunking behavior and the Python and dependency stack your build resolves to. Each card below is a check to run in your own environment, against your own prompts, before you treat the scanner as a control. Because the project is archived, none of these checks can be answered by a fresh upstream fix.

Confirm the active detect-secrets plugins

The scanner relies on detect-secrets plugins to recognize token formats, private key blocks and high-entropy strings. Inspect the plugin set your build actually loads, not the set you remember from the documentation, and record it with the build. Then feed the scanner a known sample for each secret type your organization uses, such as cloud access keys, source control tokens and PEM private keys. A plugin that is missing or disabled will fail silently, so the test must show a redaction for every category you rely on.

LLM Guard source

Test long and chunked prompts

Prompts that exceed the input length the scanner or its tokenizer handles may be split, truncated or scanned in pieces. A secret that straddles a chunk boundary can escape detection if each piece is judged alone. Build illustrative test prompts where a token is placed near the start, middle and end of a long input, and at a split point. Confirm whether the scanner redacts the full value in every position and whether your application passes the full prompt or a truncated version.

Check attachments and extracted text

The scanner sees only the text your application passes to it. Secrets inside uploaded PDFs, spreadsheets, images processed with OCR, or files that your application converts before sending are only covered if that conversion happens before the scanner runs. Trace each input path in your application, from attachment upload to the model call, and mark where the scanner is invoked. Send a test secret through each path and confirm whether it reaches the model unredacted.

Verify code block handling

Developers often paste code, configuration files and log excerpts into prompts. Secrets in fenced code blocks, quoted strings, environment variable assignments or multi-line YAML may be formatted in ways the detection rules do not match. Assemble a set of representative snippets from your own engineering workflows, run them through the scanner, and compare the redacted output with what should have been removed. Record every miss as an item for your custom detect-secrets configuration.

Confirm the Python and dependency stack

The last PyPI release, 0.3.16, uploaded on 19 May 2025, requires Python 3.10 or newer but below 3.13. Check that your runtime falls inside that range and that the resolved versions of detect-secrets and its transitive dependencies install and import cleanly in a clean environment. Pin the working set in a lock file, because an archived project will not receive dependency fixes. Repeat the check after any operating system or base image update.

LLM Guard on PyPI

Pin custom configuration in version control

A custom detect-secrets configuration changes what is redacted, so it is part of the control and needs the same review as code. Store the configuration in version control, record which file the running service loads, and require a test run whenever a plugin, filter or threshold changes. Without this, a configuration edited on one server can drift from the others and the team will not know which rules protected a given prompt on a given day.

Questions buyers ask about the Secrets scanner and its replacement

What drives the cost of keeping the LLM Guard Secrets scanner running?

The main cost is the engineering time to keep an archived dependency chain working, not the scanner's license, since LLM Guard is MIT licensed. Cost rises with the number of applications that call the scanner, how many custom detect-secrets configurations you maintain, and how much of your stack depends on Python versions that the last PyPI release supports. The last release, 0.3.16, uploaded on 19 May 2025, requires Python 3.10 or newer but below 3.13, so an upgrade of the host runtime can force rework. Ask any partner to split the quote into a one-time review and a recurring share for patching, pinning and security monitoring of the dependencies.

How long does a Secrets scanner configuration review take?

The duration depends on scope: how many applications send prompts through the scanner, how many custom detect-secrets plugins or filters are configured, and whether the review includes replacement testing. A single deployment with the default settings is a much smaller task than a shared API server used by several teams with custom rules. No duration is fixed here, so ask for a timeline in the written scope, and confirm which of these items it covers: configuration inventory, test corpus creation, false positive and negative review, and a retest after changes.

What does the work need from our team?

Expect to supply access to the running configuration, the API server settings if the scanner is deployed as a service, and representative prompt samples that contain real formats of your tokens and keys, handled under your data rules. You will also need an owner who can approve which secret patterns must be blocked and who accepts the trade-off between missed secrets and false positives. Confirm with your partner how sample data will be stored, masked and deleted before it is shared.

Can an internal team review and replace the Secrets scanner alone?

An internal team with Python, secrets-management and application security skills can do the work alone, provided it has time and a clear acceptance test. The hard parts are building a representative test set of secret formats, measuring what the current scanner blocks, and proving the replacement blocks at least the same set. Teams that lack an application security or AI security tester often underestimate this step. A partner adds value mainly by running that independent test and producing evidence that your compliance or security reviewers can read.

Should we keep the Secrets scanner or replace it?

For new rollouts, do not start with LLM Guard, because the project was archived by its owner on 9 July 2026 and its README states it is no longer under active development or maintained. For an existing deployment, keeping it is a short-term choice that should be contained and time-limited. Replacement is the better long-term path if the scanner sits in a production prompt path that handles customer or regulated data. Keep it temporarily only while you run a documented plan with an owner, a decommission date and monitoring for dependency issues.

What must a replacement for the Secrets scanner match?

A replacement should block at least the same secret types at the same point in the prompt path, with a measured detection rate on your own test set. It should also cover API tokens, private keys and high-entropy strings, keep redaction behavior predictable, and produce logs that your security team can audit. Before cutover, confirm the replacement's license, its maintenance status and how it handles custom patterns, because a guardrail that is maintained but cannot express your rules will not meet the same bar. Record each check so the migration can be reviewed later.

Does the archived status affect licensing or the use of the scanner?

The repository is MIT licensed, so existing copies can generally be used under those terms, but the license does not give you maintenance, security fixes or model updates. Confirm the license terms of any associated models separately, and ask counsel to review your use before you rely on it in a regulated workflow. Archival means that a dependency vulnerability found later may stay unpatched upstream, so your team or partner would need to carry that risk.

Planning the move from the Secrets scanner to a maintained guardrail

The 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 Secrets scanner you run today will not receive fixes for new token formats or detection gaps, so the move should be planned now rather than after an incident. DeployOpen's scope for this pillar is to support existing deployments and to move them to maintained guardrails. NeMo Guardrails is not the source for that recommendation; the maintained alternative named in our scope note is NeMo Guardrails, and you should confirm its current secrets detection capability with NVIDIA's project documentation before you assume it matches. Do not treat the Secrets scanner's behavior as something a replacement provides by default.

Before you change anything, capture what the current scanner actually redacts. Assemble a test corpus of prompts that contain the cases you care about: provider-style API tokens, PEM private key blocks, database connection strings, and high-entropy strings that are not secrets, such as hashes and build IDs. Record the detect-secrets plugin list and any custom configuration in use, because those settings decide what is caught. Run the corpus through the live Secrets scanner and save the exact expected output for each prompt: which spans were redacted, what replacement text was used, and which items passed through. This baseline is the contract the replacement must meet.

Then run the same corpus through the candidate guardrail and compare results line by line. Treat any secret the baseline redacted and the candidate passes as a blocking gap, and log false positives separately so you can judge whether the candidate is over-blocking. Keep the corpus under version control with the plugin list, so a later audit can see what was tested and when. Ask any vendor or integrator to show results against your corpus, not a generic benchmark, and confirm in writing which secret types the replacement covers before you retire the existing scanner.

How DeployOpen works on this

DeployOpen scopes and supports secrets redaction for organizations that run or are replacing LLM Guard, working inside infrastructure you control. Because LLM Guard is archived, we focus on keeping an existing Secrets scanner contained and on moving its redaction rules to a maintained guardrail where that is the right path.

How we scope

  • Engagements are fixed-scope, with the scanner inventory, prompt paths and deliverables agreed in writing before work starts.
  • We record which applications send prompts through the Secrets scanner and which token and key types each one must catch.
  • The written scope states the detect-secrets configuration to review, the test corpus used and what is excluded from redaction.

How we build

  • We review the existing Secrets configuration, including any custom detect-secrets plugins, baseline files and thresholds in use.
  • We test redaction against representative API tokens, private keys and high-entropy strings, recording misses and false positives.
  • Where a replacement is in scope, we build the new redaction rules alongside the existing scanner so both can be compared on the same inputs.

How we hand over

  • You receive documentation of the final configuration, the test results and the known gaps, written so your engineers can maintain it.
  • Handover covers where the configuration lives, how it is deployed and which settings should change only through review.
  • We document residual risk for the archived dependency so your security and compliance teams can review it with the evidence.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after handover.
  • A retainer can cover retesting the Secrets scanner after dependency or configuration changes and tracking new secret formats.
  • Ask any provider to confirm in writing how support, retesting and decommission work are priced and what each one includes.

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.