When self-check input and output rails are enough in NeMo Guardrails
Self-check input and output rails are enough when a team already runs one LLM application, wants blocking on user inputs and model outputs, and does not want to operate a second model service. A self-check rail asks the application's own model to judge a text: the input rail asks whether the user message should be blocked, and the output rail asks whether a drafted response should be blocked before it reaches the user. The model answers in a yes or no style, and the configuration decides what happens next. Among the five rail types NeMo Guardrails provides (input, dialog, retrieval, execution and output rails), self-check input and output sit at the two ends of the conversation, which makes them the lowest-effort starting point: they need prompts and a config.yml entry, not a new model deployment, GPU capacity or a separate serving layer.
The trade-off is that the judge is the same model family that answers users. Its verdict depends on the wording of the self-check prompt, the policy it describes, and how well that model follows classification instructions, so a prompt that works for one model can drift after a model change. Before relying on it, run a set of clearly safe, clearly unsafe and borderline prompts through the rails and record misses and false blocks. Confirm the exact self-check prompt names and default behavior in the NeMo Guardrails documentation for the version you install, because these details have changed between releases.
Self-check options and when each fits
This table compares the four common ways to screen NeMo Guardrails traffic: self-check input, self-check output, both together, and a dedicated safety model or classifier. Read each row for the typical fit, the main cost and the main risk, then confirm the exact configuration keys against the NeMo Guardrails 0.25 documentation for the Colang version you run.
| Option | Typical fit | Main cost | Main risk |
|---|---|---|---|
| Self-check input rail | Short, simple prompts where the application LLM can judge whether a user message is allowed under a few plain rules | One extra LLM call per user message, plus prompt maintenance as policy changes | The same model that serves users also judges them, so crafted prompts can mislead the check |
| Self-check output rail | Checking drafted answers for policy violations before they reach the user, for assistants with narrow answer styles | One extra LLM call per response, which adds latency to every reply, including streamed ones if buffered | Long or complex answers can exceed what the judging prompt handles reliably, producing missed or false blocks |
| Both self-check rails together | Assistants where both user input and model output carry policy risk and the team wants a single, auditable prompt pattern | Two extra LLM calls per turn, roughly doubling guardrail overhead on each exchange | Stacked checks multiply latency and failure points, and a fault in either prompt affects every request |
| Dedicated safety model or classifier on the same rails | Higher volume, multilingual or policy-heavy traffic where a purpose-built judge gives more consistent results than a general assistant model | Separate model hosting, GPU capacity where required, and evaluation of the new judge against your policy | Coverage gaps in categories or languages the model was not built for, and operational load from running a second model |
| Reasoning-based safety model | Custom policies that need a judgment trail and can tolerate slower decisions | Longer responses from reasoning traces and a token budget to tune so decisions complete | A low token budget can end every response before a verdict, blocking all traffic |
| Self-check rails on a reasoning application model | Teams that already run a reasoning model as the application LLM and want no added model | Judging prompts run through a model that spends tokens on internal reasoning, adding latency and cost per check | Verdict parsing can fail when the output format changes, so confirm output handling in testing |
| Evaluation before enforcement | Any option above, before it blocks live traffic | Test set design, labeling and repeated runs whenever prompts, models or policy text change | Skipping evaluation leaves false positives and false negatives unmeasured until users report them |
How a request passes through self-check rails
The request starts at the user and enters the NeMo Guardrails input rail, where the application LLM is asked to judge the prompt in a separate model call. If the judgment flags the input, the request is blocked and the refusal returns to the user without reaching the application model. If it passes, the application LLM generates a draft, which goes through the output self-check as another separate call before the response is released. Check which model serves each judgment call and whether it sits inside your trust boundary.
Each self-check rail makes its own model call before the response is released.
How chaining several self-check rails changed in 0.24
Teams stack self-check input and output rails to screen a user prompt before the application model answers it and to check the reply before the user sees it. Every self-check rail is an extra prompt sent to an LLM, so every rail adds a model call and some latency to the request path. A configuration with two input checks and one output check can add three model calls before a single answer is returned. Before you add a rail, decide which risk it covers, whether a cheaper check or a dedicated safety model could cover it, and how much delay your users will accept.
Chaining several self-check rails changed in the 0.24 line of NeMo Guardrails, and the 0.24.1 patch followed on 16 September 2026. Do not rely on older examples or forum posts for the order in which chained rails run, how a block in one rail affects the rails after it, or how a failed model call is handled. Read the exact chaining behavior in the NeMo Guardrails releases and the release notes for each version you plan to run, and record which behavior your configuration depends on.
Test the chained configuration end to end on 0.25.0, which requires Python 3.11, 3.12 or 3.13. Passing unit tests for each rail on its own does not show that the chain blocks the right inputs, passes the right outputs, or stays within your latency budget. Build a fixed set of benign, borderline and unsafe prompts and responses, and measure the block decisions, the refusal messages and the total time per request. Also update any test code that calls the LLMRails class, because 0.25.0 deprecates it in favor of Guardrails.
Setting up self-check rails with checks at each step
This sequence takes a team from an empty Python environment to a running NeMo Guardrails configuration with self-check input and output rails, and it confirms at each stage that the rails behave as intended before any traffic reaches them.
Install nemoguardrails on a supported Python
The engineer who owns the application installs the nemoguardrails package at version 0.25.0 into a virtual environment on Python 3.11, 3.12 or 3.13, which are the versions the 0.25.0 release supports. Confirm the install by checking the reported package version and importing the library in a clean interpreter. If the install fails on another Python version, change the interpreter before going further rather than working around the error.
Create the configuration folder
Create a configuration folder containing a config.yml file and the Colang files that define your rails. The config.yml file names the model the application uses and lists the input and output rails to run, including the self-check input and self-check output rails. Confirm the layout by loading the folder with the library and receiving no configuration errors. If the team uses Colang 2.x, note now that the migration guide and the convert tool expect manual review of converted files, so plan time for that review.
Point the rails at a model you control
Configure the rails to call a language model that your team hosts or has contracted under terms your security team has approved, because the self-check rails send both user inputs and model outputs to that model. Confirm the connection by sending one test request through the configured model and checking that the response arrives from the endpoint you expect, not from a default provider. Record the endpoint and model name in the change record so reviewers can trace which judge produced each decision.
Write the judging prompts and policy text
Write the self-check prompts that ask the model to judge input and output against your policy, and state the policy categories in plain language the judge can apply consistently. Keep the output format of the judge simple and fixed, such as a single allowed or blocked answer, so the rail can parse it reliably. Confirm the prompt by running a few messages through the judge directly and checking that the answer format is stable across repeated runs.
Test with allowed and blocked examples
Build a fixed set of allowed and blocked examples for input and for output, and run each through the application. Confirm that the rail fires on each blocked example and does not fire on each normal example, and record every mismatch with the prompt version that produced it. Repeat the same set after every change to the prompts, the model or the policy text. Treat a rail that blocks normal requests or passes known violations as a failed step, and do not move on until the mismatches are explained or fixed.
Run the server or Python API
Choose how the application calls the rails: import the Python API directly into the application, or run the guardrails server, which loads the configuration folder and exposes an HTTP API, with a Dockerfile available to build a server image. Confirm the chosen path by sending the blocked and allowed examples through it and checking that the same results appear as in your direct tests. Keep the configuration folder under version control so the deployed rails match the tested rails.
Pitfalls that make self-check rails fail
Self-check rails rely on the application model returning a reliable verdict on every request. The failure modes below share one root: the verdict is produced by a model under cost, latency, adversarial and version pressure, and each needs a test before production.
Reasoning models run out of budget
A reasoning model can spend its whole output budget on hidden reasoning before it writes the yes or no verdict, so the rail gets no usable answer and may block every request. Test a batch of safe and unsafe prompts with the exact max_tokens value you plan to ship, and check that a verdict is returned in every case. Confirm with the model provider how reasoning tokens count against the output limit and whether reasoning can be turned off.
Judging prompts can be talked around
The judge sees the same user text as the application model, so an attacker can write input that tells the judge to answer safe, or wraps the harmful request in a role-play or encoded form. Build an adversarial set that targets the judging prompt itself, including instructions embedded in pasted documents. Confirm that the judge's output is parsed strictly and that an unparseable answer fails closed.
False positives on domain language
A judge tuned on general safety examples may flag legitimate clinical, legal, security or financial vocabulary, such as drug names, exploit terminology or account closure requests. Each false block frustrates users and hides real misuse in the noise. Build a test set of in-domain, legitimate queries and measure the block rate alongside the unsafe set, then adjust the policy text before enabling the rail for users.
Latency grows with each chained rail
Each self-check rail is an extra model call, and rails that run in sequence add their waits together before the user sees a first token. Measure end-to-end time for a typical request with one rail, then with every planned rail enabled, at expected concurrency. Ask whether your inference provider and your hardware can run judge calls in parallel and what the queue depth looks like under peak load.
Output checks see part of a stream
When the application streams tokens, an output rail that checks only the first chunk, or checks chunks without the surrounding context, can pass a response that becomes unsafe later. Confirm how your NeMo Guardrails version handles streamed output, what text the rail judges, and what is already sent to the client when a block fires. Test with unsafe content placed at the end of long responses and in the middle of streamed chunks.
Verdicts drift between model versions
A provider can update a hosted judge model under the same name, and a self-hosted model can be replaced by a new checkpoint, changing where the decision boundary sits. A rail that passed your tests can start blocking or passing differently without any change to your configuration. Pin the model version where the provider allows it, keep a regression set, and rerun it before every model or NeMo Guardrails upgrade.
When to move from self-check to a dedicated safety model
Move from self-check rails to a dedicated safety model when the self-check results stop meeting your bar on your own test set. The trigger is evidence, not preference: consistent false positives on legitimate business prompts, or misses on adversarial or policy-specific cases, that persist after you have tuned the self-check prompts. Three other pressures justify the move on their own. Multilingual traffic often exposes weak judgment by the application model outside its strongest languages. Latency and cost rise because every self-check rail adds an extra LLM call on the request path, and chained rails multiply that. Audit questions also matter: a dedicated classifier or safety model has a documented policy and a fixed output contract, which is easier to explain to a reviewer than a general model judging its own answers.
Changing the judge changes the configuration. In config.yml, the self-check rails (for example self check input and self check output) reference prompts in prompts.yml that ask the application model for a yes or no decision. A dedicated model is wired in as its own model entry, with its own prompt or output parser, and the rail definitions are updated to call it. Confirm the exact model types, prompt contracts and parser settings in the current NeMo Guardrails documentation for your release, because each safety model expects its own format. Also confirm how the new model is hosted, since a self-hosted model adds GPU capacity, serving and patching to your scope, while a hosted service sends request content outside your network.
The choice of model is covered on the sibling pages on safety models, so this section does not compare them. What matters here is the testing burden. Treat the switch as a new configuration: re-run the full evaluation set on the new rails, including the same false positive and miss cases that prompted the change, your multilingual samples, and your adversarial prompts. Compare results per rail and per direction, and record latency at realistic concurrency. Keep the old configuration under version control so you can roll back if the new judge fails on a category it previously handled. Until that evaluation is complete and signed off, the dedicated model is not an enforced control.
Security and operational considerations
A self-check rail hands the application's own model the raw user input and the draft answer, so the judging path carries the same sensitive data as the chat itself. The cards below cover the controls that keep that path reviewable, from hosting and prompts to keys, logs, evaluation data and environment parity.
Data handling of the judging model
Every self-check input or output rail sends the raw user message or draft response to the model that performs the judgment, and that call can be a second request to a hosted provider. Confirm where that model runs, which provider terms apply, what the provider retains, and whether the request crosses a boundary your data classification forbids. If the judge is the same self-hosted model as the application, the data stays inside your network. Review the hosting before enabling the rail, not after.
NeMo Guardrails docsChange control for judging prompts
The self-check prompts in your configuration decide what gets blocked, so editing them changes the security behavior of the application. Store the prompt text in version control, require review for every change, and tie each release to a recorded prompt version. A small wording edit can shift which inputs are refused, so treat prompt changes as control changes that need the same evidence as code changes.
Model access keys as application secrets
The rails call a model endpoint with credentials, and those keys often sit in a config file or environment variable next to the application. Give the judging model its own key where the provider allows it, scope it to the minimum model access, and store it in your secrets manager rather than in the configuration folder. Rotate it on the same schedule as other production keys and confirm which team can read it.
Logs of blocked content
Blocking is only half the job, because logs of refused inputs and outputs often hold the most sensitive text in the system: attempted data exfiltration, personal details a user pasted, or harmful drafts. Decide what the logs record, who can read them, how long they are kept, and whether content is masked before it is written. Ask your team to confirm the default logging behavior in the version you deploy before it reaches production traffic.
Protecting the evaluation set
The test prompts used to measure self-check accuracy usually include real attack payloads and examples of disallowed content, so the evaluation set is sensitive data in its own right. Restrict who can read or copy it, keep it out of general training or debugging datasets, and record the results per prompt version. A leaked evaluation set also tells an attacker which phrasings already slip past the rails.
Identical configuration across environments
A rail that passes in staging can behave differently in production if the model version, prompt text, Colang files or library release differ between environments. Build one versioned configuration package, promote the same artifact through each environment, and vary only the endpoint and secrets. Confirm the library release is pinned in each environment, because a version change can alter how the rails run.
What buyers ask before hiring help with self-check rails
Can our team build self-check rails in NeMo Guardrails without outside help?
Yes, a team with Python experience and access to an LLM can build basic self-check input and output rails from the documentation alone. The library is open source under Apache 2.0, and the config.yml file, Colang files and optional Python actions are all editable in your repository. Outside help tends to matter when the rails must be defended in a security review: you need a labeled test set, documented prompts, verified behavior across languages and a retest after each change. Your team should ask whether it has owners for policy wording, evaluation and ongoing upgrades, because those tasks recur after the first build.
What makes self-check rails take more effort to build?
Effort rises with the number of rails, the number of languages, the complexity of the policy and the depth of evaluation. The main drivers are:
- How many input, output and dialog rails you run, and whether they chain in sequence.
- How many languages users write in, and whether refusals must follow the user's language.
- How detailed the policy is, and how many categories a single prompt must judge.
- Whether evaluation covers only obvious cases or also adversarial and borderline prompts.
- Which Colang version you use, since Colang 1.0 is the default and migrations need manual review.
- How your existing LLM stack and hosting are set up, including the model endpoints the rails call.
How long does a self-check rails engagement take?
The duration depends on the scope agreed in writing, so no fixed timeline applies to every team. Ask for a scoped timeline that lists each rail, each language, the evaluation set and the hosting work as separate items with their own milestones. Ask the provider to state what is included in the first delivery and what is a follow-on phase. Also ask how the timeline changes if your policy owner is slow to decide wording, or if your model endpoint is not yet available in your environment.
What do we need to provide for a self-check rails project?
Most of the input is organizational rather than technical. Expect to provide:
- A named policy owner who can decide what the rails should block and what they should allow.
- A test set of safe and unsafe prompts and responses drawn from your real use cases, reviewed by people who know the domain.
- Access to the LLM endpoint the self-check prompts will call, with the model name and any rate limits.
- A hosting target, such as your containers, Kubernetes cluster or air-gapped network, with access for the engineers who will run it.
- Decisions on refusal wording and logging, since both affect what your auditors and support teams see.
Is self-check moderation free to run?
The NeMo Guardrails library is free to use under the Apache 2.0 license, but running self-check rails is not free. Each input and output check is an additional call to a language model, so you pay your model provider or your own GPU hosting for every request the rails evaluate. Chaining several self-check rails multiplies those calls, which increases both cost and latency. Ask for a cost estimate that shows the number of model calls per user request under your planned rails, and compare it with the cost of a dedicated safety model you host yourself.
What does DeployOpen deliver for self-check rails?
DeployOpen plans, implements, tests and documents self-check input and output rails inside your own infrastructure. A typical written scope covers the rail configuration and Colang files, the prompts and output parsing, the test set and evaluation results, deployment in your environment, and operating documentation for your team. For AI agent and assistant setups, DeployOpen can also run security testing of the configured rails, including prompt injection attempts, and deliver a findings report with fixes and a retest. DeployOpen does not issue audit reports or certifications; independent auditors and certification bodies do that work. Ask for the deliverables list in the written scope before work starts.
Limits to confirm in your environment
Self-check rails depend on the Colang version, the judging model, the NeMo Guardrails release line and the deployment path you choose. Each card below is a point where an assumption can fail, and each one has a check you can run before the rails go into production.
Colang version and self-check flow keys
Self-check flows and their configuration keys differ between Colang 1.0, the default, and Colang 2.x. Confirm which version your config.yml and Colang files use, then check the exact flow names and prompt keys against the documentation for that version. Converted configurations from nemoguardrails convert still need manual review, so do not assume a migrated rail behaves as before.
Judging model context and language coverage
A self-check rail sends the full user input or model output to the judging model along with the policy prompt. Confirm that the model's context window fits your longest prompts plus the policy text, and that it handles every language your users write in. Test with representative inputs in each language, because a judge that reads English well may miss policy violations in other languages.
LLMRails deprecation and the 0.25 migration
NeMo Guardrails 0.25.0 deprecates the LLMRails class in favor of Guardrails, with removal planned no earlier than 0.27.0. If your self-check configuration is built on LLMRails, plan the change now and follow NVIDIA's 0.25 migration guide. Then rerun your self-check tests, because the import and call changes can alter how rails are loaded.
Relevance of the microservice path
NVIDIA has sunset the NeMo Guardrails microservice container and archived its NeMo Microservices documentation. If your plan relied on that container or its documentation, confirm with your NVIDIA account team what replaces it for your deployment. Choose between the open-source library run as a server and any successor platform before you write self-check configurations that depend on a particular runtime.
- Microservice sunset date
- Oct 1, 2026
Chained rails under streaming
When several self-check rails run in sequence, each adds a model call before or after generation. Confirm how your chosen streaming mode handles output rails, including when tokens reach the user relative to the check and what happens when a later rail blocks text already sent. Test a blocked response during a streamed reply, not only in a single-response request, and measure the added wait on your own hardware.
Accuracy against your own policy
A self-check prompt judges content against the policy text you write, and its accuracy against your organization's rules is unknown until you measure it. Build a labeled set of allowed and disallowed examples from your own acceptable use policy, run it through every self-check rail, and record false positives and false negatives. Only your own evaluation can establish whether the rails meet your policy, so keep that evidence with the configuration.
How DeployOpen scopes and delivers self-check rails
DeployOpen treats self-check input and output rails as part of a wider guardrail configuration, not a standalone prompt. We scope which model judges each direction, build the rails in your own infrastructure, test them against your policy and hand over the configuration with documentation your team can maintain.
How we scope
- Confirm which NeMo Guardrails version and Python runtime your environment must support before any configuration work starts.
- Agree in writing which input and output checks use the application LLM as judge and which move to a dedicated safety model.
- Define the policy categories, refusal behavior and test cases that count as passing, so the written scope has measurable acceptance criteria. Engagements are fixed-scope, with deliverables and timelines agreed before work begins.
How we build
- Build the config.yml, self-check prompts and Colang files in a version-controlled repository your team can review.
- Test each self-check rail with benign, borderline and unsafe prompts, and record where the application LLM disagrees with the policy.
- Check the chained self-check rails against latency and output-parsing behavior, including reasoning model settings that can block every request.
How we hand over
- Deliver the configuration, deployment notes and a record of test results that your security and engineering teams can rerun.
- Document the prompts, model choices and known failure cases so auditors and reviewers can trace each blocking decision.
- Walk your team through the rails and the upgrade and migration considerations, including the Colang and LLMRails changes in 0.24 and 0.25.
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer when your rails need to follow new releases and policy changes.
- Retest the self-check rails after model, prompt or NeMo Guardrails version changes, and report any regressions with fixes.
- Confirm with your account team and the NeMo Guardrails release notes which versions and support windows apply to your deployment before committing.

