Skip to main content
AI
  • Get started with AI

    • Red Hat AI

      Accelerate the development and deployment of enterprise AI solutions.

    • AI learning hub

      Explore learning materials and tools, organized by task.

    • AI interactive demos

      Click through scenarios with Red Hat AI, including training LLMs and more.

    • AI/ML learning paths

      Expand your Red Hat OpenShift AI knowledge using these learning resources.

    • AI quickstarts

      Focused AI use cases designed for fast deployment on Red Hat AI platforms.

    • No-cost AI training

      Foundational Red Hat AI training.

  • Featured resources

    • Red Hat OpenShift AI
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

Red Hat AI Factory with NVIDIA

Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.

Learn
  • Self-guided

    • Documentation

      Find answers, get step-by-step guidance, and learn how to use Red Hat products.

    • Learning paths

      Explore curated walkthroughs for common development tasks.

    • Guided learning

      Receive custom learning paths powered by our AI assistant.

    • See all learning
  • Hands-on

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

    • Interactive labs

      Learn by doing in these hands-on, browser-based experiences.

    • Interactive demos

      Click through product features in these guided tours.

  • Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics
  • Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
Build
  • Get started

    • Red Hat build of Podman Desktop

      A downloadable, local development hub to experiment with our products and builds.

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

  • Download products

    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products
  • Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset
  • References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
Community
  • Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions
  • Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github
  • Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

Join the Red Hat Developer program

Download Red Hat products and project builds, access support documentation, learning content, and more.

ConsoleDocsSupport Search
New For you

Resources to explore

Check out popular resources, tools, and information from Red Hat. We'll recommend more as you browse.

  • Product downloads
  • Cheat sheets
  • Red Hat Developer learning portal
  • Developer blog
  • E-books
  • Developer Sandbox
Log in

Get more with a Red Hat Developer account

  • Product downloads
  • Console access
  • Event registration
  • Training & trials
Explore more account benefitsLog in or register

A subscription may be required for some services.

Contact us

Securing AI agent tool calls at the gateway with NeMo Guardrails

Inspect tool calls with guardrails

December 2, 2026
David Martin Christina Xu
Related topics:
Artificial intelligence
Related products:
Red Hat OpenShift AI

    You've deployed an MCP gateway. OAuth tokens restrict which callers can reach which tools. Authorization policies scope each agent to the servers it needs. Rate limits are in place. Your security checklist says done. Then an agent in your environment opens a provisioning ticket nobody asked it to open. The call was authenticated. The tool was authorized. The request body contained an instruction injected into a prior tool response — and nothing in your auth stack looked at it.

    Authentication and authorization cannot prevent adversarial tool calls

    Model Context Protocol (MCP) lets AI agents discover and use tools across services. For example, in a telco scenario, those tools can read network inventory, inspect service health, open tickets, or change customer and network configuration.

    An authorized provisioning call can still contain a dangerous change. A customer-care result can contain personal information. A diagnostic result can contain instructions that influence an agent's next action. While authentication establishes who is calling, authorization decides whether the caller may use a tool and rate limiting controls traffic volume, none of these controls evaluate the content of the request or response body, nor, apply additional protections to server backends that have access to more sensitive information.

    MCP gateway NeMo Guardrails integration

    The MCP gateway in Red Hat Connectivity Link has an integration with NeMo Guardrails available in Red Hat OpenShift Container Platform 5 and Red Hat OpenShift AI 3.6. NeMo Guardrails, generally available since Red Hat OpenShift AI 3.4, is a collaboration between Red Hat and NVIDIA to deliver a production-ready, open source framework that lets you add programmable safety rails to any LLM application.

    MCP gateway integration extends NeMo Guardrails capabilities to MCP tool call traffic. For incoming requests to the gateway, it inspects arguments in the request body before the underlying proxy sends it to a server backend. For example, it's possible to catch content such as an injected SYSTEM: ignore previous instructions string hidden inside a ticket description field. For responses, it inspects content in the tool result before sending it back to the client (for instance, masking a payment card number returned by a CRM lookup). This content inspection happens independently of any authentication or authorization. Tool call traffic is checked according to guardrail configurations, a set of files that define different text classification algorithms and how they're applied.

    A client request routes through the gateway for authentication and authorization before the router performs security checks using NeMo Guardrails. The approved traffic proceeds to the server while unauthorized or flagged requests are blocked or modified.
    Figure 1: A client request routes through the gateway for authentication and authorization before the router performs security checks using NeMo Guardrails. The approved traffic proceeds to the server while unauthorized or flagged requests are blocked or modified.

    Here's what the flow illustrated in figure 1 looks like to a back-end MCP server:

    1. An MCP client or agent sends a tools/call request to the gateway
    2. The RHCL AuthPolicy authenticates and authorizes the caller
    3. MCP router identifies the tool and backend
    4. MCP router sends the tool name and JSON arguments to NeMo Guardrails
    5. A blocked request never reaches the MCP server
    6. If the request does go through, the response is held long enough to inspect the content, and it is forwarded to NeMo
    7. A response is released with the original result. A blocked response is discarded. A modified response gets sent back redacted or with masked data replaced with [MASK]

    MCP gateway guardrails key concepts

    NeMo Guardrails are applied across your MCP gateway deployment according to 3 controls:

    • Guardrail configurations: Files defining what type of guardrails are applied (PII detection, prompt injection detection, and so on) and how they are applied. These need to be defined as part of the NeMo Guardrails deployment process, prior to referencing them in the MCP gateway
    • Global guardrails: Guardrail configurations applied to every registered MCP server behind the gateway
    • Per-server guardrails: Additional guardrail configurations applied to specific MCP servers (for example, servers that have access to sensitive information or vulnerable tools). When defined, a per-server guardrail is merged with global guardrails. During runtime, the global guardrails run in order, before the per-server guardrails for each MCP server

    Configuring global guardrails for all MCP traffic

    We recommend starting with a global guardrails configuration that inspects all MCP gateway traffic, then additional guardrails for each MCP server needing stricter rules. This can be done using YAML configuration in the Red Hat OpenShift cluster where the MCP gateway is running.

    Create a Secret to store the guardrails route and global guardrail configuration. The Secret requires the following fields:

    • labels: mcp.kuadrant.io/secret must be set to true
    • url: NeMo Guardrails server endpoint
    • model: Model identifier used for guardrails checks
    • configIDs: Names of NeMo Guardrail configurations to use for global guardrails
    • failMode: Behavior on guardrails failure (deny by default, or allow for non-critical services)
    cat <<EOF | oc apply -f -
    apiVersion: v1
    kind: Secret
    metadata:
      name: <SECRET_NAME>
      namespace: <MCP_GATEWAY_NAMESPACE>
      labels:
        mcp.kuadrant.io/secret: "true"
    type: guardrails/external/nemo
    stringData:
      config.yaml: |
        url: <NEMO_SERVER_ENDPOINT>
        model: <NEMO_MODEL_ID>
        configIDs:
          - <NEMO_CONFIG_ID>
        failMode: deny
    EOF

    Deploy the MCPGatewayExtension, annotated with mcp.kuadrant.io/guardrails-ref: <SECRET_NAME>.Replace `<SECRET_NAME>` with the name of the Secret you created in the previous step.

    apiVersion: mcp.kuadrant.io/v1
    kind: MCPGatewayExtension
    metadata:
      name: <MCP_GATEWAY_NAME>
      namespace: <MCP_GATEWAY_NAMESPACE>
      annotations:
        mcp.kuadrant.io/guardrails-ref: <SECRET_NAME>
    spec:
        targetRef:
        name: <GATEWAY_NAME>
        namespace: <GATEWAY_NAMESPACE>
        sectionName: <LISTENER_NAME>

    Once applied, the controller validates the Secret and your global guardrails are active for all MCP traffic through the gateway.

    Adding per-server guardrails

    To enforce a stricter guardrails policy on any individual MCP server, the annotation mcp.kuadrant.io/guardrails-config-ids: "<NEMO_CONFIG_ID_1, NEMO_CONFIG_ID_2>" can be added to its corresponding MCPServerRegistration resource. Replace <NEMO_CONFIG_ID_1, NEMO_CONFIG_ID_2> with the names of existing guardrail configurations. The controller merges global guardrails configurations with per-server ones and at runtime calls to the MCP server run the global guardrail checks first, and then the per-server.

    apiVersion: mcp.kuadrant.io/v1
    kind: MCPServerRegistration
    metadata:
      name: <MCP_SERVER_REGISTRATION_NAME>
      namespace: mcp-system
      annotations:
        mcp.kuadrant.io/guardrails-config-ids: "<NEMO_CONFIG_ID_1, NEMO_CONFIG_ID_2>"
    spec:
      targetRef:
        name: <MCP_SERVER_NAME>
        namespace: <MCP_SERVER_NAMESPACE>
      prefix: <MCP_SERVER_NAME>

    Guardrails is just one component of security

    Guardrails are one layer of a complete MCP security model, not a replacement for it. An AuthPolicy handles authentication and authorization. A RateLimitPolicy controls traffic volume. Separate MCPGatewayExtensions or gateway resources provide server and tool isolation. When these layers work together on Red Hat OpenShift and Red Hat OpenShift AI, guardrails handle the thing the others cannot: Inspecting what is actually being said inside a tool call.

    What to do next

    Learn how to build and deploy built-in and custom guardrails by following Rob Geada's 3-part NeMo Guardrails series. Then follow the MCP gateway guardrails documentation to wire them in.

    If you're evaluating MCP security for a production deployment, talk to a Red Hat solution architect about your requirements.

    Move enterprise AI from prototype to production.

    Join Red Hat AI leaders and technical architects on December 9th for live demos, guardrail deep dives, and the unveiling of Red Hat AI 3.6.

    One registration gives you access to every session live or on demand:

    Book your place now

    Related Posts

    • Securing multimodal AI with NeMo Guardrails and vision models

    • Optimized support for Open NVIDIA Nemotron 3.5 Super VL

    • Add NeMo Guardrails to a LangGraph agent on OpenShift AI

    • Deploy NeMo Guardrails on Red Hat OpenShift AI

    • Developing LLM guardrail configs locally with NeMo Guardrails

    Recent Posts

    • Securing AI agent tool calls at the gateway with NeMo Guardrails

    • Testing AI agents for malicious tool call generation with garak

    • OpenShift Virtualization: Microsoft SQL Server Tuning Guidance

    • OpenShell: Enforceable boundaries for AI agents

    • High Scale OpenShift Cluster Upgrades with Active VM Workloads

    Red Hat Developers logo

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    Red Hat Developer

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility
    Ask AI