Self-hosted PII detection with NeMo Guardrails

Self-hosted PII detection with NeMo Guardrails keeps personal data inside your network, using Presidio in process, local GLiNER-PII containers or containerized Private AI. This page compares those options with cloud PII APIs on residency, cost and accuracy.

On this page

Why keep PII detection inside your own network

Prompts, model responses and retrieved documents in an LLM application often carry personal data, and many organizations have policies that stop that data from leaving their network. Self-hosted PII detection runs the detector inside your own cloud account, data center or air-gapped network, so the text being scanned never has to be sent to a third-party PII API. Teams usually need this when the data includes regulated categories such as health or financial records, when residency rules restrict where personal data may be processed, or when a vendor review cannot approve an external service for that data. Confirm the exact requirement with your privacy, legal and security owners before choosing a pattern, because the answer determines whether any external call is acceptable at all.

NeMo Guardrails is an open-source toolkit licensed under Apache 2.0, so the rails framework itself can run in your environment without a license fee for the library. The detectors are separate components, though, and NeMo Guardrails does not decide for you which one is correct. Your team has to choose the detector (for example, an in-process Presidio setup, a locally deployed GLiNER-PII container or a containerized Private AI server), deploy it, and test it against your own data. Each choice has its own hosting, resource and accuracy profile, so confirm with each vendor or project which deployment modes, licenses and data handling terms apply to the version you plan to run, and record those answers as part of your review evidence.

Which self-hosted detector fits which requirement

This table compares the in-process Presidio option, local GLiNER-PII NIM containers, containerized Private AI and regex rails, with cloud PII APIs as the baseline. Read each row against your data residency rules, your language and entity mix, and the team that will run the service. Coverage, language support and licensing must be confirmed for each option against vendor documentation and your own test data before you choose.

RequirementPresidio in processLocal GLiNER-PII NIMContainerized Private AICloud PII API (baseline)
Where the detector runsInside the NeMo Guardrails Python process on your host or containerSeparate GPU container in your cluster or data centerLicensed server container in your networkVendor-hosted endpoint outside your network
What runs itPython process with a spaCy language modelGPU container with a model served locallyLicensed server software from the vendorVendor's managed service
Entity coverageStandard entity types; extend with custom recognizersBroader open-ended PII categories defined by labelVendor-defined entity catalog; confirm the listVendor-defined catalog; confirm per product
Data leaves your networkNo, if the spaCy model is installed locallyNo, if the container and model are localNo, if the server runs in your networkYes, prompts and responses are sent to the vendor
Operational loadLow; runs with the rails serviceModerate; GPU sizing and model updatesModerate; license and server upgradesLow for your team; contract and review of vendor terms
Fits best whenCommon entities, English-first text, minimal infrastructureWide PII categories and GPU capacity is availableVendor coverage and language support match your test dataData residency rules permit outbound processing
What to confirmLanguage models, accuracy on names and identifiers, score thresholdsSupported labels, GPU requirements, model license termsLicensing terms, supported languages, data handling statementsData processing terms, residency options, retention and sub-processors

How NeMo Guardrails calls a PII detector on each path

NeMo Guardrails organizes its checks into five rail types: input rails, dialog rails, retrieval rails, execution rails and output rails. For PII, the paths that matter are the input rails that inspect the user's prompt before it reaches the model, the output rails that inspect the model's response before it reaches the user, and the retrieval rails that inspect RAG chunks before they are added to the prompt. Dialog rails steer conversation flow and execution rails govern custom actions and tools, so neither is the usual place for a personal data check. Decide which of the three paths carry personal data in your application, because each one needs its own detector wiring and its own test cases.

You can call NeMo Guardrails in two ways. The first is the Python API, where your application loads a configuration and invokes it in process. The second is a guardrails server that loads configurations from a folder and exposes an HTTP API, with a Dockerfile provided to build a server image. In both cases the detector is reached from the configuration: config.yml declares which rails are active and the Colang files define how a rail's result is handled. Where a detector needs custom logic, such as calling a self-hosted service or mapping its output, the logic lives in optional Python actions loaded alongside the configuration. Confirm the exact rail configuration keys, the action registration pattern and the server endpoints against the NeMo Guardrails 0.25.0 documentation before you write them into your configuration, because these are the parts most likely to change between versions.

Where personal data stays during a guarded request

The request starts at the application client and enters the NeMo Guardrails server, which runs inside the trust boundary. The input rail sends the prompt to the chosen detector, either Presidio in process or a GLiNER-PII or Private AI container on local hosts, and the masked or blocked prompt then goes to the model endpoint. The output rail checks the response, and retrieval chunks pass through the retrieval rail before entering the prompt. Check the boundary: any detector or model call that leaves your network is the point where personal data crosses it.

Personal data paths through the guardrails server; a cloud detector would sit outside the boundary.

How self-hosted detection compares with cloud PII APIs

Self-hosted PII detection moves the detector into infrastructure you run, which changes where personal data is processed, what you pay for, and who keeps the service healthy. Each card below is a decision point to settle with your security, finance and platform teams before you choose between a self-hosted detector and a cloud PII API.

Data residency and logging

With Presidio running in process, text is analyzed inside the NeMo Guardrails process. With a local GLiNER-PII NIM or a containerized Private AI server, text stays on hosts you control. A cloud PII API sends each prompt, response and retrieved chunk to the vendor. Ask the vendor where inputs are processed, whether they are stored or used for training, how long logs are kept, and which regions serve your traffic. Then confirm the same questions for your own traces and logs.

NeMo Guardrails docs

Build and run cost

Cloud APIs bill per request, and the vendor sets the rate and can change it. Self-hosting shifts cost to one-time setup and recurring compute: CPU for Presidio, and GPU or CPU capacity for GLiNER-PII or Private AI, sized to your peak request volume. Ask a cloud vendor for its per-request price, volume tiers and minimums. Ask yourself for an estimate of GPU hours, container hosts, storage for logs and the engineering time to build the rails.

Accuracy on your own data

No PII detector's accuracy transfers automatically to your documents. Names, account numbers, medical record numbers and internal identifiers behave differently across languages, formats and channels. Build a labeled sample from your real input, output and retrieval traffic under your privacy controls, then run each candidate detector against it. Record misses and false positives separately, because a missed identifier and an over-masked sentence have different costs.

Operations and on-call

A self-hosted detector becomes a production service. Your team owns image patching, model updates, scaling under load, health checks, failover and incident response when detection latency rises or a container stops. A cloud API carries most of that operational load for the vendor, but you still own the integration and the fallback when it is unavailable. Write down who responds to a detector outage and what the application does while it is down: block, pass through, or queue.

Licensing and vendor status

Confirm the license of each component before you rely on it. NeMo Guardrails is Apache 2.0, but the NeMo Guardrails microservice has been sunset, so the container you may find in older guides is no longer supported. Check the terms of each detector model, the Presidio and spaCy model licenses, and any commercial terms for Private AI. For a cloud API, confirm the contract's data processing terms, the notice period for changes, and the support commitments in writing.

NGC guardrails container

Team skills and ownership

Self-hosting needs people who can run Python services, Kubernetes or Docker hosts, GPU nodes and model artifacts, and who can tune detection rules and read evaluation results. A cloud API needs integration skills and a clear owner for the vendor relationship. Decide which team owns the rail configuration, the entity list, the threshold changes and the regression tests, and confirm that team has the time and skills before you commit to a self-hosted design.

Set up a self-hosted PII rail step by step

This sequence takes a team from a supported Python environment to a containerized NeMo Guardrails server that screens personal data with a detector running inside its network. Each step ends with a check, so the team can show that the rails work and that no detector traffic leaves the environment before the image is promoted.

  1. Confirm the Python version and build host

    The platform engineer confirms that the build host runs Python 3.11, 3.12 or 3.13, the versions NeMo Guardrails 0.25.0 requires. Earlier or later interpreters should be treated as unsupported until you verify them against the release notes. Record the interpreter path and operating system in the change ticket so the detector and server builds can be reproduced later. Done when python --version reports a supported version on the same host that will run the build and the test corpus.

  2. Install nemoguardrails in a pinned environment

    A developer creates an isolated virtual environment and installs the nemoguardrails package from PyPI at the exact version 0.25.0, then records the full dependency lock in version control. Pinning matters because 0.25.0 deprecates the LLMRails class in favor of Guardrails, with removal planned no earlier than 0.27.0, so code written for one release can break on the next. Keep the 0.25 migration guide open and schedule upgrades as their own change. Done when pip show nemoguardrails reports 0.25.0 and the license reads Apache-2.0.

  3. Choose and install the PII detector

    The team selects a detector for each data class and installs it inside the network boundary. Presidio runs in process, so its spaCy language model must be downloaded during the build from a source your mirror controls. A local GLiNER-PII NIM container or a containerized Private AI server runs as a service in your cluster, so the rail calls an internal endpoint. Confirm the image source, GPU requirements and license terms with the vendor before you pull anything. Done when the chosen detector answers a test request from a host inside your network.

  4. Write config.yml and the input, output and retrieval rails

    A developer creates the configuration folder with config.yml, the sensitive data detection settings, and Colang files that apply the PII rail to user input, model output and retrieved chunks. Set each rail to block or mask according to the policy agreed for each data type, and point the detector endpoint at the internal address from the previous step. Confirm the exact configuration keys for your detector in the NeMo Guardrails documentation. Keep the folder in Git so every change is reviewed. Done when the Python API or server loads the folder without configuration errors and a sample prompt containing a fake name is handled by the input rail.

  5. Run a synthetic personal data test corpus

    A QA engineer builds a corpus of synthetic personal data, such as invented names, email addresses, phone numbers, account numbers and record identifiers, and sends each item through every rail. Include clean prompts as well, so over-matching appears as a failure. Record whether each item was blocked, masked or missed, and compare the results with the policy. Use only generated data, never copies of production records. Done when every test case has a recorded expected and actual outcome, and each missed item is logged for tuning.

  6. Confirm no detector call leaves the network

    The network team checks egress from the NeMo Guardrails host and the detector container while the test corpus runs. Restrict outbound traffic at the firewall or egress policy so only the internal detector and model endpoints are reachable, then rerun the corpus. Look for telemetry, model downloads or package fetches that may occur at runtime, and disable or pre-stage them. Save the firewall and proxy logs as evidence. Done when the logs show no connections to external addresses during the test run and the rails still return the expected results.

  7. Build the server image from the Dockerfile

    A platform engineer builds a server image from the Dockerfile in the NeMo Guardrails project on GitHub, including the pinned version, the configuration folder and the detector client settings, then pushes it to your internal registry. NVIDIA has sunset the NeMo microservices, so this image comes from the open-source project, not from the retired NGC microservice container. Scan the image and record its digest. Done when the container starts from the internal registry and the test corpus passes against the running container.

Security and operational risks to design for

Self-hosted detection keeps personal data inside your network, but it also makes your team responsible for the detector, its models and its logs. The six risks below are the ones to design controls for before the first request is routed through the rails. DeployOpen prepares controls and evidence for your review, but independent auditors and certification bodies issue any audit report or certification.

Detector traffic leaving the network

A misconfigured detector endpoint can send raw prompts to a cloud service without anyone noticing, because the rails call whatever URL the configuration names. Check every detector address in the configuration and the container's outbound rules, and confirm that only internal hosts are reachable from the guardrails server. Test egress from the running container, not only from the design document.

Logs and traces holding raw personal data

Guardrails traces and verbose logs can store the very text the detectors were meant to protect, so the observability backend becomes a second store of personal data. Review content capture, verbose logging and telemetry settings before go-live, and set retention on the backend. The separate logging topic lists the settings to review.

Access to the detector and model files

The detector container, its model weights and the configuration folder all need access control, because anyone who can change a rail can weaken detection. Restrict who can push images, edit config.yml and read model storage, and log those changes. Treat the detector like any service that handles personal data.

Patching the detector and its dependencies

Detection depends on a Python runtime, NLP libraries, spaCy models and possibly a GPU stack, and each one ships its own security fixes. Track the NeMo Guardrails release line, the detector image and the model packages on separate schedules, and retest detection after each update. Confirm your upgrade window before you commit to a version.

Guardrails releases

False negatives that pass personal data

A detector that misses an identifier lets personal data reach the model, the logs or a retrieved chunk, and the rail reports success anyway. Measure recall on your own sample of prompts, documents and identifiers, including custom formats that off-the-shelf entity lists miss. Define which misses are acceptable and which must fail closed.

Capacity when detection runs on every request

When detection runs on every input, output and retrieved chunk, detector latency and capacity limit the whole assistant, and a GPU-backed detector can become a bottleneck. Ask for load tests at your expected peak, plan replicas and a failure mode for detector outages, and decide whether requests wait, fail or pass with a logged exception.

Limits and what to confirm in your environment

Before you commit to self-hosted PII detection, confirm which NeMo Guardrails path NVIDIA supports for your deployment. The NeMo Guardrails microservice container was sunset as of October 1, 2026, and NVIDIA says there will be no new releases and that the artifact is no longer supported. Build on the open-source library (the nemoguardrails package, currently at release 0.25.0) or the guardrails server, and check the current NeMo Guardrails documentation for the supported install path. Do not plan around the NGC container without a written answer from NVIDIA. NVIDIA's archived NeMo Microservices notice asks existing users to contact their account team, so ask that question in writing as well.

The NeMo Platform repository named in NVIDIA's sunset notice now resolves to NVIDIA-NeMo/nemo-helix, an Apache-2.0 control plane that runs NeMo Guardrails as inference gateway middleware. That is a different architecture from an in-process Presidio rail or a server you operate yourself. If your team is considering it, evaluate it as a separate decision covering gateway placement, the models it fronts, and who operates it. Also check the LLMRails class: release 0.25.0 deprecates it in favor of Guardrails, with removal planned no earlier than 0.27.0, so any integration code you write now should target Guardrails and follow NVIDIA's 0.25 migration guide.

For each detector, confirm with the vendor and for the exact version you will deploy: container image names and tags, GPU requirements and memory, model licenses and whether they permit your use, and the languages and PII categories covered. Presidio depends on spaCy models that you download and approve, GLiNER-PII and Private AI have their own image, hardware and licensing terms, and coverage for non-English text can differ sharply. Ask for a written statement of what each component sends over the network, including any telemetry, and test that claim on your own network. Record the answers as part of your change record, because they will change between releases and your auditors will ask which version was tested.

Questions buyers ask before hiring help with self-hosted PII detection

What drives the cost and effort of a self-hosted PII build?

Cost follows four choices: the detector, the quality of your test data, the retrieval scope and the logging controls, plus GPU capacity if you run local models. The NeMo Guardrails library is licensed under Apache 2.0, so the software carries no license fee. The spending goes to people and infrastructure:

  • Detector choice: Presidio runs in process, while GLiNER-PII and Private AI add containers that need their own sizing, patching and support checks.
  • Test data: Representative samples from your production documents take longer to assemble and label, but they reduce tuning rework later.
  • Retrieval scope and logging: Each knowledge source that passes through PII rails, and each trace store, adds integration and retention work.
  • GPU sizing: Local model inference depends on the accelerator capacity your models need, which your infrastructure team should confirm before procurement.
Which costs are one-time and which recur after go-live?

Discovery, entity list design, rail integration, tuning against test data and the initial evaluation are one-time costs. Recurring costs are the compute for detector containers, the time spent reviewing false positives, log storage and retention, and the upgrades that follow new releases. NeMo Guardrails 0.25.0 deprecates the LLMRails class in favor of Guardrails, with removal planned no earlier than 0.27.0, so budget for that migration in the second year. Ask any quote to separate these two groups and to state whether ongoing support, upgrades and continuous testing are priced as a retainer or left out of scope.

How long does a self-hosted PII detection project take?

The duration depends on scope and test data, not on a fixed template. The main variables are the number of channels covered (input, output and retrieval), the number of entity types, the size and labeling status of your test set, how long your environment access and security approvals take, and whether you need a masking mode, a blocking mode or both. A project with a small entity list and ready test data moves faster than one covering many languages, retrieval sources and audit evidence. Ask for a schedule tied to written milestones, with each milestone naming the evidence it produces, so that delays are visible early.

What must our team provide before a PII detection build starts?

Your team needs to provide four inputs before the work starts:

  • Data samples: Representative prompts, responses and documents that show the personal data your assistant actually sees, with the sensitive cases labeled.
  • Entity list: The categories you must detect, such as names, account identifiers or medical record numbers, and the action for each one, whether block or mask.
  • Security and compliance requirements: Data residency rules, logging and retention limits, and any evidence your assessors will ask for.
  • Environment access: Approved hosts or cluster namespaces, container registry access, and a named contact who can approve network and GPU changes.
Can an internal team build self-hosted PII detection on its own?

An internal team with Python and container experience can build a first version, and the NeMo Guardrails documentation covers configuration, Colang and the server. Teams usually ask for help in three places. The first is tuning, because name and identifier false positives take iteration against labeled data. The second is operating the detector containers on GPU hardware, including support status and upgrades. The third is producing evidence that a security or compliance reviewer will accept. Colang 1.0 to 2.x conversion also needs manual review after the convert tool runs. DeployOpen implements, hardens and documents these systems inside your own infrastructure, so you can decide which of these parts to keep in house.

Does a self-hosted PII detector replace a cloud PII API or run beside it?

Either pattern works, and the right choice depends on the data categories and the data handling terms you must meet. Many teams run the self-hosted detector for the categories where data must stay inside their network, and keep a cloud service for categories they accept sending outside. Others move entirely on-premises once accuracy testing shows the local detector covers their entity list. Before deciding, confirm coverage for each category in your test set, document where any remaining cloud calls happen, and confirm what each provider retains. Running both in parallel also gives you a comparison dataset during cutover.

How do we ask for a fixed-scope quote for PII detection?

DeployOpen does not publish a price list. A quote follows from a written scope, and most engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts. To request one, send the rails you need on input, output and retrieval, the detector options you are considering, the entity list, the size of your test set, the target environment and the evidence you need. Ask the quote to list exclusions, the acceptance criteria for each deliverable, the retesting included and the handover items. If you want ongoing support, upgrades or continuous testing, ask for those as a separate retainer so you can compare them with the build.

How DeployOpen scopes and delivers self-hosted PII detection

DeployOpen approaches self-hosted PII detection with NeMo Guardrails as a written, fixed-scope engagement inside your own infrastructure. We agree which detectors, rails and data paths are in scope, build them in your environment, and hand over configuration, tests and runbooks your teams can review and operate.

How we scope

  • Map every prompt, response and retrieval path where personal data may appear, and record which rails apply to each.
  • Decide with you whether Presidio, local GLiNER-PII containers or a containerized Private AI server fits each data path.
  • Agree in writing which entities, languages, block or mask behavior and logging settings are included before work starts.

How we build

  • Install and configure the chosen detectors inside your network, with no personal data sent to external PII APIs.
  • Write the config.yml, Colang files and any custom actions for input, output and retrieval rails, tested against your own sample data.
  • Test false positives on names and identifiers, and tune score thresholds and regex patterns against documented expected results.

How we hand over

  • Deliver the configuration repository, deployment artifacts and a record of which detectors process which data, for your security and compliance reviewers.
  • Document trace, log and telemetry settings so that content capture and retention are configured as agreed.
  • Run a walkthrough with your engineering and security teams and provide runbooks for updates, rollback and detector failures.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Retainers can cover NeMo Guardrails version upgrades, including the Colang and configuration changes they require.
  • Confirm during scoping how model updates, detector updates and retesting will be handled and who approves them.

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.