Skip to main content

Guardrails catalogue

The gateway ships the guardrails below. Each one validates, filters, or transforms content in the request or response pipeline, and you attach it to an LlmProvider, an LlmProxy, or an Mcp proxy. For what guardrails do as a class, and how a chain of them executes, see Guardrails.

Available guardrails​

Guardrail policies are documented in the Policy Hub, the versioned reference for every API Platform policy. For policy categories and how policies chain, see the Policy Hub overview.

GuardrailWhat it checks
Regex GuardrailValidates content against a regular expression
JSON Schema GuardrailEnforces a JSON Schema on request or response payloads
Word Count GuardrailEnforces word-count limits on payloads
Sentence Count GuardrailEnforces sentence-count limits on payloads
Content Length GuardrailEnforces byte-length limits on payloads
URL GuardrailValidates URLs found in request or response bodies
PII MaskingMasks or redacts PII from request/response bodies using configurable regex patterns
Semantic Prompt GuardBlocks or allows prompts based on semantic similarity to configured allow/deny phrases
Azure Content SafetyScreens content against Azure Content Safety API
AWS Bedrock GuardrailValidates content against AWS Bedrock Guardrails
Granite Guardian Prompt InjectionDetects prompt injection and jailbreak attempts in LLM API requests using IBM Granite Guardian 3.3 8B
NeMo Guard Content SafetyValidates request and/or response content using NVIDIA NeMo Guard (llama-3.1-nemoguard-8b-content-safety)

Add or update guardrails​

A guardrail is a gateway policy, so you add or update one by editing the gateway's build.yaml and rebuilding the image with the ap CLI. See Add or Update Policies in a Gateway.

Custom guardrails​

To write your own guardrail policy in Go and build it into the gateway image, see Writing a Custom Policy.

  • Guardrail execution order — the order a chain of these policies runs in, and how the proxy and provider chains combine.
  • Prompt management — the policies that reshape a prompt rather than judging it.
  • MCP governance — the policies that govern MCP traffic, including semantic tool filtering.

Was this page helpful?