Why multilingual refusal messages matter in NeMo Guardrails
Multilingual refusal messages return a blocked response in the user's language, so a person who writes in Spanish, Japanese or Arabic can read why their request was stopped. Consider a team whose assistant serves users in several languages while every refusal still appears in English (illustrative). Those users retry, abandon the session or open a support ticket, and the team cannot tell whether the rail or the assistant is at fault. Making this work depends on two things the team must plan for: language detection that identifies the language of the blocked message, and a language detection model that NeMo Guardrails fetches before it can respond. Both affect the first request after startup and any environment without outbound internet access.
A single default refusal is enough when the assistant serves one language, the users share it, and the people who read blocked-request logs also read that language. An internal tool for an English-speaking engineering team is a typical case, and the refusal text can stay in the default configuration with no added components. Localized refusals start to matter when users write in other languages and the refusal is their only signal of what happened. They also matter for review. A support analyst or compliance reviewer looking at a Japanese prompt beside an English refusal may not see why the rail fired. Decide language by language, by asking who sees each refusal and who reviews the logs.
Before committing, confirm three things against the NeMo Guardrails version you will run. The current release is 0.25.0, and the NeMo Guardrails documentation is the place to check the supported language list and how custom messages are keyed by language. Also confirm the source and size of the detection model, whether it is fetched at first use, and whether your staging and production networks can reach that source. If they cannot, pre-warm the model in a startup step or bundle it into the container image, then test the first blocked request after a cold start in each target language. The model handling is where most of the delivery effort sits, so raise it early with your platform team.
Refusal language options and when each fits
This table compares three ways to word refusals: built-in localized texts, custom messages per language, and one fixed refusal for everyone. Read each row for what the option asks of your team and the situations where it fits. The main takeaway is that the built-in option depends on the current supported language list, which you should confirm in the NeMo Guardrails documentation before you commit to it.
| Option | What it requires from your team | When it fits |
|---|---|---|
| Built-in localized refusal texts | Confirm the current supported language list in the NeMo Guardrails documentation. Review the shipped wording with a native speaker before launch. Test each supported language with unsafe prompts. | Your user languages are all on the supported list and the default wording suits your tone and policy. |
| Custom refusal messages per language | Write and maintain refusal text for each language, including translation review, version control and a process for updates when policy changes. Test each message in its language. | You need wording that matches your brand, legal disclaimers or escalation paths, or you serve languages the built-in set does not cover. |
| One fixed refusal for all users | Write a single message, usually in one language, and decide how it reads to users who do not understand it. Little translation upkeep, but confirm the message is acceptable across markets. | Your user base is mostly one language, or a neutral message with a support contact is acceptable for every locale. |
| Hybrid: built-in for supported languages, fixed fallback for others | Maintain a fallback message and confirm which languages route to the built-in texts. Test the boundary between the two paths. | Most users fall within the supported list but a long tail of languages must still receive a clear refusal. |
How the language check runs before a refusal is sent
The language check runs only after a rail has decided to block a request, and it decides which words the refusal uses, not whether the request is blocked. When an input rail, dialog rail or output rail stops a message, the framework produces a refusal, detects the language of the user's message, and selects the refusal text for that language. If no text exists for the detected language, the refusal falls back to a default message. The block decision itself is made by the rail's own checks, such as a self-check prompt, a safety model or a classifier, so a language-specific refusal does not change what gets blocked.
In the request flow, the blocking rail sits before the application model. An input rail that blocks means the application LLM is never called for that turn, so the refusal is generated from configuration rather than from a model response. An output rail that blocks runs after the application model has already produced text, so the refusal replaces that text. Your architecture therefore affects where the language detection input comes from: for input blocks it is the user's raw message, and for output blocks it may be a response the user wrote in a different language than the one the model produced. Test both paths separately.
Confirm the exact precedence rules and fallback behavior in the NeMo Guardrails documentation for your configuration style, Colang 1.0 or Colang 2.0, because the two styles define refusal messages differently and Colang 1.0 is the default. Check which language is used when detection is uncertain, short messages are mixed-language, or a message contains only code or names. Ask your team to confirm whether a configured default applies to every unmatched language and whether any refusal can be overridden by a dialog flow. Document the answers before you write refusal tests, since they determine what a non-English user actually sees.
Request flow from a blocked message to a localized refusal
The flow starts when a user message reaches the guardrails runtime, where input rails evaluate it before anything reaches the application model. If a rail blocks the message, the language detection component identifies the user's language and the runtime returns a matching refusal, or the fallback message when no match exists. Allowed messages pass to the application LLM. When reviewing the design, check the trust boundaries between the user, the guardrails runtime and the application model, and confirm where the detection model is cached.
Blocked messages get a localized refusal; allowed messages go to the application model.
Setting up multilingual refusals in a self-hosted deployment
This sequence takes a self-hosted NeMo Guardrails deployment from a pinned library version to refusal messages in each target language that work without internet access. It covers the Python check, configuration, language detection, model pre-download and verification, so the team can show each step was tested before the container ships.
Confirm the Python version and pin the release
Check that the build host or base image runs Python 3.11, 3.12 or 3.13, the versions the 0.25.0 release requires. Pin the release version in your dependency file so every build installs the same library. The platform engineer owns this step, and it is done when the version check inside the build image reports a supported Python version and the pinned release appears in the lock file.
Install the library in an isolated environment
Create a virtual environment or a dedicated image layer and install the nemoguardrails package from PyPI at the pinned version. Install it in the same environment that runs your application or guardrails server, so the refusal path uses one Python runtime. The step is done when a short script imports the library and reports an installed version that matches the pin.
Set up the configuration folder
Create a configuration folder with a config.yml file, the Colang files your rails need, and any Python actions. Colang 1.0 is the default, so confirm which Colang version your team uses before writing any flows. Follow the NeMo Guardrails documentation for the layout that matches your version. The step is done when the guardrails server starts, loads the folder without configuration errors and returns a response to a test request in English.
Define refusal messages for each target language
Write refusal text for each language your users need from the nine languages NeMo Guardrails supports, and place each message in the configuration location that your version's documentation specifies. Have a native speaker in your organization, or a reviewer you trust, check each translation so the meaning matches the English policy text. Keep messages short and free of internal policy details. The step is done when a reviewer signs off each language file and an English test input returns the English message.
Install and test the language detection dependency
Add the fast-langdetect package to the dependency set and record the version the environment resolves. This is the component that fetches a model on first use, which is why the next step exists. Run detection on one short sample per supported language and confirm the expected language code comes back. Log short or mixed-language inputs so you can see where detection is least certain. The step is done when every sample detects correctly.
Pre-download the detection model into the build
Trigger the detection model download during the image build so the model is stored in the image rather than fetched when the first user writes a prompt. If the container runs as a non-root user or with a read-only file system, set the model cache location explicitly, and confirm the cache path and environment variables in the fast-langdetect documentation. The step is done when the container runs with outbound network access disabled and a supported-language prompt returns its refusal without a download error.
Verify refusals in each language and the fallback
Build a test set with prompts in each supported language that your configured rail refuses, plus one unsupported-language prompt and one input the detector cannot classify. Confirm first that the rail blocks each prompt, then record the detected language and the refusal text returned. The step is done when each language returns its own message, the fallback cases return the default message you defined, and the test set is saved so it can be rerun after every upgrade.
Security and data handling for language detection
Language detection adds a component that reads user text, writes a model file to disk and returns text that users will read. The cards below cover where that data goes, who can change the cached model, how localized refusals and logs are reviewed, and how each language is tested before release.
Whether user text leaves the network
Language detection runs on the text a user typed before any refusal is chosen, so it belongs in your data flow review. Confirm for the library version and configuration you use whether that text stays in local memory or goes to any outside service. If your policy requires that no user text leaves your network, verify it with egress monitoring from the running container, and do not rely only on the documentation.
Model cache location and permissions
The detector downloads its model file on first use unless the file is already present, so the cache directory becomes a writable path in production. Confirm where the library stores the file in your image, which user the process runs as, and whether that directory is writable at runtime. Make it read-only for the application account once the model is in place, so a compromised process cannot swap the model.
Supply chain for model artifacts
A downloaded model file sits in your refusal path, so treat it like any other dependency. Pin the library version, record the artifact hash, and fetch the file from an internal mirror or bake it into a reviewed image. Confirm with the library maintainers where the download comes from and whether it is signed or checksummed, then record the answer for your change board.
Reviewing localized refusal text
Translated refusals can reveal policy details that the English message kept vague, such as a blocked category, a threshold or a keyword list. Have a reviewer who reads each target language check that every message is generic and points the user to a safe next step. Keep the mapping from category to message in version control so changes receive the same review as policy changes.
Logging blocked messages in each language
Blocked-message logs often store the original text, and non-Latin scripts can carry personal data that simple search filters miss. Decide whether to log the raw prompt, a hash, the detected language code or only the rule that fired. Confirm retention periods with your privacy team and check that log pipelines keep UTF-8 text intact without truncation or garbled characters.
Testing refusals with unsafe prompts
A language the detector handles well can still produce the wrong refusal, or no refusal, when the prompt is unsafe. Build a test set of unsafe prompts in each supported language, plus short and mixed-language inputs, and assert both the block and the returned message. Run the tests in the same container image you ship, because the cold-start path is part of what you test.
NeMo Guardrails docsConnected, pre-warmed or bundled: choosing a model delivery path
In a connected environment, the language detection model is downloaded the first time the guardrails process needs it. This is the fastest path to a working demo on a developer laptop or in a cloud container with outbound access, and it requires the least build work. The cost is that the first refusal in a fresh process pays the download and load cost, so the first user request after a restart can be slow or time out.
- Steps: Install the package, start the guardrails server or Python process, and send one non-English test prompt to trigger the download.
- Maintenance: Little beyond keeping the NeMo Guardrails version pinned, since the model is fetched from the default source at runtime.
- Dependencies on egress: Confirm the host can reach the model source over the network you permit, and record the exact source the team relies on.
- Failure to test: A cold first request that times out or returns an error while the model loads, then succeeds on retry.
- Ephemeral containers: If containers are recreated often, every new instance repeats the download, so check whether that cost is acceptable.
Confirm with your platform team whether outbound access to the model source is allowed from production, and whether the first-request delay meets your user experience and monitoring expectations.
A pre-warmed image runs the model fetch during the container build, so the model is already present when the container starts. This removes the network dependency from runtime and moves it into the build pipeline, where it can be logged and reviewed. The team then owns the image lifecycle, since the model is only as current as the last rebuild.
- Steps: Add a build step that loads the language detection model once, confirm the cache location is inside the image layer, and run a non-English refusal test during the build.
- Rebuild schedule: Rebuild when the NeMo Guardrails version, the detection library or the model changes, and keep the build reproducible with pinned versions.
- Verification: Record the model identifier and a checksum in the build output so the deployed image can be traced back to a known model.
- Cache path: Confirm the library's cache directory and make sure the non-root runtime user can read it.
- Failure to test: A build that succeeds while the runtime image lacks the cached model because the path or user differs, which still produces a cold start.
Ask your platform team to confirm the build host can reach the model source during image builds, and who approves changes to pinned model versions.
On an air-gapped or offline site, the model file must arrive through a controlled path and be loaded without any network call. The team mirrors the model into an internal artifact store, verifies it against a recorded checksum, and points the runtime at the bundled copy. This path gives the security team the strongest control over what enters the environment, but it adds a transfer and approval step for every model update.
- Steps: Obtain the model on a connected host, record its checksum, transfer it through your approved media or transfer process, and place it in the runtime image or a mounted volume.
- Mirror updates: Assign an owner for the internal store and a schedule for reviewing new model releases, since nothing updates automatically.
- Checksum verification: Verify the checksum at import and again at deployment, and store the expected value in version control next to the configuration.
- Offline configuration: Disable any network fallback in the runtime environment so a missing file fails visibly rather than reaching out.
- Failure to test: A deployment where the bundled file is missing or corrupted, which should fail at startup or on the first non-English request with a clear error, not silently fall back to English.
Confirm with your security and compliance teams how model artifacts must be approved, scanned and recorded before they enter the site.
Limits to confirm in your environment
Multilingual refusals depend on a language list, a detection dependency, a customization model and a release line that each change how the feature behaves. Confirm each item with the vendor documentation and your own tests before you commit a user-facing message to production.
Supported language list
Confirm the exact set of languages the release returns refusals in, and compare it with the languages your users actually write in. Check the vendor documentation for the current list, then run a refusal test in each language that matters to your user base, including regional variants and mixed-language messages. A language missing from the list is a gap you must cover with your own design.
NeMo Guardrails docsBehavior outside the supported list
Find out what the feature returns when it detects a language it does not support: the default refusal in another language, a fallback to the configured text, or no refusal at all. Test short prompts, code-switched prompts and languages the detector may misidentify. Decide whether a generic fallback message is acceptable for your assistant.
Custom messages override or extend
Confirm whether a custom refusal message replaces the built-in text for every language or only for the languages you define. Check how a custom message interacts with the built-in translations, whether placeholders are supported, and what happens to languages you did not translate. Record the configuration key you rely on so a later upgrade does not silently change it.
Detection dependency compatibility
Verify that the language detection package installs on your Python version and in your container base image, including architectures used in your build pipeline. Confirm the detection model is downloaded at first use and whether that download can run in your network. Check that the version you pin is compatible with the NeMo Guardrails release you deploy.
- Supported Python
- 3.11 to 3.13
Guardrails server image status
The NeMo microservice container has been retired, so confirm which image you will run for the guardrails server and whether NVIDIA still publishes and supports it. Ask your NVIDIA account team or check the NGC catalog for the artifact's status. If you build your own server image from the open-source Dockerfile, own the patching and rebuild schedule yourself.
NGC guardrails containerBehavior changes between releases
Test refusal text, language detection and configuration parsing on every release you plan to move to, not only the latest. Read the release notes and migration guide for changes to messages, the Colang version and deprecated classes. Keep a regression set of prompts in each language and rerun it before every upgrade.
- Current release
- 0.25.0
Cold start, container images and how to size the first request
The first localized refusal in a fresh container can be slow because the language detection model may not be in memory or on disk when the first non-English request arrives. If the model is loaded or fetched lazily, that cost lands on a user request instead of on process start. This matters for three controls: health checks, readiness probes and autoscaling. A readiness probe that only confirms the HTTP server is listening will admit traffic before the localized path is warm. Confirm in the NeMo Guardrails documentation and the fast-langdetect project whether loading happens at import, at startup or on first call. Then set the readiness check to send a benign prompt in a language you serve, and size minimum replicas so that scale-out during a traffic spike does not add cold starts to live users.
Pre-warming at build time means the model is written into the image, so the container can answer localized refusals without outbound access at startup. The cost is a larger image, a rebuild and redeploy whenever the model or the library changes, and a registry that must hold the bigger artifact. Runtime download keeps images small and lets you update the model without rebuilding, but every new pod depends on outbound access to the model host, may fail under an egress policy, and makes the first request on each node pay the download. Neither option is right for every estate. Connected clusters with frequent releases often favor runtime download with a shared cache volume. Offline or tightly egress-controlled sites usually need the model baked in or mirrored internally.
Measure cold start in the environment you will run, not on a developer laptop. Use the same node class, storage, network policy and security context, then start fresh pods and record the time to ready and the time to the first localized refusal, repeating across several nodes. Confirm the library's model cache location in its documentation, and check that the path is writable under your pod security settings, or mount a volume at that path so the cache survives restarts. Ask the maintainers or your platform team which model files are fetched, their approximate size and the license that governs them, because those figures drive image size and registry planning. Keep the results with your deployment record so future upgrades can be compared against them.
Questions buyers ask about multilingual refusals
What drives the cost of localized refusal messages?
Cost comes from the human work around the code, not from the NeMo Guardrails library, which is licensed under Apache 2.0. The main components are translation and review of each refusal message by a fluent speaker who can judge tone and policy meaning, testing of each language against your own unsafe and borderline prompts, and packaging work for container images and offline sites. Costs that recur include re-review when the approved wording changes and re-testing after each upgrade. Ask any quote to itemize translation review, per-language test work, image and offline packaging, and CI changes separately, and to state which items are one-time and which recur.
How long does multilingual refusal work take?
The timeline depends on the number of languages, the approved wording you already have, and the network conditions of your deployment. Each added language adds review and test cycles, and air-gapped sites add work because the language detection model must be bundled in advance rather than downloaded on first use. If your CI already builds the guardrails server image and runs tests, the change is smaller than starting from nothing. Ask for a written schedule that separates wording review, test authoring, packaging for each environment and sign-off, and confirm the schedule against your change calendar before work starts.
What must our team provide before work starts?
Three groups of input are needed before anyone writes code. First, the list of languages you must support, confirmed against the language list in the NeMo Guardrails documentation for the version you run, so nothing is assumed. Second, approved refusal wording for each language, signed off by the people who own your content policy, plus any terms that must never be translated. Third, access to the artifacts and networks the build needs: package repositories for Python 3.11, 3.12 or 3.13, your container registry, the location where the language detection model is fetched, and a test environment that matches production network rules. Also provide a set of unsafe and borderline prompts in each language.
Can our internal team localize refusals without outside help?
Yes, if the team has Python and CI experience, can get a fluent reviewer for each language, and has a test set that covers the policies that matter to you. The work splits into four parts: choosing and reviewing the refusal wording, writing per-language test prompts, changing the configuration and server image build, and bundling or pre-warming the language detection model for containers and offline sites. Most teams struggle with the second and fourth parts because they need realistic adversarial prompts and tests that run without internet access. An external partner usually takes the work as a fixed-scope engagement with written deliverables, and can also support upgrades on a retainer. Either way, keep the wording and test set in your own repository.
What happens when a user writes in a language we do not support?
The answer depends on how your configuration handles unrecognized languages, so confirm that behavior in the NeMo Guardrails documentation for your version and test it directly. Common approaches are a refusal in a fallback language you have reviewed, such as the language of your product's interface, or a short refusal in a language-neutral form that points users to a support channel. Whichever you choose, the fallback wording needs the same review as the others, and you should test that unsupported input still reaches the safety rails and is still blocked. Do not let an unclassified language bypass input checks because the detection step failed. Record the decision in your policy so auditors and support teams see the same behavior.
How should we retest refusals after each upgrade?
Retest refusals on every version change, because a new release can change prompts, configuration handling or the language detection path. NeMo Guardrails 0.25.0 deprecates the LLMRails class in favor of Guardrails, with removal planned no earlier than 0.27.0, and NVIDIA publishes a migration guide for 0.25. Colang conversions made with nemoguardrails convert still need manual review. Keep a per-language suite of unsafe, borderline and benign prompts in version control, run it in CI against the built server image, and compare refusal text and block decisions with the previous release. Read the release notes before each upgrade and schedule the retest as part of the change, not after deployment.
How do we handle the language detection model in containers and offline sites?
The language detection model is downloaded the first time it is needed unless you prepare it in advance, so a container that starts on a network-restricted host can fail or delay its first refusal. The fix is to pre-warm the model during the image build or to bundle it into the image, then verify the result on a host with no outbound access. Confirm the model source, license and version with the fast-langdetect project and the NeMo Guardrails documentation before you mirror it internally. Add a startup test that sends a prompt in each supported language and checks the response, so cold starts show up in CI rather than in production. Record the model version in your software bill of materials.
How DeployOpen scopes and delivers multilingual refusals
DeployOpen treats multilingual refusals as a configuration and hosting decision, not only a message translation task. We confirm which languages your users write in, how refusal text is set and where the language detection model comes from in your environment, then build and test the behavior before handover. Engagements are fixed-scope, with the work agreed in writing before it starts.
How we scope
- Confirm which of the supported languages your users need, and which fall back to a default refusal message.
- Agree the refusal text per language, including who approves wording for legal and policy review.
- Record where the fast-langdetect model will come from: internet download, pre-warmed image or offline bundle.
How we build
- Configure custom refusal messages in the NeMo Guardrails configuration for each rail that blocks a request.
- Pre-warm or bundle the language detection model in your container images or offline site before go-live.
- Test refusals with sample prompts in each language, including mixed-language and unsupported-language inputs.
How we hand over
- Deliver the configuration files, refusal message catalog and container build steps in your repository.
- Document the cold start behavior observed in your environment and the steps to repeat the model warm-up.
- Walk your platform and security teams through the test cases and how to add a new language later.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer after handover.
- Review refusal behavior when NeMo Guardrails releases a new version, such as checking changes to the configuration format.
- Retest refusal messages after changes to models, rails or the container base image.

