Validating AI agent tool calls with NeMo Guardrails

NeMo Guardrails can check the tool calls an AI agent proposes and the results sent back to the model, but the features that do this are experimental and do not cover every risk. This page explains what to confirm before you rely on them.

On this page

Validating AI agent tool calls with NeMo Guardrails: what it does and when to use it

If an AI agent can call internal tools, each tool call needs a check before it runs, and each tool result needs a check before it returns to the model. NeMo Guardrails can apply those checks through schema and allow-list validation, fail-closed behavior and, in some configurations, the experimental IORails engine. NeMo Guardrails defines five rail types: input rails, dialog rails, retrieval rails for RAG chunks, execution rails for custom actions and tools, and output rails. Tool validation sits on the execution path, close to the call itself. NVIDIA's NeMo Guardrails documentation describes IORails tool rails as experimental, so decide early whether your agent can depend on that engine or needs a fallback that you build and test yourself.

The library is licensed under Apache 2.0 and developed in the NVIDIA-NeMo/Guardrails repository, so you can run it inside infrastructure you control. The current release, 0.25.0, requires Python 3.11, 3.12 or 3.13. Do not plan around the NeMo Guardrails microservice. NVIDIA's NGC catalog entry for the container states that NeMo microservices were sunset as of October 1, 2026, with no new releases and no continued support for the artifact. NVIDIA's archived documentation asks existing users to contact their account team. The path covered here is the Python library and a guardrails server that you operate, patch and test yourself.

Before you build, confirm three things: which engine your target version uses for tool rails, whether your tool schemas can be expressed as the validation rules you need, and what the application does when a rail errors or times out. The fail-closed behavior is the control that matters most, so test it with malformed tool calls, tool names that are not on the allow list and oversized tool results. Treat the rails as one layer. Database permissions, API authorization and least-privilege credentials on the tool side must still enforce what the agent is allowed to do.

Where validation sits between the model, the tool and the application

The flow starts with a user request that reaches the application, which passes it to the LLM. When the model proposes a tool call, the call is routed through NeMo Guardrails before any tool or action runs, so the schema and allow-list checks happen at that hand-off. A call that fails any check is blocked and the application returns a safe response instead of executing it. Results from the tool travel back through the same guardrail check before they reach the model, so the path to check is both directions.

Tool calls and results pass through guardrail checks before the application or model uses them.

Configuration options and when each fits

This table compares the four ways to check agent tool calls and results in NeMo Guardrails, plus the standard Colang 1.0 path. Read each row for the situation it fits and the trade-off you accept, then combine options where one check does not cover the other.

OptionWhen it fitsMain trade-off
Schema validation of tool argumentsTools with typed, well-defined parameters where malformed or unexpected fields should be rejected before executionChecks structure and types only; it does not tell you whether a well-formed value is allowed for this user
Allow-list of tool names and argumentsAgents with a fixed, short catalog of tools and a known set of permitted values, such as approved endpoints or read-only operationsEvery new tool or value needs a list update and review, which adds maintenance as the catalog grows
Execution rails for custom actionsCustom Python actions invoked from Colang flows where you want checks on action inputs and outputs in the standard engineCovers actions wired through Colang flows; model tool calls handled outside those flows need separate coverage
IORails engine (experimental)Teams that want tool rails on model tool calls and tool results and can accept an experimental engine in a non-critical pilot firstExperimental status means behavior and configuration may change between releases; confirm current support in the documentation before production use
Standard Colang 1.0 pathExisting configurations and teams already running Colang 1.0 that need stable, documented behaviorTool call and tool result checks are not the path's focus, so you may add schema and allow-list logic yourself in actions

How fail-closed behavior protects tool execution

A rail that blocks a tool call only protects you if the blocked call never runs. The checks below test that the denial path holds under normal use, validation errors, and adversarial input, and they should run in staging before any agent reaches production tools.

Blocked calls never execute

Confirm that when a tool-call rail rejects a call, the downstream function is not invoked at all. Use an action that writes a marker to a test database or log, then send calls that fail schema or allow-list checks. The marker should show no side effect. Also check that retries from the agent loop do not bypass the rejection and that partial parameter sets are not executed with defaults.

Validation errors deny by default

Force the validator to fail in controlled ways: malformed JSON, an unparseable tool name, a missing schema, and a timeout on a judge model if one is configured. Each failure should end in denial. If a failure path returns the call as allowed, the configuration is fail-open and must be fixed before release. Record which failure modes you tested and the result for each.

Generic refusal to the user

Check that a denied call produces a generic refusal and nothing more. The response should not name the rule that fired, list allowed tools, echo internal endpoints, or show a stack trace. Compare the refusal text across several denial types, because differing messages can reveal which checks exist. Logs should still capture the full reason for the security team.

Tool results are validated too

Send tool results that contain unexpected fields, oversized payloads, or instruction-like text back into the model. Confirm that results failing the result checks are withheld or replaced before the model sees them, and that the agent does not proceed as if the call succeeded. Test the same behavior when the result comes from a timeout or an error response.

Experimental engine behavior

If you enable the experimental IORails engine, test it as its own configuration rather than assuming the standard path behaves the same. Confirm which engine handles each request in your deployment, and that a configuration error in the engine setting does not silently switch to a path with weaker checks. Recheck this after every library upgrade.

NeMo Guardrails docs

Enabling the experimental IORails engine step by step

This sequence takes a team from an empty Python environment to a tested configuration that checks each model tool call against tool schemas and an allow-list before the application runs it. Each step ends with a check so the team can confirm the setup before adding the next layer.

  1. Create a Python environment and install the library

    The platform or security engineer who owns the agent creates an isolated virtual environment on Python 3.11, 3.12 or 3.13, then installs the library with pip install nemoguardrails==0.25.0 from the Python Package Index. Pinning the version keeps the configuration tied to the release you tested. The step is done when pip show nemoguardrails reports version 0.25.0 and python -c "import nemoguardrails" runs without an error.

  2. Create the configuration folder

    Create a folder for the guardrails configuration with a config.yml file, the Colang files that define flows, and an optional Python actions file. Choose between Colang 1.0, which is the default, and Colang 2.0 before writing flows, because converting between them needs manual review. Keep the folder in version control from the start. The step is done when the configuration folder loads into the library without a parsing error.

  3. Enable the IORails engine from current documentation

    The engineer who owns the configuration enables the IORails engine by following the current NeMo Guardrails documentation for the 0.25.0 release, since the engine is marked experimental and its settings can change between releases. Confirm the exact configuration key and its values in the documentation, not in older blog posts or sample code. Start with a minimal configuration that has no tools. The step is done when the documented check for the engine passes and the engine is confirmed as active.

  4. Define schemas for each permitted tool

    The engineer who owns the tool catalog writes a schema for every tool the agent may call. Each schema lists the tool name, every parameter with its type, which parameters are required, and the allowed value ranges or formats. Store the schemas as files in the configuration repository so reviewers can read them. The step is done when a valid sample call passes the schema check and a sample call with a missing required parameter or a wrong type is rejected, both tested outside the model.

  5. Write the tool allow-list

    The security engineer writes an allow-list that names each tool the agent may call and the conditions under which it may be called. Anything not on the list is denied by default, including tool names the model invents. Review the list with the team that owns each tool, since the list decides what the rails permit. The step is done when a tool name that is absent from the list produces a blocked outcome in a test run and nothing reaches the tool itself.

  6. Wire the application to the rails

    The application engineer connects the agent to the rails through the Python API or the guardrails server. Use the Guardrails class, since LLMRails is deprecated in version 0.25.0, and follow NVIDIA's 0.25 migration guide for any older code. The application must run a model tool call through the rails before executing it, and it must execute the tool only when the call passes. The step is done when a tool call that fails validation returns a refusal and a log entry, and the tool function records no invocation.

  7. Run allowed and blocked test cases

    The QA or security engineer builds a test set with expected outcomes. The allowed cases include valid calls to permitted tools, and the blocked cases include unknown tool names, missing or mistyped parameters, out-of-range values, and tool results with unexpected content. The test set also simulates a rail failure, such as an unreachable model, to confirm the fail-closed behavior. The step is done when every case matches its expected outcome and the team records the results alongside the configuration.

  8. Document what the rails do not cover

    The security lead writes a short coverage note that lists what the schema and allow-list checks do not decide, such as whether a user is authorized for a specific record, what a permitted tool does once it runs, and which credentials the tool uses. Assign an owner for each gap and link it to the controls that handle it elsewhere. The step is done when the note has been reviewed by the owners of the tools and the identity and access controls.

Python API or guardrails server for agent tool checks

The Python API loads a guardrails configuration in the same process as the agent. The agent code calls the rails after the model proposes a tool call and before the tool dispatcher runs it, and again on the tool result before the model reads it. Checks run in the agent's own control flow, so there is no extra network hop, but the agent team owns the integration and its failure handling.

  • Call placement: the agent invokes the rails between model output and the dispatcher, so every tool path must pass through that call.
  • Runtime requirements: the agent service must run Python 3.11, 3.12 or 3.13 and install the nemoguardrails package from PyPI.
  • Deprecated class: release 0.25.0 deprecates LLMRails in favor of Guardrails, so new code should use Guardrails and track the planned removal in 0.27.0 or later.
  • Failure handling: an exception inside the rails call must be caught and converted into a block by your code, not left to the agent's default behavior.
  • Dependency upgrades: library upgrades ship with the agent release, so the agent pipeline must test them.

Confirm which Python version your agent runtime pins before choosing this path.

Security and operational considerations for tool validation

Tool validation only holds if the surrounding system does its part. The cards below cover what stays outside the rails: credentials, user identity, logging, configuration control and the permissions behind each tool. Each one is a decision the team owns, whether it builds the configuration itself or hands the work to a partner.

Keep credentials away from the model

Tool arguments and results pass through the model's context, so API keys, tokens and connection strings must never appear in a prompt, a tool schema or a tool result. Store credentials in the action server or a secrets manager and let the action read them at execution time. Check that rail logs and traces do not record raw headers or secrets from tool calls.

Pass user context to tool calls

A validated tool call still runs with whatever identity the backend trusts. Pass the authenticated user identity from your application into each action, not a user identifier the model generates, and authorize the call against that identity. Confirm which identity the action uses for downstream API calls and whether it can act beyond the requesting user's rights.

Log blocked and allowed calls

Blocked calls are the events incident responders need first, so the team should log the tool name, the rejected arguments, the rail that rejected them and the requesting user. Decide how long these records are kept and who can read them, because arguments may contain personal data. Test that a blocked call produces a record before go-live.

Control configuration changes

The schemas, allow-lists and Colang flows define what the agent may do, so a silent edit to them is a change to the security boundary. Keep configurations in version control, require review for changes to tool rails, and retest the allow-lists after each change or upgrade. Record which configuration version was running at any point in time.

NeMo Guardrails docs

Enforce least privilege behind each tool

A rail can refuse a malformed or unlisted call, but it cannot limit what a permitted call does once it reaches the database or operating system. Give each tool its own database role or service account with the fewest rights it needs, and restrict write, delete and shell access at that layer. Ask the team to demonstrate that a permitted but malicious call still fails at the backend.

Plan for the rails failing

Validation components can fail, time out or be misconfigured, and the agent should not proceed when that happens. Confirm that each tool call is refused when the validator is unavailable, and that the failure is visible to operators. Include this failure path in your test plan alongside the normal allow and deny cases.

Questions teams ask before validating agent tool calls

Is NeMo Guardrails free to use under the Apache 2.0 license?

Yes, the library itself is open source under the Apache 2.0 license, and you can use it in commercial products without paying NVIDIA a license fee for the library. The license covers the code, not the infrastructure around it. Your costs are the servers or containers that run it, the engineering time to write and test rails, and any hosted model or safety classifier calls you choose to make. Check the NeMo Guardrails releases page for the current version, since NVIDIA publishes new releases regularly. Confirm with your legal team how the license applies to any third-party models or integrations you add.

What drives the cost of validating agent tool calls?

The main cost driver is the number of tools and how many of them can change state or touch sensitive data. Each tool needs a schema, an allow-list entry, a decision on what happens when a call fails, and tests that prove the rail blocks what it should. Policy complexity adds work when rules depend on user role, tenant or the result of a previous call. Costs fall into one-time work (design, configuration, tests, documentation) and recurring work (updating rails when tools change, reviewing logs and retesting after upgrades). Ask any partner for a quote that lists tools, policy rules, environments and the test evidence included.

How long does a build take depending on tool count and policy complexity?

Duration follows the same drivers as cost: how many tools the agent can call, how many of them are write operations, and how much the allow-list logic depends on context. A small agent with a few read-only tools and simple schemas is much quicker to validate than an agent with dozens of tools across several systems. Plan time for environment setup, the fail-closed design review, integration testing against real tool endpoints and a retest after fixes. No standard duration applies here, so ask for a written timeline tied to the agreed scope and the tool inventory you provide.

What does the work need from our team?

You need to provide a complete inventory of the tools the agent can call, including their parameters, the systems behind them, who is allowed to invoke them and which ones change data. Your identity team must supply how user context reaches the agent and the tool layer, and your platform team must provide a place to run the guardrails server with the configuration under version control. You also need named reviewers who can approve allow-lists and decide how blocked calls are handled. Without these inputs, the rails will encode assumptions that nobody has checked.

Can our own engineers build tool call validation internally?

Yes, a capable engineering team can build it internally, since the library is open source and its configuration uses a config.yml file, optional Python actions and Colang files. The skills that matter most are API security, schema design and testing that covers failure paths, not only the happy path. Internal teams often underestimate the time to handle fail-closed behavior, keep allow-lists in step with tool changes and maintain the rails through upgrades. Compare the cost of your staff time with the cost of a fixed-scope engagement, and ask a partner to show the deliverables before you decide.

Which Python version and deployment option do we need?

NeMo Guardrails 0.25.0 requires Python 3.11, 3.12 or 3.13. You can call it through the Python API inside your application or run it as a guardrails server that loads configurations from a folder and exposes an HTTP API. The server option suits teams that want validation separate from the agent code, and a Dockerfile is provided to build a server image. Confirm the Python version your platform supports before planning the build, and check the release notes for any change that affects your setup.

Is the NeMo Guardrails microservice still available for production use?

No, NVIDIA has retired the NeMo Guardrails microservice. The NGC catalog page states that NeMo microservices was sunset as of October 1, 2026, with no new releases and no continued support for the artifact. Plan to run the open-source library or its server in your own infrastructure instead. NVIDIA's archived documentation asks existing users to contact their NVIDIA account team about next steps, so raise this with your vendor contact early in any build.

Does a DeployOpen engagement certify that our agent tools are secure?

No. DeployOpen plans, implements, tests and documents tool call validation in your infrastructure and prepares evidence for compliance assessments, but it does not issue audit reports, attestations or certifications. Independent auditors and certification bodies make those determinations. Validation also does not replace database and operating system permissions, which must still limit what each tool can reach. Ask for the findings report and retest results as the evidence you will need.

What to plan before rolling out tool validation

Settle four decisions before any tool-call rail goes live: who owns each tool's allow-list, how Colang flows and tool schemas change, what test coverage each tool needs, and how the configuration is retested after every NeMo Guardrails upgrade. Ownership comes first because an allow-list is a security decision, not a configuration detail. Name one accountable owner per tool, usually the team that runs the internal API or action, plus a security reviewer who approves any new tool or any widened argument schema. Without that pairing, the allow-list drifts toward whatever the model needs, and the rails enforce a policy nobody actually approved.

Next, define the change process for the files that carry the policy. The Colang flows, the tool schemas and the config.yml that wires them together should live in version control, change through reviewed pull requests, and be deployed through the same pipeline as application code. Decide who can approve a change that loosens validation, and record why each allow-list entry exists. Confirm with your team which Colang version your configurations use, since Colang 1.0 is the default and 2.x requires a separate migration with manual review of converted files.

Plan test coverage per tool before rollout. Each tool should have tests for valid calls, malformed arguments, disallowed tool names, and oversized or unexpected tool results, and each test should confirm the fail-closed path blocks the call. Finally, budget a retest after every NeMo Guardrails upgrade. The 0.25.0 release deprecates the LLMRails class in favor of Guardrails, with removal planned no earlier than 0.27.0, so the migration guide should be read against your own configuration before the upgrade is scheduled. Ask any implementation partner to quote this retest as a recurring line item, not a one-time task.

How DeployOpen works on this

DeployOpen plans and implements self-hosted NeMo Guardrails configurations for tool calling inside infrastructure you control, starting from the tools your agent can reach and the data each one returns. The work is agreed as a fixed-scope engagement, with the schema checks, allow lists, fail-closed behavior and evidence written down before the build starts.

How we scope

  • We inventory every tool the agent can call, its parameters, and the systems each tool reaches.
  • We agree in writing which tool calls and tool results the rails will check, and which stay outside scope.
  • We confirm whether your deployment will use the experimental IORails engine or the standard rail path before design begins.

How we build

  • We write tool schemas and allow lists in your repository and configure the rails to reject calls that do not match.
  • We set fail-closed behavior so an unvalidated or errored tool call is blocked and logged rather than passed through.
  • We test validation of both model tool calls and the results returned to the model, using cases drawn from your tool inventory.

How we hand over

  • You receive the configuration files, schemas, allow lists and any custom actions, all stored in version control.
  • You receive documentation of the rails in place, the blocked-call behavior, the logs produced, and the known gaps.
  • We walk your engineers through running, reviewing and changing the tool rules, and confirm what remains your responsibility.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Retainers can cover tracking NeMo Guardrails releases, such as the 0.25.0 release, and reviewing configuration changes against them.
  • Retesting after new tools are added or permissions change is agreed in the written scope, so coverage does not drift silently.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.