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.
Here's what the flow illustrated in figure 1 looks like to a back-end MCP server:
- An MCP client or agent sends a
tools/callrequest to the gateway - The RHCL AuthPolicy authenticates and authorizes the caller
- MCP router identifies the tool and backend
- MCP router sends the tool name and JSON arguments to NeMo Guardrails
- A blocked request never reaches the MCP server
- If the request does go through, the response is held long enough to inspect the content, and it is forwarded to NeMo
- 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/secretmust be set totrue - 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
EOFDeploy 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: