When Private AI masking fits NeMo Guardrails
Choose Private AI masking when your LLM application must not send personal data to a third-party detection service, yet a plain block would break the user experience. A containerized Private AI server, running inside your own network, can sit behind the sensitive data rails in NeMo Guardrails so that personal data is replaced before it reaches the model, is returned to the user, or enters the prompt from retrieved content. Blocking remains the better fit when a request containing personal data should never be answered at all. The integration is a detection and masking step, not a guarantee: it finds what its entity models recognize, and it will miss some identifiers and flag some that are not personal data.
The practical question is coverage. Private AI publishes its supported entity types, and you should confirm that list against the categories your data actually contains, such as names, account numbers, national identifiers, dates of birth or health information. Do not assume that a supported label means accurate detection in your language, document format or domain. Build a test set from representative prompts, model responses and retrieved chunks, including the messy cases such as OCR text, abbreviations and identifiers in tables. Record the misses and false positives on each rail separately, because input, output and retrieval rails usually need different thresholds and different fallback behavior.
Before you commit, confirm three things with Private AI and in your own environment. First, the deployment model and licensing terms for the containerized server in your infrastructure, including whether any telemetry or usage reporting leaves your network. Second, how the server handles the text it receives, including what is stored, logged or cached, since that determines whether masking alone protects you. Third, that the NeMo Guardrails version you run supports the integration you plan to use, because the NeMo Guardrails releases page shows frequent changes. Treat the answers as inputs to your own data protection assessment rather than as assurances.
How a request passes through Private AI rails
The diagram starts with a user prompt entering the NeMo Guardrails input rails, where the Private AI server inside the client network detects and masks personal data before anything reaches the LLM. The masked prompt goes to the model, and retrieved chunks pass through retrieval rails with the same check before they join the prompt. The model response then passes through output rails, which mask any personal data before the user sees it. The dashed trust boundary marks the point where original personal data is supposed to stay inside your network, so confirm which hops, if any, leave it in your own configuration.
Personal data is detected and masked at each rail before it reaches the LLM or the user.
Cloud versus containerized Private AI deployment
In the cloud-hosted option, the guardrail sends text to an API endpoint operated by Private AI, and the detection runs on infrastructure you do not control. Your team configures the API key, the endpoint and the request handling in NeMo Guardrails, while the vendor manages the service, scaling and model updates. The data leaves your network, so the security review centers on where that processing happens, how long any copy persists and what the vendor contract commits to.
- Data path: Prompts, responses or retrieved chunks are transmitted to the vendor endpoint before the rail returns a masked or blocked result.
- Operating ownership: Availability, patching and model upgrades belong to the vendor, while your team owns the calling configuration and the key.
- Residency: Data location depends on the vendor's regions and sub-processors, which must be confirmed against your residency obligations.
- Credentials: Long-lived API keys must be stored in your secrets system and rotated on a schedule your policy sets.
Before committing, confirm the endpoint hostname, the regions where processing occurs, data retention and deletion terms, and the licensing terms for commercial use.
In the containerized option, Private AI runs as a container image inside infrastructure you control, and NeMo Guardrails calls it on a private address. Text stays inside your network boundary, which makes the deployment easier to show to security and compliance reviewers. The trade-off is that your platform team takes on hosting, sizing, patching and upgrades, and the image must be pulled through a process you can audit.
- Data path: Text is sent only to a container address on your internal network or cluster, and no detection call leaves your environment.
- Operating ownership: Your platform team owns the host, the container lifecycle, the resource limits and the update schedule.
- Residency: Data stays in the locations where you host the container, which simplifies residency statements in your records.
- Supply chain: Image provenance, pinned tags and internal registry copies become part of your change control.
Before committing, confirm the container image name and registry, the supported tags, the hardware and resource requirements, and whether the license permits self-hosting in your environment.
The choice usually follows from data classification and operating capacity rather than from detection quality alone. If the content your assistant handles includes regulated personal data that your policy keeps inside your boundary, the containerized server aligns better with that rule. If your team lacks capacity to run another stateful service, a managed endpoint may be acceptable once the contract and residency terms are reviewed. Some organizations use the container for regulated workloads and reserve the endpoint for less sensitive ones, but that split adds configuration and audit work.
- Classification first: Map which assistants, knowledge sources and logs contain personal data before choosing a deployment.
- Capacity check: Estimate who will patch, monitor and restart the service after go-live.
- Mixed use: Separate configurations per workload create additional rails to test and document.
- Exit planning: Consider how quickly each option can be replaced if licensing or vendor terms change.
- Review trigger: Reassess the choice when your data categories or regions change.
Settle the classification and ownership questions with your security and compliance leads before selecting the deployment model.
Configuration options and when each fits
This table compares the main choices when wiring Private AI into NeMo Guardrails: where the rail sits, whether it blocks or masks, which entities it targets, and how confidence is set. Read each row as a decision, then check the setting against the 0.25.0 documentation before you rely on it, because placement and action names have changed across releases.
| Decision | Options | Trade-off | When it fits |
|---|---|---|---|
| Rail placement | Input rails, output rails, retrieval rails | Input rails protect the model from personal data in prompts, output rails stop leakage in responses, and retrieval rails clean chunks before they reach the prompt | Use input rails for user-entered data, output rails for model-generated leakage, and retrieval rails when knowledge bases hold personal records |
| Behavior on a match | Block the request or mask and continue | Blocking is strict but interrupts users, while masking keeps the flow going yet the model still receives the unmasked text if the rail runs after the call | Block when personal data must never reach the model, mask when the task still works without the identifier |
| Entity selection | Built-in Private AI entity types or a restricted list | A broad list catches more but raises false positives on names and reference numbers, a narrow list misses categories your policy requires | Start from the categories your data classification defines, then test the list against sample traffic |
| Confidence threshold | Lower or higher minimum score for a detection | Lower values catch more personal data and flag more harmless text, higher values reduce noise and let some matches through | Tune on a labeled test set per entity, and confirm the parameter name and default in the 0.25.0 docs |
| Masking format | Placeholder tokens or redacted values | Placeholders keep sentence structure for the model, while full redaction hides more but can confuse downstream answers | Use placeholders when the model must still reason about the entity type |
| Server connection | Cloud endpoint or containerized Private AI server | A containerized server keeps text inside your network, while a cloud endpoint shifts data handling to the provider | Choose the containerized option when data residency rules apply; confirm the endpoint setting in your config |
| Where the setting lives | config.yml versus custom actions | Built-in rail flows and entity settings are declared in configuration, while custom mask logic, extra entity rules or fallbacks need Python actions | Keep standard placement in config.yml and move anything beyond it into reviewed actions with tests |
| Logging of matches | Default logging versus content capture | Verbose logs help debugging but may store the personal data the rail removed | Disable content capture in production unless a documented debugging need exists |
How Private AI compares with Presidio and GLiNER-PII
The key trade-off is between a containerized Private AI server, which adds a separate service to run and license, and open-source detectors that run in process (Presidio) or as a local NIM container (GLiNER-PII). Each option differs on entity coverage, where personal data is processed, what you pay for, and how much operational work it creates. Start by listing the entity types and languages your assistant actually handles, then compare each detector against that list rather than against vendor summaries.
On coverage, Presidio relies on recognizers and spaCy-based models that you configure, so the entity list and language support depend on the recognizers and models you install. GLiNER-PII is a zero-shot model that can be prompted for broader labels, which helps with categories a fixed recognizer list misses, but its results depend on how labels are phrased and on the input type. Confirm with Private AI which entity types, languages and document formats its current container supports, and whether that matches your list. Do not assume that any detector covers the same entities in English, German or a mixed-language transcript.
On data handling and licensing, the question is where the text goes and who can see it. Presidio and a local GLiNER-PII container keep processing inside your network, and their licenses are open source, so the recurring cost is compute and staff time. Private AI is commercial software, so confirm the license terms, any usage-based charges, whether the container sends telemetry or license checks outside your network, and how logs are stored. Operational load also differs: the Private AI container is one more service to patch, scale and monitor, while Presidio runs inside the NeMo Guardrails process. Build your own evaluation set from real, anonymized prompts, retrieval chunks and responses, label the expected entities, and measure misses and false positives for each detector before you choose one.
Connecting a Private AI server to NeMo Guardrails
This sequence takes a Private AI server from deployment to verified masking inside NeMo Guardrails. Each step ends with a check so the team knows it can move on. The result is a configured input, output and retrieval rail that masks personal data before it reaches the model or the user.
Provision the Private AI server
The platform team deploys the Private AI server in the environment you control, either as a cloud deployment in your account or as a container on your own hosts. Before deployment, confirm the image or package, license terms, and API details with Private AI, and confirm the sizing and supported runtime in their documentation. Record the internal address and the port the service listens on. The step is done when the health check described in Private AI's documentation returns a healthy status from the server itself.
Confirm network and TLS reachability
The network team opens the path from the NeMo Guardrails host to the Private AI endpoint in the firewall and security groups, and confirms name resolution from that host. If the endpoint uses TLS with an internal certificate authority, install the CA certificate in the trust store used by the Python runtime. Test with a simple authenticated request run from the guardrails host, not from a workstation. The step is done when that request succeeds with certificate validation enabled, and the test is repeated from the same host the production service will use.
Install Python and NeMo Guardrails 0.25.0
The application team creates an isolated virtual environment on the guardrails host using Python 3.11, 3.12 or 3.13, which NeMo Guardrails 0.25.0 supports. Install the library at the pinned version, nemoguardrails 0.25.0, from PyPI, and record the exact versions of its dependencies in your build artifacts. Do not deploy the NeMo Guardrails microservice container, because NVIDIA has sunset the NeMo microservices as of October 1, 2026. The step is done when the interpreter reports a supported version and the installed package reports 0.25.0.
Configure the Private AI rail in config.yml
The engineer who owns the guardrail configuration adds Private AI to config.yml, enabling the input, output and retrieval rails the masking design requires, using the rail definitions in the NeMo Guardrails documentation for version 0.25.0. Keep the endpoint and API credentials out of the file and supply them through environment variables or your secrets manager. Choose the Colang version deliberately, because Colang 1.0 is the default and 2.x requires separate configuration. The step is done when the configuration folder loads without validation errors in a local run.
Load the configuration in the runtime
The engineer loads the configuration folder in the runtime the application will use: the Python API through the Guardrails class introduced in 0.25.0, or the guardrails server that reads the same folder and exposes an HTTP API. The LLMRails class is deprecated in 0.25.0 and scheduled for removal no earlier than 0.27.0, so new code should use the replacement described in NVIDIA's 0.25 migration guide. Start the service and send one benign test request. The step is done when the service returns a normal response and logs show the Private AI rail was invoked.
Verify masking on input, output and retrieval
The QA lead builds a fixed test set of synthetic records containing names, identifiers, and contact details, labeled as illustrative data, and sends them through the input rail, the output rail, and a retrieval path that passes sample chunks into the prompt. Check that each entity is replaced or blocked as the configuration specifies, and that the model receives only the masked text. Confirm that application logs and traces do not contain the raw values. The step is done when every test case passes, and the test set is stored in version control so it runs again after each change.
Security and data handling considerations
Private AI masking moves personal data through several places besides the model call: logs, traces, verbose output, caches and the connection to the Private AI server. The cards below cover where raw values can leak, how to protect the API key, how to segment the network and who can change the guardrails server.
Raw personal data in logs and traces
Before masking, the original prompt or retrieved chunk exists in memory, and verbose logging or traces can write it to disk or to an observability backend. Confirm which NeMo Guardrails logging and content capture settings are enabled in your configuration, and test with synthetic identifiers to see what reaches the log. Check the retention settings in your observability backend, because masked output in the model response does not clean up earlier copies of the raw text.
Cached and verbose responses
Response caching and verbose debug output can keep unmasked text after the request completes. Decide whether your deployment caches model responses, and if it does, confirm whether the cache key and stored value hold the original or the masked text. Disable verbose output in any environment where real personal data passes through the rails.
Private AI API key handling
The Private AI server is called with an API key, and a leaked key lets anyone run detection against your traffic. Store the key in a secrets manager or the container runtime's secret mechanism, not in config.yml or the image. Rotate it on a schedule you can name, and confirm with your Private AI provider how keys are issued, scoped and revoked.
Network path to the detector
Place the Private AI container on a private subnet that only the guardrails server can reach, and block outbound calls from it to the internet. If you use a cloud-hosted Private AI service instead, confirm the regions, data processing terms and whether requests are retained. Document the path so a security team can verify that personal data never leaves the approved network.
Access control on the guardrails server
The guardrails server loads configurations from a folder and exposes an HTTP API, so anyone who can write to that folder or call the endpoint can change which entities are masked. Restrict write access to the configuration directory through version control and review, and require authentication on the HTTP API at the gateway in front of it. Log who changes a configuration and when.
Retention and review of masking events
Masking events can themselves be sensitive, since entity counts and categories reveal what users submit. Set a retention period for the detector and guardrails logs, limit who can query them, and review the setting after each upgrade. Ask your compliance team which retention rule applies before you enable detailed logging.
Questions buyers ask before connecting Private AI
What drives the cost of connecting Private AI to NeMo Guardrails?
The cost has three parts: the Private AI license, the infrastructure that runs the detector, and the engineering effort to connect and test it. Licensing depends on the Private AI offering and deployment model you choose, so ask the vendor for a written quote tied to your volumes and deployment. Infrastructure is recurring: the containers need CPU or GPU capacity, memory, storage for logs, and a network path from the guardrails server. Engineering effort is largely one-time, covering configuration of input, output and retrieval rails, tuning of entity choices and thresholds, and testing against your own data. Ask for each part to be quoted separately so you can see what recurs.
How long does setup and evaluation take for Private AI with NeMo Guardrails?
Duration depends mainly on how many rails you apply, how many entity types you need, and how much test data is available. A single input rail on one application with a clear entity list is a much smaller job than input, output and retrieval rails across several assistants with custom identifiers. Evaluation usually takes longer than configuration, because false positives on names, identifiers and free text need review against representative samples. No fixed duration applies to every environment, so ask any partner or internal lead to break the schedule into configuration, integration, testing and sign-off, and to state what each phase assumes about your data and approvals.
What does the work need from our team before it starts?
Plan for four inputs. First, representative data samples, including prompts, responses and retrieved documents, with any personal data handled under your existing data handling rules. Second, network access: the guardrails server must reach the Private AI endpoint, and you must confirm whether that endpoint sits in your network, a container you run, or a vendor-hosted service. Third, security approvals for the container image, the service account or API key, the logging configuration and the data flows. Fourth, named owners for the entity policy and for sign-off on false positives. Confirm each item with your security team early, because approvals often set the schedule more than the code does.
Can our internal team connect Private AI to NeMo Guardrails on its own?
Yes, a team with Python and container experience can do it, provided it has time to run the evaluation properly. The configuration itself is documented in the NeMo Guardrails documentation, and the library is open source under Apache-2.0. The harder parts are building a representative test set, deciding entity policy, setting score thresholds, and proving that masking does not break answers. Teams that lack a security reviewer or a test owner often struggle at these points. A partner can take on any part of the work under a written scope, and you can keep the rest in-house.
Does NeMo Guardrails still work well with a self-hosted detector after the microservice sunset?
The NeMo Guardrails library is separate from the NeMo Guardrails microservice. NVIDIA's NGC catalog says the microservices have been sunset as of October 1, 2026, with no new releases, while the library is published on PyPI under Apache-2.0 and version 0.25.0 is the current release. Confirm your deployment target with the library and your own container build, not the retired microservice image. Also confirm the Private AI container version and its support terms with the vendor, because those are separate from NVIDIA's release cycle.
What runtime requirements should engineers check before installing the integration?
Check the Python version first. NeMo Guardrails 0.25.0 requires Python 3.11, 3.12 or 3.13, so an older base image will fail before any PII configuration is tested. Next, confirm the guardrails server can reach the Private AI endpoint over the network path your security team approved, including DNS, TLS and any proxy rules. Then confirm the container resource limits, because detection latency and throughput depend on the hardware the detector runs on. Finally, check the configuration format you are using, since Colang 1.0 is the default and Colang 2.0 is also supported, and the two need different rail definitions.
How do we know the masking works before users depend on it?
Build a test set from your own prompts, responses and retrieved chunks, including the personal data types you must catch and the ordinary text that must pass. Run it through each rail and record misses, false positives and changed answers. Review the false positives with the business owner, since masking a product name or a common surname can reduce answer quality. Repeat the run after any change to entities, thresholds or the Private AI version. Keep the results with the configuration so the evidence can be shown to your compliance reviewers. DeployOpen can plan and run this testing as part of a fixed-scope engagement, with the scope agreed in writing before work starts.
What runs after go-live, and does it recur?
Some costs recur after go-live. The detector container needs capacity, updates and monitoring, and you will pay the Private AI license on whatever terms your contract sets. NeMo Guardrails upgrades, new entity types and changes to the Colang or YAML configuration need regression testing each time. Logs and traces must be checked for personal data, and retention rules must apply to them. Ask any quote to separate one-time implementation from recurring licensing, hosting, support and testing, and to state what each retainer covers. Ongoing support, upgrades and continuous testing are available from DeployOpen as retainers.
Applying masking to retrieved chunks and traces
Retrieval rails are where Private AI masking protects knowledge before it reaches the model. NeMo Guardrails runs retrieval rails on each chunk your retriever returns, so a Private AI detection call can replace personal data in a chunk before that chunk is placed in the prompt. This covers personal data sitting in documents that no user typed into the conversation, which input rails never see. Decide early which chunks are masked, which are blocked, and whether masked text still answers the question well. Confirm which retrieval rail entry points your installed release exposes in the NeMo Guardrails documentation before you wire in the Private AI call.
Masking does not replace access control in the retrieval layer. Filter chunks by the caller's permissions in the retriever first, so the retrieval rail only ever receives documents that user is allowed to read. Then the rail masks what remains. Check that the order holds in your build, because a rail that runs before the permission filter can send restricted text to the Private AI server. Also plan for the source itself: masking a shared index does not stop a user with access to the unmasked source system from seeing raw values. Scope the service account that calls Private AI, and record which roles can read the unmasked source and which can read the masked index.
Unmasked content can reach traces and logs even when the prompt is clean, because the chunk text, the detector input and the detector output all pass through the same process. Review what the framework records on each rail call, and what your Private AI container writes to its own logs, including request bodies and debug output. Keep content capture and verbose logging off in production unless your security team approves them for a specific purpose. Test the path end to end by placing a fake identifier in a test document, then searching every log sink, trace store and error report for that string. The sibling topic on keeping PII out of traces, logs and telemetry covers the settings in detail.
How DeployOpen scopes and delivers this work
DeployOpen approaches Private AI PII masking with NeMo Guardrails as a written, fixed-scope engagement. We plan the Private AI connection, configure the input, output and retrieval rails, and deliver them in infrastructure you control, with testing and documentation your security and compliance teams can review.
How we scope
- Confirm which Private AI deployment you run, cloud or containerized, and where it sits in your network
- Map the input, output and retrieval paths where personal data must be detected or masked
- Agree in writing which entities, block or mask behavior, and logging settings are in scope
- Define what the Private AI server receives, stores and logs, and who reviews it
How we build
- Configure the Private AI connection and NeMo Guardrails rails in a config.yml and Colang files you own
- Test detection on representative prompts, responses and retrieved chunks, including over-matching on names and identifiers
- Check that traces, logs and telemetry do not capture unmasked personal data
- Review results with your team and record each change before it moves to production
How we hand over
- Deliver the configuration, custom actions and deployment files in your version control
- Document the detection coverage, known false positives and the data handling path for each rail
- Provide test cases and results so your security and compliance teams can review the controls
- Walk your engineers through operating, updating and rolling back the configuration
How we support
- Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts
- Plan upgrades for NeMo Guardrails releases, starting from the current release line and its migration notes
- Ongoing support, upgrades and continuous testing are available as a retainer
- Ask any quote to itemize implementation, testing, documentation and retainer work separately

