GLiNER-PII detection and masking in NeMo Guardrails

GLiNER-PII lets NeMo Guardrails detect a broader set of personal data categories than fixed-entity detectors. This page covers the deployment choices, configuration split and planning work behind it.

On this page

When GLiNER-PII is the PII detector to plan for in NeMo Guardrails

Choose GLiNER-PII when your team needs personal data detection in prompts, responses or retrieved content and the rule-based entity lists of a detector such as Presidio miss categories you must catch. GLiNER-PII is a NVIDIA NIM for named entity recognition over personal data categories that you define more broadly, so it fits teams whose policies name categories (for example, employment details or household information) rather than a short fixed list of identifiers. In NeMo Guardrails it is one option in the PII rail family, alongside the Presidio-based rails, the Private AI integration and regex rails for custom identifiers. Presidio stays the in-process baseline with predictable patterns, regex covers your own identifier formats, and GLiNER-PII is the choice when broader semantic coverage justifies running a model service. Teams that must keep data inside their network, such as those in banking, healthcare or public sector, should evaluate it together with the self-hosted options.

Evaluate it with your own data before you design around it. Category coverage varies with the language, document types and naming conventions in your prompts, transcripts and knowledge base, so build a labeled sample from real traffic that you are permitted to use, run each candidate detector against it, and record misses and false positives per category. Confirm the NIM's license terms, supported hardware, update cadence and support entitlements with NVIDIA before design, because these determine whether a local container can run in your environment and who you call when it fails. Ask your NVIDIA account contact or review the current NIM documentation for those terms. Note that NeMo Guardrails itself is licensed under Apache 2.0, and that licensing of the model service is a separate question you must answer in writing.

Hosted versus local GLiNER-PII containers and when each fits

This table compares a hosted GLiNER-PII NIM endpoint with a locally run container on criteria you can check in your own environment. Read each row as a question to answer for your data and network before choosing a mode. The main takeaway is that where personal data travels and who holds the license terms usually decide the choice, and both points must be confirmed in NVIDIA's current NIM documentation.

CriterionHosted NIM endpointLocally run container
Where personal data is sentPrompt, response or retrieved text leaves your network for the hosted endpoint. Confirm the exact data path and retention in NVIDIA's current NIM documentation.Text is processed on hardware you run. Personal data stays inside your network if no other component forwards it.
Who operates the GPU capacityNVIDIA or its hosting provider operates the capacity. You manage keys, quotas and availability terms.Your team or your platform provider runs the GPU nodes, drivers, container runtime and patching.
Network dependenciesEvery guardrail check depends on outbound connectivity and the endpoint's availability. Plan a fallback behavior for failed calls.Depends on cluster networking to the container only. Confirm image pulls and model download paths for offline installs.
LatencyAdds a network round trip on every input and output check. Measure it from your application's region before relying on it.Adds only local network time, but depends on GPU capacity sized for your request volume.
Air-gap suitabilityNot suitable for air-gapped networks because it requires outbound access to the hosted service.Suitable when images, model weights and licenses can be loaded through an approved transfer process. Confirm the required artifacts with NVIDIA.
Who holds the license termsThe hosted service terms apply to your use. Confirm what the terms cover for personal data and for your organization's use case.The NIM container and model license terms apply to the software you run. Confirm whether your NVIDIA AI Enterprise or other entitlement is required.
Choosing a per-rail splitUse when detection can leave your network but masking must stay local, or the reverse. Check that both paths meet the same data handling rules.Use when detection and masking both must stay inside your network. Each rail still needs its own endpoint configuration and a tested fallback.

How prompts and responses pass through GLiNER-PII detection and masking

The diagram starts with a user prompt entering the input rail of a NeMo Guardrails application. The rail sends the text to a GLiNER-PII endpoint, which returns the detected spans. Those spans feed a masking or blocking decision, and only the resulting text reaches the model. The model's response passes through the output rail the same way before it returns to the user. The trust boundary marks whether the detector runs in a local container inside your network or at a hosted endpoint, where the text leaves your organization. Check that boundary before you approve the design.

Prompt and response path through GLiNER-PII rails, with the trust boundary around the local container.

How label placeholder masking changes what the model and logs see

Label placeholder masking replaces each detected span with a category label, such as a placeholder naming the entity type, so the model receives a redacted version of the prompt while the original value never enters the prompt. The rail decides what gets replaced, and the model only sees the substitute text. In practice, a sentence that contained a person's name and an account identifier reaches the model as the same sentence with those spans swapped for labels. The grammar, the surrounding context and the kind of value that was removed all survive, which is usually what a classification, summarization or routing task needs.

What the model loses is the exact value. If a user asks the assistant to repeat a phone number, confirm a date of birth or look up a record by an identifier, the model has nothing to work with and will either refuse or guess. Confirm this with a test set before rollout: for each intended use case, list the questions that depend on a specific value and decide whether the answer should come from a tool call that reads the original data outside the prompt, or whether the request should be blocked. Also check that the chosen label names are stable across your entity list, because a model that sees inconsistent placeholders across turns can become confused about which references point to the same person.

Placeholder text is not the same as deleted text. The masked prompt, and sometimes the original input, can appear in logs, traces and debug output depending on how NeMo Guardrails is configured for logging and content capture. Treat the placeholder output as data you must govern, and confirm in your own environment which fields your observability backend stores and for how long. Keeping original values out of those records is a separate control from masking the prompt, and it should be verified on its own.

Before you set label placeholder masking as the default for a deployment, run it on a sample of records that reflects your real traffic, including edge cases such as names that look like common words, multi-value fields and mixed-language text. Review the masked output and the corresponding log entries side by side. The check is complete when the model-facing text is useful for the task, no original values appear in the records you retain, and the team that owns the observability backend has signed off on what is stored.

Why detection and masking are configured separately and what to decide for each

Detection and masking answer different questions, so a split configuration lets each rail have its own entity set, threshold and action. The decisions below connect the rails to one review process, so a change to one rail is visible to the people who approve the others.

Which rails only detect

Decide which input, output and retrieval rails should flag or block personal data without changing the text. Detection-only rails suit cases where a request containing personal data should be rejected or logged for review instead of silently altered. Check that each detection-only rail has a defined outcome (reject, flag or escalate) and that the application handles that outcome. Review this list whenever a new rail is added.

Which rails mask and what replacement they use

Decide which rails rewrite the text, and what the replacement looks like. Masking with label placeholders keeps the sentence readable for the model while hiding the value, so the placeholder text becomes part of what the model sees. Confirm the placeholder format for each label with the team that owns downstream prompts, since a changed placeholder can change model behavior.

Entity and label sets per rail

Choose the label set each rail uses rather than sharing one broad list. A narrow set on output rails can prevent masking of legitimate content, while a broad set on input rails can catch more personal data at the cost of more false positives. Record the labels for each rail in version control so a reviewer can see what each rail covers.

Score thresholds per rail

Set the confidence threshold separately for detection and masking, and test it against sample data from your own domain. A threshold that suits blocking may be too strict for masking, or the reverse. Ask the vendor or your test team to document how the score is produced for the GLiNER-PII model you deploy, because scores are not directly comparable across detectors.

Behavior on partial matches

Decide what happens when a span is only partly recognized, such as a name without a surname or a number that resembles an account identifier. Options include masking the matched span, masking a wider span, or leaving the text unchanged and logging it. Test partial matches with examples from your own records and confirm the behavior with the people who will explain blocked requests to users.

Versioning and review of each setting

Store the detection and masking settings as separate reviewed changes with an owner, a test set and an approval record. Without that, a threshold tuned for one rail can quietly change another. Confirm your change process with your security and compliance leads, and retest each rail after a NeMo Guardrails upgrade, since configuration handling can change between releases.

NeMo Guardrails docs

Setting up GLiNER-PII in a NeMo Guardrails configuration

This sequence takes a team from a confirmed NeMo Guardrails and Python environment to a GLiNER-PII endpoint wired into separate detection and masking rails, verified on input, output and retrieval paths, with logs checked for leaked values.

  1. Confirm the release and Python version

    The engineer who owns the target environment confirms that the NeMo Guardrails release being installed is 0.25.0 or the release the team has pinned, and that the runtime uses Python 3.11, 3.12 or 3.13. Install the package from PyPI into an isolated virtual environment and record the resolved version. Check: running the version query in the environment returns the pinned release and the interpreter reports one of the supported Python versions. Confirm the environment against the README and release notes before you go further, since the LLMRails class is deprecated in 0.25.0 in favor of Guardrails.

  2. Deploy the GLiNER-PII NIM

    Choose between NVIDIA's hosted endpoint and a local NIM container, then confirm the prerequisites for that path with NVIDIA's NIM documentation and your account team. For a local deployment, confirm GPU model, driver, container runtime, storage and network rules for the cluster or host, and whether the air-gapped network needs an offline image transfer. Start the container and send one sample request. Check: the health endpoint responds and a sample text returns entity spans with labels. If the NIM cannot run in your environment, stop here and confirm alternatives before configuring rails.

  3. Register the endpoint in the configuration

    In the configuration folder, add the GLiNER-PII endpoint URL and model identifier to the models section of config.yml, and keep any API key in an environment variable rather than in the file. Keep the hosted and local endpoints as separate named entries so the detection and masking rails can point to the same or different services deliberately. Load the configuration with the Python API or the guardrails server. Check: the configuration loads without validation errors and a direct call through the registered model name returns the expected entity output.

  4. Define separate detection and masking rails

    Write a detection rail that only identifies entity types and records the matches, and a separate masking rail that replaces each span with its label placeholder, such as a bracketed entity name. Keep the two in distinct action definitions so you can change masking behavior without changing what is detected, and set the entity categories explicitly in both. Attach the rails to input and output flows in the Colang definition for your chosen Colang version. Check: a prompt containing a sample name and an identifier produces a detection record and a masked string with placeholders in the rail trace.

  5. Attach the rails to retrieval paths

    Apply the same masking rail to retrieval results before chunks enter the prompt, using the retrieval rail hook in your configuration. Confirm that the retrieval call returns chunks that have been processed, and that the chunk text passed to the model contains placeholders instead of raw values. If the team also uses the Presidio or regex rails, document the order of execution so overlapping matches are resolved consistently. Check: a test chunk containing a sample identifier reaches the model prompt only in masked form, as shown in the trace.

  6. Run the test set through all three paths

    Build a test set of labeled synthetic records that cover names, contact details, account identifiers and text with no personal data, and mark the expected result for each. Run every record through the input path, the output path and the retrieval path, and record whether each entity was detected, masked and passed through. Label any hypothetical records as illustrative and keep real personal data out of the test set. Check: the results sheet lists a pass or fail for each record and path, and every expected entity is accounted for before the configuration moves forward.

  7. Check logs and traces for leaked values

    Turn on the logging and tracing your environment uses, rerun the test set, then search the log output, trace store and any telemetry export for the raw sample values. Note which components record prompt or response content by default and whether content capture is enabled in your deployment. Check: a search for each synthetic value across log and trace output returns no matches, or each match is documented with a fix. Repeat this check after any change to the logging configuration.

GPU planning for local GLiNER-PII inference by environment

In development and evaluation, the goal is to learn how the detector behaves on your data, not to serve production traffic. Accelerator needs are driven mainly by the model variant you test, how many requests you replay at once, and whether you run detection on every turn only or also on retrieved chunks. A small shared test machine can often answer functional questions, but it will not tell you what latency your users will see.

  • Model variant: Test the variant you intend to use in production, since a different variant can change memory use and speed.
  • Replay concurrency: Simulate the number of simultaneous conversations you expect at peak, not the number of developers testing.
  • Detection points: Measure input, output and retrieval rails separately, because retrieved chunks can multiply the number of calls per request.
  • Latency target: Write down the response time your application can tolerate before you measure anything.
  • Hardware owner: Confirm who provides the test machine and whether it can be reused for production sizing.

Before relying on evaluation results, confirm the supported accelerators and minimum requirements in the NIM's current support matrix and run a load test on hardware that matches your target environment.

Data handling and security for personal data sent to a GLiNER-PII endpoint

Every GLiNER-PII call sends raw user text to a detection endpoint, so that endpoint becomes part of your personal data processing scope. The cards below cover where that text goes, who can reach the endpoint, how traffic is protected, which credentials it uses, what gets logged, and how the container image is kept trustworthy. Each card ends in a check your security team can run before and after rollout.

Processing location for each deployment mode

A hosted GLiNER-PII endpoint receives the full prompt, response or retrieved chunk outside your network, so the provider's terms, regions and retention apply to that text. A local container keeps the text inside hosts you operate. Confirm in writing where the hosted service processes and stores request payloads, and map the local deployment to the same data flow diagram your privacy review already uses. Record which mode each rail uses, because input, output and retrieval rails may differ.

NeMo Guardrails docs

Access control on the endpoint

A local NIM container accepts requests from anything that can reach its port unless you restrict it. Place the endpoint on a private subnet and allow inbound calls only from the guardrails server's address range. Test from an unapproved host that the connection is refused. Confirm whether the NIM supports any built-in authentication in your version, and if it does not, enforce access at the network or service mesh layer.

Network segmentation and TLS

Traffic between the guardrails server and the NIM carries unmasked personal data, so the hop needs encryption even inside a cluster. Terminate TLS on the endpoint or through a mesh with mutual authentication, and keep the NIM off any network segment that holds user browsers or public ingress. Verify with a packet capture or certificate inspection that plaintext requests do not cross the hop. Document the certificate authority and rotation owner.

Secrets for authenticated endpoints

If your hosted or gateway-fronted GLiNER-PII endpoint requires an API key, store it in your secrets manager and inject it at runtime, not in config.yml or the image. Scope the key to the detection service only, set a rotation owner, and confirm that revoking it stops detection calls without affecting other rails. Check that the key never appears in the rendered configuration printed at startup or in error messages.

What reaches logs and traces by default

Guardrails frameworks often record rail inputs and outputs while debugging, and a detection call can write the raw text it scanned into application logs or traces. Before go-live, run a test request containing a fake personal identifier and search the server logs, container logs and any tracing backend for that value. Confirm which logging and content capture settings are on by default in your installed version, and turn off content capture for the detection step if the test finds the value.

Image pinning and scanning

Pull the NIM container by an immutable digest rather than a floating tag, and record that digest in your change records. Scan the image and its base layers with your approved vulnerability scanner before it enters your registry, and repeat the scan when you update. Ask NVIDIA or your account contact which NIM release and model version the digest contains, and confirm the license terms that apply to local use.

What teams ask before adopting GLiNER-PII for NeMo Guardrails

Is GLiNER-PII free to use with NeMo Guardrails?

The NeMo Guardrails library is free to use under the Apache 2.0 license, but the GLiNER-PII NIM is a separate NVIDIA artifact with its own terms. Confirm the license, any usage metering on the hosted endpoint, and whether running the local container in production requires an NVIDIA AI Enterprise entitlement. These terms decide whether the detector can run in your environment, and they can change between releases. Ask NVIDIA for the written terms that apply to your deployment model before you plan the rollout, and keep them with your procurement records. Your own costs then come from GPU capacity, operations and testing, which the next question covers.

What does it cost to run GLiNER-PII locally?

Local cost has four parts: GPU capacity, the platform that hosts the container, the people who operate and update it, and the testing that proves it works on your data. GPU capacity is either owned hardware or cloud instances billed by time, so peak request volume and utilization drive it most. Operations adds patching, image updates, monitoring and on-call coverage, which recur every month. Testing is largely one-time for each configuration but repeats after every model or library change. This page does not give hardware or pricing figures, so request the GPU memory and model requirements from NVIDIA's documentation for the version you choose. In any quote, ask for each component as a separate line with its assumptions stated.

Can our team set up GLiNER-PII without outside help?

Often yes, if your team already runs GPU containers and maintains Python-based services, but setup is more than starting one container. The build needs a working NeMo Guardrails configuration in config.yml, a detection rail that calls the NIM, and a masking step that replaces findings with label placeholders. If detection and masking need different settings, they also need separate configurations. Your team also needs a labeled sample of your own text to check categories and false positives. Gaps usually appear in GPU driver and node setup, secrets handling and regression testing after upgrades. If one of those is missing, a fixed-scope engagement can cover it, with deliverables agreed in writing before work starts.

How long does a GLiNER-PII pilot take to plan?

No single duration fits every environment, so planning time depends on what must be decided first. The main inputs are the PII categories you must catch, whether your data policy allows the hosted or the local NIM, where the GPU capacity will run, and who signs off on test results. Planning moves fastest when categories and data residency rules are settled before the technical design starts. A pilot also needs a test corpus drawn from production content, with redaction handled by your data team, and that dataset often takes longer than the code. Ask any provider for a written schedule tied to milestones and named dependencies, and check which dependencies sit with your teams.

How does GLiNER-PII compare with Presidio on categories?

The two detectors cover overlapping ground but define categories differently. Presidio uses recognizers, many of them pattern or rule based, with entity types you enable in configuration, plus a spaCy model for named entities. GLiNER-PII is designed to take a list of labels and recognize a broader set of personal data categories, which can help where your categories do not match Presidio's built-in entity names. Neither should be trusted on coverage without measurement. Build a labeled test set from your own content, run both detectors on the same text, and record misses and false positives per category. Vendor accuracy figures come from their own datasets, so treat them as starting points only.

Does the GLiNER-PII NIM depend on the NeMo microservices sunset?

The sunset applies to the NeMo Guardrails microservice container, which NVIDIA says has been sunset as of October 1, 2026, will receive no new releases and is no longer supported. Whether the GLiNER-PII NIM follows the same path is something to confirm directly with NVIDIA for your version and deployment model. The archived NeMo Microservices documentation tells existing users to contact their NVIDIA account team, so do not assume an older catalog entry will keep receiving fixes. Record NVIDIA's written answer in your architecture decision record before you commit to a deployment path. Check the current status of the container on the NGC catalog page for the NeMo Guardrails microservice.

What does the work need from our platform, security and data teams?

Three groups carry most of the work. Platform teams provide GPU nodes or cloud capacity, a container registry, network rules for the NIM endpoint, and a secrets manager for any model credentials. Security teams review where prompts and detected spans are logged, because a masking rail that writes raw text to traces can move personal data into your observability stack. Data teams supply a labeled sample, approve which categories count as personal data, and set acceptable false positive and false negative levels. Ask any partner which of these tasks they run, which stay with you, and how configuration changes after go-live are approved.

Limits to confirm before you commit to GLiNER-PII

GLiNER-PII is a useful option for broader personal data categories, but several points sit outside the code and can change the design. Confirm each one with NVIDIA, your account team or your own test results before you commit to a hosted or local deployment.

License and NVIDIA AI Enterprise terms

Confirm the license on the GLiNER-PII NIM you plan to pull, and whether using it in production brings NVIDIA AI Enterprise terms into play. The NeMo Guardrails library is Apache 2.0, but the model container is a separate artifact with its own terms. Ask NVIDIA in writing which license covers hosted use, local containers and any air-gapped mirror, and record the answer in your architecture review. Check this before procurement, since it affects who pays for the runtime.

NeMo Guardrails license

Microservice sunset and NIM-based rails

NVIDIA has retired the NeMo Guardrails microservice, and its NGC container page says it is no longer supported. Confirm with your NVIDIA account team whether the GLiNER-PII NIM and any rail that calls it stay on a supported path, and what replaces the microservice for your deployment. Ask which NeMo Platform components apply and whether a migration date is set. Do not assume a NIM-based rail keeps its support status because the library is still released.

NGC guardrails container

Supported label categories and languages

GLiNER-PII is chosen for broader categories than fixed recognizers cover, but the label list and language coverage are what matter for your data. Pull the exact label set from the model documentation for your version and map each label to the data your assistant handles. List languages your users write in and test each one with representative text. Gaps in labels or languages become gaps in masking, so record what is not covered.

False positives on names and identifiers

Name-like and identifier-like strings can be masked when they are not personal data, such as product names, ticket numbers or public figures. Build a test set from your own prompts, retrieved chunks and responses, and measure how often legitimate text is replaced. Compare results with and without the label placeholder format you choose, because over-masking can break the answer the model needs to give. Tune thresholds and labels against that set before you enable blocking.

Release and Python version in use

Confirm the NeMo Guardrails release and Python interpreter you will run before you write configuration. The current release is 0.25.0, which requires Python 3.11, 3.12 or 3.13. Check that the GLiNER-PII integration you use works with that release, and plan any Colang or LLMRails changes the 0.25 migration guide describes. Pin the versions in your build so that a later release does not change masking behavior without review.

nemoguardrails on PyPI

Masking on long documents and chunks

Detection quality and latency can change with input length, so long documents and retrieved chunks need their own tests. Ask how the NIM handles inputs longer than its context window, whether text is split, and whether a personal data span that crosses a chunk boundary is still caught. Test retrieval rails with real chunk sizes from your index, and confirm the behavior of masking on partial or overlapping spans before you rely on it for RAG content.

How DeployOpen scopes, deploys and tests GLiNER-PII PII controls

DeployOpen starts with a written scope that names the data categories, the hosting model for the GLiNER-PII container and the rails that will call it. We then build the detection and masking configuration in your environment, test it against your own sample data, and hand over the configuration, runbooks and evidence your security and compliance teams can review.

How we scope

  • Agree in writing which personal data categories GLiNER-PII must detect on input, output and retrieval rails.
  • Decide whether the GLiNER-PII NIM runs hosted or as a local container in your own infrastructure.
  • Size the GPU capacity for local inference from your expected request volume, confirmed during scoping.

How we build

  • Configure separate detection and masking settings so each rail's behavior is reviewable on its own.
  • Set label placeholder masking so the model receives consistent tokens instead of raw personal data.
  • Verify the Python version and NeMo Guardrails release (currently 0.25.0) against your deployment image.

How we hand over

  • Deliver the config.yml, Colang files and any custom actions, with version control and a change record.
  • Provide a test set with expected detections and masked outputs, plus documented false positives found during testing.
  • Document how to reproduce the GPU sizing decision, the container settings and the rollback steps.

How we support

  • Run retesting after each NeMo Guardrails upgrade or change to the GLiNER-PII label set.
  • Offer ongoing support, upgrades and continuous testing as a retainer after handover.
  • Keep the hosting, logging and detection evidence current for the reviews your compliance teams run.

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.