How RailOutcome makes NeMo Guardrails decisions explicit
RailOutcome is the return type a custom rail action uses to state its decision explicitly: allow the content, block it, or rewrite it. Teams use it since NeMo Guardrails 0.24 because a check that returns a loose value leaves every flow to guess what that value means. This topic sits in the custom rails and actions group and explains how an action declares its verdict and how flows read it. It applies to execution rails, the rail type for custom actions and tools, and it works alongside input rails, dialog rails, retrieval rails and output rails. Before writing code against it, read the 0.24 notes in the NeMo Guardrails releases page to confirm the exact class name, import path and fields.
Each custom check should declare which outcomes it can return, and the team should settle that before writing the flow. An allow outcome passes the content unchanged, which covers most traffic. A block outcome stops the message from reaching the model or the user, and it fits a policy violation with no safe partial answer, such as a request for a prohibited action. A rewrite outcome returns modified content, which fits cases where the rest of the message is usable once a sensitive field is removed. Explicit decisions are easier to test and review than inferred ones. A unit test can assert the exact outcome for a known input, and a security reviewer can read the branch that produces each verdict instead of reconstructing it from the flow.
Flows consume the result, so every outcome must be handled on every branch. Write one test per outcome: an allowed message continues unchanged, a blocked one takes the refusal path, and a rewritten one carries the modified text into the next rail and the model. Confirm that logs record which outcome fired, because a blocked request with no trace is hard to explain later. Check the current NeMo Guardrails documentation for the flow syntax that consumes the result, since Colang 1.0 is the default and Colang 2.0 is also supported. The library runs on Python 3.11, 3.12 or 3.13, so confirm your interpreter version before testing.
How a rail decision moves through a guardrail request
A user message enters the input rails of a NeMo Guardrails configuration and reaches a custom action that returns one of three outcomes: allow, block or transform. An allow lets the flow continue unchanged, a block stops the flow before the model is called, and a transform replaces the content so the flow continues with the rewritten text. Check that your flows handle all three outcomes and that a blocked request never reaches the model.
Allow, block and transform paths through one input rail.
Which outcome fits which kind of check
This table compares allow, block and transform outcomes by what each changes in the conversation, when it fits a check, and what the flow must handle afterward. Read each row as a decision: find the kind of check you are writing, then confirm the outcome and the follow-up handling. The main takeaway is that the outcome choice is a policy decision, so agree the policy with your compliance and product owners before you map checks to outcomes.
| Outcome | What it changes | When it fits a check | What the flow must handle afterward |
|---|---|---|---|
| Allow, pass-through | Nothing. The message or response continues unchanged. | Checks that find nothing to act on, or that only record a signal for logging and review. | Continue normal processing. Confirm the logged signal reaches your monitoring so passes remain auditable. |
| Block | Stops the message or response and replaces it with a refusal or fallback reply. | Clear policy violations where the content must not reach the model or the user, such as disallowed requests. | Return the fallback text, avoid calling downstream actions, and log the reason for review. |
| Transform | Rewrites the content, for example by masking a value or removing a flagged span. | Fixable issues such as personal data that can be masked while the rest of the request stays useful. | Use the rewritten content in later steps, and confirm the original is handled under your retention rules. |
| Pass-through without changes | No change, by policy choice rather than by a failed check. | Low-risk content, or checks run in observe-only mode while you tune them. | Decide with your policy owners whether observe-only results count as controls, and document the decision. |
| Ambiguous or uncertain result | Depends on how the check handles uncertainty. | Classifiers or model-based checks that return low confidence. | Confirm with your policy whether uncertain results block, pass or go to review, and test that path explicitly. |
| Errors inside the check | Depends on how the flow treats a failed check. | Action timeouts, unreachable safety services or malformed responses. | Confirm the fail-open or fail-closed choice in your policy and test that the flow behaves as chosen. |
Setting up a custom action that returns RailOutcome
This sequence takes a custom action from an empty project to a tested rail that returns an explicit allow, block or rewrite decision. Each step ends with a check you can run on your own machine before the rail reaches shared configurations. Confirm exact class names and return fields against the documentation for your installed version, since they are version specific.
Confirm the Python version and install
Create a virtual environment and install NeMo Guardrails 0.25.0 from PyPI. The package requires Python 3.11, 3.12 or 3.13. Run
python --versioninside the environment and confirm it reports one of those versions, then runpip show nemoguardrailsand confirm the installed version is 0.25.0. If you are on a 0.24.x release, the sequence still applies, but check the release notes for interface differences before you continue.Create the configuration folder
Create a folder that holds
config.yml, a Colang file for the flow andactions.pyfor the Python action. Keep the rail in its own folder so the team can version it in Git alongside the application. Load the folder with the Python API from a short script and confirm it starts without errors. A clean load with no action errors is your check before you add any logic.Write the action that returns RailOutcome
In
actions.py, define an async action that reads the user message and returns a RailOutcome with an explicit decision: allow, block or rewrite, plus the replacement text for a rewrite. Start with a simple check, such as a keyword or pattern match, so the decision logic is easy to read and test. Confirm the import path, decision values and field names in the documentation for your installed version. Check by calling the function directly from a test script with one input per outcome and confirming each returns the expected decision.Register the action in configuration
Make the action available to the rail by name so the flow can call it. Confirm how your installed version discovers Python actions in the configuration folder, and whether the action loads automatically from
actions.pyor needs an explicit entry inconfig.yml. Check by loading the configuration again and confirming the action name appears in the loaded set without warnings. If the name does not resolve, the flow fails at runtime, so fix registration before writing the flow.Add a flow that branches on the decision
Write a Colang flow that calls the action and branches on the returned decision. The allow branch lets the message continue unchanged, the block branch returns a fixed bot message and stops processing, and the rewrite branch replaces the content with the returned text. Colang 1.0 is the default, so confirm which Colang version your configuration uses before you copy syntax from examples. Check that the configuration loads without parse errors.
Test the allow, block and rewrite paths
Send one illustrative input for each outcome through the rails locally: a message the action should allow, one it should block and one it should rewrite. Confirm the allowed message reaches the model unchanged, the blocked message returns the fixed refusal and the rewritten message returns the replacement text. Save these three cases as tests so the same branches run again after every change to the action, the flow or the NeMo Guardrails version.
Security risks in transform and block decisions
A rail outcome decides whether content passes, is stopped or is rewritten, so a mistake in that decision reaches users directly. The cards below cover the failure modes that matter most for allow, block and transform results, and the control to apply to each one.
Transform that leaks what it should remove
A transform outcome replaces content, but the original text may still be kept in logs, traces, the conversation history or a value the flow passes along. Redaction that only changes the reply can leave the sensitive span in other places. (Illustrative) A masked account number might still appear in a debug log. Check every place the raw input or output is stored after a transform, and test that the removed value does not return in later turns.
NeMo Guardrails docsBlock reasons shown to end users
A block message that explains which check fired, which threshold was crossed or which policy matched tells an attacker how to adjust a prompt until it passes. Keep the user-facing text generic and send the detailed reason only to operators. Review each block message in your configuration, and confirm that a blocked request does not return the matched pattern, score or rule name.
Actions that fail open
If a custom action times out, raises an exception or cannot reach its external service, the outcome must not default to allow. A fail-open action lets unchecked content through during exactly the periods when your checks are unavailable. Set the error path to block or escalate, and test it by stopping the dependency during a staging run and sending known-bad inputs.
Credentials handled inside actions
Custom actions often hold API keys for classifiers, ticketing systems or internal services. Keys written into Python files, config files or action return values can end up in logs, error messages or version control. Load credentials from your secrets manager at runtime, keep them out of the decision payload, and confirm that exceptions raised inside an action do not print them.
Decision logs that hold raw content
Logging each allow, block or transform decision is useful for audits and tuning, but a log line that includes the full prompt or response creates a second copy of sensitive data. Record the decision type, rail name, timestamp, a content hash or length, and a correlation ID. Confirm with your security team how long these logs are retained and who can read them.
Unreviewed action access
Any flow that can call an action can trigger its decision logic, and any action with network or file access extends what a prompt can reach. Keep an inventory of actions, the flows that call them and the systems they touch. Review that list on each change, and remove actions that no active configuration uses.
Where the NeMo Guardrails microservice fits in
NVIDIA has sunset the NeMo Guardrails microservice as of October 1, 2026. The NGC container is no longer supported and will receive no new releases, so any RailOutcome logic you have deployed behind that microservice needs a new home before the next change window. The open-source library is a different product with a different future: it remains Apache 2.0 licensed, and NVIDIA still publishes releases, including 0.25.0. The decision for your team is therefore not whether NeMo Guardrails continues, but which runtime your custom actions and flows will run in from here.
If your organization has existing rails that call the microservice, start with two checks. First, read NVIDIA's archived NeMo Microservices documentation, which directs existing users to contact their NVIDIA account team about next steps. Second, review the NeMo Helix documentation, since NVIDIA's replacement control plane runs NeMo Guardrails as an inference gateway middleware plugin that applies guardrail configurations to model endpoints. Confirm with your account team whether that plugin model supports the allow, block and transform outcomes your actions return, and what support terms apply to your existing deployment. Do not assume the answer carries over from the microservice.
Plan the migration of actions and flows before you choose a runtime. A RailOutcome returned by a Python action depends on the action's signature, the flows that read its result, and the configuration files that register it, so those three pieces should be inventoried first. Check which Python version your target runtime requires, since NeMo Guardrails 0.25.0 supports Python 3.11, 3.12 and 3.13, and whether any flows need converting between Colang versions, which NVIDIA says still requires manual review. Once the inventory is complete, you can compare self-hosting the library, a server image built from the provided Dockerfile, and the Helix plugin route on evidence rather than assumptions.
Questions teams ask before building RailOutcome decisions
How much effort does a custom rail action with explicit outcomes take?
Effort depends mostly on how many decisions the action must make and how many flows consume its result. A single action that returns allow or block for one check is small. An action that also returns a transformed version of the content, and that several flows branch on, needs more design, more test cases and more review of the flow logic. No duration is supplied for this work, so ask any partner for a effort breakdown tied to your written scope, listing the outcomes, the flows that consume them and the test cases each one needs. Your team should expect the design of the outcome contract to take longer than writing the Python itself.
What drives the cost of building RailOutcome decisions up or down?
The main drivers are the number of outcomes, the number of integrations the check depends on, and whether the check runs against internal systems that need access approval. Costs rise when the transform outcome must preserve meaning across languages, formats or document types, and when several Colang flows branch on the result. Costs fall when the decision logic is already written down, the outcomes are limited to allow, block and transform, and the test data already exists. Any quote should list who is paid for design, coding, flow changes, testing and handover, and which of those are one-time and which recur when the policy changes.
What does the internal team need to provide for this work?
The internal team needs to supply the decision policy in plain language, the owners who can approve what counts as a block or a rewrite, sample inputs and outputs that should pass, be blocked or be transformed, and access to the target systems the action calls. Someone who knows the Colang flows must confirm how each outcome should route the conversation. Security and compliance staff should review the outcome logic before release. Without these inputs, the work tends to stall while decisions are made during build.
Can our own engineers build custom actions with RailOutcome themselves?
Yes, if your engineers are comfortable with Python, the NeMo Guardrails configuration files and Colang, and they can run the test suite against realistic traffic. The NeMo Guardrails project is open source under Apache 2.0, so the library itself is free to use. The harder part is usually the policy and the test evidence, not the code. Teams that build internally should confirm the exact version they target, since NeMo Guardrails 0.25.0 is the current release and Colang 1.0 is the default, and plan a review of flow behavior after each upgrade.
How long does testing a RailOutcome decision take?
Testing time depends on the number of outcome paths and the variety of inputs that reach them. Every allow, block and transform path needs cases that cover normal use, edge cases and attempts to get around the check. Transform outcomes need extra review, because the rewritten content must still be correct and must not expose data the original withheld. No duration is supplied for this work, so ask for a test plan with the number of cases per outcome and the criteria for passing each one. Keep those tests in version control so they run again after every change to the configuration or the model.
When is outside help worth it for building custom rail decisions?
Outside help is worth considering when the check must meet a compliance or security review, when several flows depend on the outcome, or when your team has no one who can own the Colang and Python code after release. It is also useful when the transform outcome handles personal or regulated data and needs independent testing. DeployOpen plans, implements, tests and documents these setups inside your own infrastructure, under a written scope agreed before work starts. It does not issue audit reports or certifications, so independent assessors remain responsible for those decisions.
What goes wrong most often when a rail returns a transform outcome?
The most common problem is a rewritten message that is still unsafe or no longer answers the user, because the transform logic removed too much or missed a pattern. Another is a flow that expects allow or block and does not handle transform, so the conversation continues with content nobody reviewed. Teams should confirm how each consuming flow handles all three outcomes, check the output in logs, and test transformed responses for leaks of the content that was removed. Confirm this behavior with your installed version, because flow handling depends on your configuration.
How DeployOpen scopes and delivers RailOutcome work
DeployOpen plans, builds, tests, documents and supports custom NeMo Guardrails actions that return allow, block and transform decisions in infrastructure you control. Each engagement starts from a written scope that names the decisions your flows must handle, the rails involved and the evidence your reviewers need.
How we scope
- Inventory every custom action whose result must return an allow, block or transform decision, and the flows that consume it.
- Agree in writing which content each transform may rewrite, and which blocked responses users and logs will see.
- Confirm the Python version, Colang version and NeMo Guardrails release your environment will pin before any code is written.
How we build
- Implement RailOutcome returns in custom actions, with explicit handling for allow, block and transform paths in each flow.
- Write unit tests for each decision path, including transforms that rewrite content and blocks that stop a response.
- Review converted or legacy configurations manually, since NVIDIA's migration guidance says converted configurations still need review.
How we hand over
- Deliver the action code, flow files, configuration and test suite in a repository your team controls, with setup instructions.
- Document each decision outcome, its trigger conditions, its log fields and the owner who approves changes to it.
- Walk your engineers and reviewers through the handover so the decision logic can be maintained after the engagement ends.
How we support
- Plan upgrades against each NeMo Guardrails release, checking that RailOutcome behavior and deprecations still match your code.
- Offer ongoing support, upgrades and continuous testing as a retainer if your team wants them after handover.
- Retest changed decision paths after each upgrade, and record the results so your compliance and security reviewers can check them.

