Why custom code breaks during a NeMo Guardrails upgrade
Custom code is the part of a NeMo Guardrails upgrade most likely to fail. Configuration files and Colang flows can be checked with the migration tooling, but custom actions, LangChain-backed model providers and custom LLMModel implementations run your own Python against library interfaces that have changed between releases. If your team runs any of these on 0.22 or later and plans to reach 0.24, treat them as the first work item, and move one minor version at a time so each interface change is tested in isolation. The current release is 0.25.0, published on 19 November 2026, and the previous one was 0.24.1 on 16 September 2026. Confirm the exact version your application pins before you start, because a loose pin can pull in a newer release than the one you tested.
The library itself is licensed under Apache 2.0, lives in the NVIDIA-NeMo/Guardrails repository, and still receives releases, so the upgrade is a maintenance task on a supported project, not a rescue. LangChain integration is opt-in and is switched on with the NEMOGUARDRAILS_LLM_FRAMEWORK=langchain environment variable. That means a provider that worked through LangChain on an earlier release will not load in the same way unless your deployment sets that variable and the provider class is still resolvable. Check which environment each runtime uses, including the container image and any Kubernetes manifests, because a missing variable in one environment can look like a provider bug.
The 0.25.0 release deprecates the LLMRails class in favor of Guardrails, with removal planned no earlier than 0.27.0, and NVIDIA publishes a 0.25 migration guide. For a 0.24 target, this is a reason to plan, not a blocker. Code that imports LLMRails can keep running on 0.24, but every custom action and provider you touch in this upgrade should be written so the entry-point change is a known follow-up rather than a surprise. Record which modules import LLMRails and which call its attributes, so the later move to Guardrails is a scoped task. Before each upgrade, run your unit tests for every custom action, a provider smoke test that sends one prompt through each configured model, and a server test that exercises the endpoints your clients call, then compare the results with the previous release's baseline.
Which release changes touch custom actions and providers
This table compares the release changes between 0.22 and 0.24 that affect custom actions, LangChain providers and custom LLMModel implementations. Read each row against the version you are moving from, then confirm exact details in that version's release notes before changing code. The main takeaway is that the provider and action changes are the ones most likely to break custom code without an obvious error at startup.
| Change | Impact on custom code | Action needed |
|---|---|---|
| 0.22: LangChain becomes optional | LangChain providers for Anthropic, Vertex AI and Cohere stop loading unless opted in, so custom provider code that imports LangChain may fail or fall back silently. | Opt in with NEMOGUARDRAILS_LLM_FRAMEWORK=langchain where needed, and confirm each model entry is classified correctly. |
| 0.22: vLLM and OpenAI-compatible entries | Existing provider entries for vLLM and other OpenAI-compatible endpoints may need a different engine value in config.yml. | Rewrite these entries to engine: openai and confirm the request path and model name still resolve. |
| 0.22: Custom providers under LLMModel | Custom LLM backends written against the earlier interface may not match the new LLMModel protocol. | Re-implement the provider against the LLMModel protocol and test initialization and generation separately. |
| 0.23: Pydantic 2 requirement | Custom actions or helper modules pinned to Pydantic 1 can fail at import or validation time. | Move the dependency to Pydantic 2 and rerun action unit tests with the new version installed. |
| 0.23: Deprecated internal LLMRails attributes | Custom code that reads internal LLMRails attributes may stop working or produce warnings. | Search custom code for internal attribute access and replace it with the public interface named in the 0.25 migration guide. |
| 0.24: output_mapping to RailOutcome | Custom rail actions that return output_mapping results need a RailOutcome return shape, and rail decisions may change. | Port each action to RailOutcome and test block, modify and allow paths for every rail. |
| 0.24: GenerationResponse return type | Actions or wrappers that expect the older response shape may read fields incorrectly. | Update callers to handle GenerationResponse and check any code that serializes responses. |
| 0.24: Renamed actions and removed hf-classifier extra | Flows or config files that call old action names or install the hf-classifier extra will not resolve. | Confirm new action names in the release notes, update Colang flows, and remove the extra from installation files. |
How custom actions, providers and rails connect at runtime
The diagram starts with a request entering the NeMo Guardrails runtime, which runs input rails and dialog rails before an execution rail calls your custom action. The model call then goes through one of two paths: a LangChain provider, which is used only when the NEMOGUARDRAILS_LLM_FRAMEWORK=langchain environment variable is set, or a custom LLMModel implementation. Output rails check the response before it returns. Each boundary marks a place where an upgrade can break code: the action signature and return type, the provider registration, and the LLMRails entry point. Check each boundary with a test before you move to a new release.
Request flow through rails, custom actions and the two provider paths.
Which custom code path you run and what it needs
Custom actions are Python functions that Colang flows and configuration call during execution rails and tool use. In a 0.22 to 0.24 upgrade, the risk sits in the return values and in the names the configuration uses to reach them, so the inventory has to cover both the code and the references to it.
- Action inventory: list every Python function in your actions folder, along with each name that Colang flows,
config.ymlor tool definitions call. - Return shape: find actions that still return data through
output_mapping, since 0.24 moves these to RailOutcome, and note any that rely on the older return types. - Renamed actions: compare your action names against the 0.24 release notes in the NeMo Guardrails releases list, because renamed actions fail at flow load time, not at request time.
- Dependencies: record any imports from packages you added yourself, so you can pin them alongside the NeMo Guardrails version.
The first test to write loads the configuration with every action registered, then calls each action directly with a fixture input and asserts the RailOutcome fields your flows read. Run the same load step on the target version before you upgrade production.
LangChain support in NeMo Guardrails is opt-in. Since 0.22 it is enabled with the NEMOGUARDRAILS_LLM_FRAMEWORK=langchain environment variable, so an upgrade can keep a provider entry in your configuration while silently removing the code path that serves it. The inventory therefore starts with the environment, not the configuration file.
- Environment sources: check container images, Kubernetes manifests, CI jobs and local
.envfiles for the variable, because a value set in one place may be missing in another. - Provider entries: list each model entry that depends on LangChain, such as Anthropic, Vertex AI or Cohere in your setup, and note the engine each one uses.
- Provider packages: record the LangChain integration packages you install, and pin them so a transitive change does not alter provider behavior.
- Other frameworks: if any entry uses a provider that does not need LangChain, mark it so it is not moved in the same change.
The first test runs two startups, one with the variable set and one without, using the same configuration. Send one request per LangChain-backed provider in each run, and record which entries load and which fail. Keep the variable in the deployment definition, not in a shell profile, so the environment is the same on every node.
Custom LLMModel implementations are classes you wrote to connect NeMo Guardrails to a model endpoint that the built-in providers do not cover. Since 0.22 these classes follow the LLMModel protocol, and 0.23 adds the Pydantic 2 requirement, so an implementation that worked earlier can fail at import or at the first call. The inventory covers the class, its registration and its initialization code.
- Class and registration: list each class, the module it lives in, and where it is registered or referenced from configuration.
- Pydantic version: confirm whether the class or its dependencies rely on Pydantic 1 behavior, since applications pinned to Pydantic 1 need changes before the upgrade.
- Deprecated internals: search your code for direct use of
LLMRailsattributes that 0.23 deprecated, and for theLLMRailsclass itself, which 0.25 deprecates in favor ofGuardrails. - Initialization: record any setup code that runs at startup, such as client creation or credential loading, because it runs before the framework reports errors.
The first test is a contract test. It instantiates the class with test settings, calls the generate methods your configuration uses, and checks that the output matches what the framework expects. Run it under the Python version you plan to deploy (0.25.0 requires Python 3.11, 3.12 or 3.13) and under the Pydantic version your application will use.
What to inventory and back up before touching custom code
Custom actions, LangChain providers and custom LLMModel classes fail in quiet ways during an upgrade, so the work starts with a precise record of what exists and how to return to it. The six cards below cover the inventory, the pinned environment, the runtime, the test setup, the framework settings and the rollback path.
Inventory every action, provider and entry
List each custom action function, each provider class and each models entry in config.yml, with the file it lives in and the release it was first written for. Note which entries use LangChain classes, which use an OpenAI-compatible engine and which are custom LLMModel implementations, because each group changes differently between 0.22 and 0.24. Mark any action whose output feeds a rail, since those outputs are the first thing to re-check after an upgrade. Ask the owner of each action to confirm it is still called in production.
Pin the current Colang and Python packages
Capture the exact package versions in the running environment, including nemoguardrails, LangChain packages, Pydantic and any provider SDKs, using pip freeze or your lock file. Copy the .co and .colang files from the same commit that is deployed, not from a working copy. Without this record, you cannot tell whether a regression came from your code or from a dependency that moved during the upgrade. Store the pinned set alongside the release tag of your own application.
Check the Python runtime first
NeMo Guardrails 0.25.0 requires Python 3.11, 3.12 or 3.13, so confirm the interpreter version used by every host, container and CI runner that loads your configuration. Custom actions and providers often run in the same interpreter as the guardrails process, so an older base image can block the upgrade before any code is tested. Record the interpreter path and version for each environment, and confirm which one your package manager resolves during the build.
nemoguardrails on PyPIBuild a test environment that mirrors model endpoints
Stand up a staging copy of the guardrails service that points at the same model endpoints, API gateways and vector stores as production, or at approved stand-ins that return comparable response shapes. A custom LLMModel that works against a local mock can still fail against a real provider's streaming or error behavior. Ask whether non-production credentials and rate limits allow a full run of your evaluation set before the change window opens.
Record framework and environment variables
Write down every environment variable the service reads, including NEMOGUARDRAILS_LLM_FRAMEWORK, which enables LangChain integration as an opt-in setting, plus provider keys, endpoint URLs and logging or tracing flags. Note the value each one has in production and where it is set, such as a Kubernetes secret, a container definition or a host file. A missing framework flag after the upgrade is one of the most common causes of providers failing to load, so confirm the exact value with the team that owns deployment.
- Current release
- 0.25.0
Back up configuration and images for rollback
Keep a copy of the configuration folder, the custom code and the container image that runs today, tagged so it can be redeployed without a rebuild. Confirm that the rollback procedure has been run once in staging, including restoring the prior image and any secrets it needs. Also record which changes in the upgrade can be reversed, since some configuration rewrites are one-way. Ask the platform team how long the previous image stays available in your registry.
How to move from 0.22 to 0.24 one release at a time
This sequence moves custom actions, LangChain providers and custom LLMModel code from NeMo Guardrails 0.22 to 0.24 in verified stages, so each release change is tested and can be reversed before the next one begins. It produces a working 0.24 setup with a documented rollback point at every stage.
Freeze current behavior with tests
Before changing any package, record how the 0.22 system behaves today. Your engineers write tests that call each custom action, each LangChain or custom provider path and each Colang flow with fixed inputs, then save the outputs, including blocked responses and error messages. Tag the current package set in your lock file and copy the configuration folder into version control. The step is done when the suite passes on 0.22 and the baseline outputs are stored, which becomes the reference for every later stage.
Upgrade to 0.23 and fix Pydantic
Install 0.23 in a separate virtual environment or container image, not over the working 0.22 build. Check whether your custom actions, providers or other dependencies still pin Pydantic 1, because 0.23 requires Pydantic 2. Replace any deprecated internal LLMRails attributes your code reads and re-run the baseline suite. Confirm the new IORails tool calling and content capture options are off unless you enable them. The step closes when the suite matches the 0.22 baseline. Rollback point: keep the 0.22 lock file and configuration folder so you can restore the previous package set in one change.
Upgrade to 0.24 and migrate actions
Move to 0.24 in the same isolated way. Convert custom rail actions that return output_mapping so they return a RailOutcome, and update any code that expects the GenerationResponse return type. Update action names that NVIDIA renamed in the release notes, and remove any dependency on the hf-classifier extra, which was removed. Adjust any client that calls the server's /v1/checks endpoint or Chat Completions validation, since those changed. Run the baseline suite and compare outputs. Where a result differs from the 0.22 baseline, decide whether the change is intended and record that decision. The step closes when all tests pass and each difference is documented. Rollback point: the 0.23 environment and its tagged configuration.
Run the Colang convert tool
If your configurations use Colang 1.0 and you plan to move to Colang 2.x, run the nemoguardrails convert tool against a copy of the configuration folder, never the original. NVIDIA states that converted configurations still need manual review, so have an engineer read every converted file against the Colang 2 migration guide and check that each flow still triggers on the same inputs. Re-run the baseline tests against the converted copy. The step is done when the converted configuration passes the suite and the review notes are filed with the change. Rollback point: the unconverted Colang 1.0 folder kept in version control, which you can run on 0.24 if the conversion is not ready.
Confirm LangChain and provider behavior
Re-check each model entry under the 0.22 to 0.24 provider rules. Confirm that LangChain is enabled only where it is needed, by setting NEMOGUARDRAILS_LLM_FRAMEWORK=langchain in the deployed environment, and that custom LLMModel implementations still satisfy the protocol your code relies on. Run a test call to every provider, including vLLM and other OpenAI-compatible endpoints, and check the responses against the baseline. Ask your provider vendors to confirm any changes to their own SDKs, because NeMo Guardrails documentation does not cover them. The step is done when every provider returns the expected responses in a staging environment.
Decide separately on 0.25.0
Treat 0.25.0 as a separate decision. The release deprecates the LLMRails class in favor of Guardrails, with removal planned no earlier than 0.27.0, and it requires Python 3.11, 3.12 or 3.13. Check your runtime version and the deprecation warnings produced by your test run before you start. NVIDIA publishes a 0.25 migration guide, which your team should review against the Guardrails facade plan. Do not combine this with the 0.24 change, so that any failure has one cause. The step is done when your team records a go or no-go decision for 0.25.0 with its runtime and deprecation findings.
Promote the tested build to production
Deploy the 0.24 build, with its converted or confirmed Colang files and tagged configuration, to a staging environment that mirrors production. Run the full baseline suite, a sample of live-style traffic and a rollback drill that restores the 0.22 package set and configuration folder. Confirm your logs and blocked-response records still show what they showed before the upgrade. Promote to production only after the drill succeeds and the sign-off record names the owner of each change. Keep the 0.22 artifacts for a period your change policy sets, so the rollback remains available.
Which tests to run before each upgrade step
Run three test groups before every version step, and treat the results as the baseline you compare against after the upgrade. The first group is unit tests for each custom action. For every action in your actions.py or action package, record real inputs from your application logs (with personal data removed), capture the rail outcome each one produces on the current release, and assert that the same outcome comes back after the upgrade. This is where the output_mapping to RailOutcome change and renamed actions will show up first, so the expected outcomes should be written as explicit values, not as "no exception raised." Keep the recorded inputs under version control next to the action code so the same cases can be replayed on each step.
The second group is provider tests. Call every model entry registered in your config.yml and confirm the response shape your code depends on: the text field, token usage if you read it, and any error type your fallback logic catches. Run these with the NEMOGUARDRAILS_LLM_FRAMEWORK setting you actually use in production, because LangChain is opt-in and a provider that loads under one setting may fail under another. Custom LLMModel implementations need their own cases here. Confirm with the upgrade notes for each release which provider engines and extras are expected, and do not assume a provider works because it worked on the previous version.
The third group is integration tests against the guardrails server endpoints your application calls. If your application uses /v1/checks or the Chat Completions interface, send the same requests your client sends and check the status codes, response bodies and any streaming behavior. Include a negative case for each rail that should block, because a silent change from block to pass is the most damaging failure in this set. Store the exact NeMo Guardrails version, Python version and configuration hash with every run. Failures are then compared against the stored baseline: a new failure needs a fix or a documented decision before the step proceeds, and an unchanged failure is recorded as known. Those stored results, with the versions tested, form your rollback decision record.
What makes custom code upgrades take longer
This table lists the factors that change how much work a custom code upgrade across NeMo Guardrails 0.22 to 0.24 involves, and what each factor adds. Read each row against your own inventory of actions, providers, configurations and environments to see where your effort will concentrate. The main takeaway is that most of the effort comes from counting what you own before the upgrade starts, not from the upgrade commands themselves.
| Driver | Why it adds effort | How to reduce it |
|---|---|---|
| Number of custom actions and their dependencies | Each action may import libraries, call internal APIs or read configuration, and each one must be checked against changed return types and renamed actions. | Inventory every action with its imports and callers, and group actions by dependency so each group can be tested together. |
| LangChain providers and version pins | Providers that relied on the default LangChain path need an explicit decision on whether to opt in, and pinned LangChain versions can conflict with the release you move to. | Pin LangChain versions in a lock file, record which providers load through LangChain, and test each provider in a clean environment. |
| Custom LLMModel implementations using internal APIs | Custom models written against internal classes or attributes can break when those internals change between releases, and the failure may only appear at first generation. | Rewrite custom models against the public LLMModel protocol where possible, and list every internal attribute the code touches. |
| Colang 1.0 files requiring conversion and review | The nemoguardrails convert tool produces a starting point, and NVIDIA says converted configurations still need manual review, so each flow needs a reviewer. | Convert in a branch, diff the output, and review flows against the original behavior using a fixed set of test prompts. |
| Number of environments and endpoints to retest | Development, staging and production may run different model endpoints, provider keys and Python versions, and each combination needs its own test pass. NeMo Guardrails 0.25.0 requires Python 3.11, 3.12 or 3.13. | Keep a matrix of environments and endpoints, and confirm the Python version in each before the test run starts. |
| Missing or weak test coverage | Without tests for actions and rails, regressions surface in production, and the team must create test cases while also fixing code. | Write tests for each action and rail outcome before upgrading, and run them against the current release to establish a baseline. |
| Calling the guardrails server or the Python API | Applications calling the server depend on HTTP request and response shapes, including changes to the checks and Chat Completions endpoints, while Python API callers depend on class and method signatures. | Identify which interface each application uses, and test that interface's contract directly with recorded requests and responses. |
What does a custom code upgrade cost and require from our team?
What drives the cost and effort of moving custom actions and providers from 0.22 to 0.24?
The main drivers are how much custom code you have, how many model providers it touches, and how well it is tested today. Each custom action, LangChain provider and custom LLMModel implementation needs to be inventoried, checked against the 0.23 and 0.24 changes, and retested. Code that uses output_mapping, depends on the older return types or relies on renamed actions takes more work than code that only calls a stable interface. Fewer tests in place means more manual verification, which adds effort. Ask any partner to price the work from a written inventory of custom code, not from a general description of the platform.
How long does a custom code upgrade take, and what sets the duration?
No duration figure applies here because it depends on your code and environment. The schedule is set by the number of custom components, the number of model endpoints you must test against, and whether you have automated tests that run in a staging environment. Access approvals for test environments and model endpoints often take longer than the code changes themselves. Ask for a timeline tied to the inventory and the test plan, with the dependencies on your team listed separately.
What does the upgrade need from our engineering team?
Your team needs to provide the following before work starts:
- Source access to every custom action, provider and LLMModel implementation, with the Python version and dependency pins in use.
- A staging environment that mirrors production configuration, including the Colang files and config.yml.
- Test access to each model endpoint the code calls, with credentials that can be rotated after testing.
- A named owner who can approve behavior changes and sign off on test results.
Without these, the upgrade stalls at the point where the team has to verify changes against real providers.
Can our own team upgrade custom actions and providers without outside help?
Yes, a team with Python experience and access to the test environment can make these changes, provided it reads the release notes for each version and runs a full test pass. The work is mostly mechanical once the breaking changes are mapped to your code, but it is easy to miss a provider or an action that is only called in one flow. Outside help usually adds value in the inventory, the test plan and independent verification, since these are the steps most often skipped by internal teams under deadline pressure. Decide based on who has time, who knows the code and who will review the results.
How should our team handle the output of the Colang convert tool?
Treat the output of the nemoguardrails convert tool as a draft that needs manual review. NVIDIA's migration guide says converted configurations still need review, so every converted flow should be read against the original behavior and covered by a test. Pay attention to flows that depend on rail outcomes, actions called from Colang and any logic that the converter does not model directly. Keep the original files in version control so you can compare the two versions and roll back if a flow changes behavior. Confirm the migration path for your Colang version in the NeMo Guardrails Colang 2 migration guide before you run it.
What happens to the upgrade if we run the NGC NeMo Guardrails microservice?
NVIDIA has sunset the NeMo microservices, and the NGC catalog page for the NeMo Guardrails container says there will be no new releases and the artifact is no longer supported. NVIDIA's archived documentation asks existing users to contact their account team about next steps. This means a version upgrade of the microservice is not a simple path to plan around. Before planning custom code changes, confirm your deployment model with your NVIDIA account team and decide whether the library, or a different platform, is the target. The NeMo Microservices sunset notice is the right starting point for that conversation.
What should a quote for a custom code upgrade include?
A written quote should list:
- The scope, stated as the library versions covered, such as 0.22 through 0.24, and the environments in scope.
- The inventory of custom code in scope, with each action, provider and LLMModel implementation named.
- The test plan, including unit tests, configuration tests and checks against each model endpoint.
- The rollback plan, covering how to restore the previous package versions and configuration if the upgrade fails.
- The client dependencies, such as access, approvals and named reviewers, along with the deliverables and acceptance criteria.
Ask how each item is priced and which items recur after the upgrade.
How DeployOpen works on this
DeployOpen plans and delivers custom action and LLM provider upgrades for NeMo Guardrails as a written, fixed-scope engagement inside your own infrastructure. We inventory your custom code, port it to the target release, test it against your configurations, and document each change so your team can run it after handover.
How we scope
- We inventory every custom action, LangChain provider and custom LLMModel class, plus the config.yml entries that reference them.
- The written scope names the source and target releases, the Python versions in use, and which providers and rails must keep working.
- We confirm with you which environments, test data and model endpoints are available before any code changes begin.
- Scope identifies which items need manual review, such as converted Colang files and any custom code tied to deprecated LLMRails attributes.
How we build
- We port each custom action to the new return types and rail outcome handling, then update call sites that depend on the changed interfaces.
- Custom LLM providers are reviewed against the LLMModel protocol and the framework opt-in setting, so each provider loads explicitly in the target release.
- We run the pre-upgrade test suite on the current release first, so any failures are separated from upgrade regressions.
- Each change is made in version control with a reviewable diff, and the upgraded build runs in a staging environment you control.
How we hand over
- You receive an upgrade record listing every changed action, provider, configuration key and dependency pin.
- Test results are delivered before and after the upgrade, with the commands used to reproduce them.
- We document rollback steps for the previous release and the configuration files needed to restore it.
- Handover includes a walkthrough with your engineers so the next upgrade can follow the same checklist.
How we support
- Engagements are fixed-scope, so the agreed deliverables and acceptance tests are defined in writing before work starts.
- Ongoing support, upgrades for later releases and continuous testing are available as a retainer, scoped separately.
- Upgrade work for the next NeMo Guardrails release can reuse the test suite and checklist built during this engagement.
- Ask us to confirm which open items, such as unverified third-party integrations, remain your team's responsibility after handover.

