Skip to main content
Beyond routing and cost controls, TrustGate ships guardrail policies that inspect request and/or response content and block (or transform) what they flag. Attach one — or several — as a policy, global or per consumer.

Configure in the console

  1. Open PoliciesCatalog (guardrails are listed first).
  2. Pick TrustGuard (recommended), OpenAI Moderation, Azure Content Safety, Bedrock Guardrail, or Regex Replace.
  3. For TrustGuard, select or create an Agent Runtime collector when prompted — connection settings are platform-managed on SaaS.
  4. Set direction (request / response), mode (Enforce / Observe), and scope.
  5. Save. Exercise blocks in the Playground; inspect Security flags under Activity.
Streaming responses cannot be inspected or blocked in realtime by these policies. Apply guardrails on the request leg (or to non-streaming responses) for enforcement.

TrustGuard

The trustguard policy inspects content with TrustGuard — NeuralTrust’s runtime security service for jailbreaks, PII, toxicity, and tool abuse — and block what it flags. This is the deepest detection option and the recommended default for NeuralTrust deployments. TrustGuard fails open: on any transport error, timeout, non-2xx response, or missing base URL, the request passes through. Connection settings come from the deployment’s TRUSTGUARD_* environment. See the TrustGate integration.

OpenAI Moderation

The openai_moderation policy screens text with the OpenAI Moderations API and blocks content that crosses configured category thresholds. Text-only. In enforce mode this policy fails closed (HTTP 502) on any moderator error; observe mode records and passes through.

Azure Content Safety

The azure_content_safety policy screens request content with the Azure AI Content Safety Analyze Text API and blocks categories whose severity meets the configured threshold. Fails closed in enforce mode.

AWS Bedrock guardrail

The bedrock_guardrail policy applies an AWS Bedrock guardrail to request prompts and/or responses. It inspects the topic, content, word, sensitive-information (PII), and contextual-grounding policy families configured on the guardrail, and blocks with a 403 or anonymizes PII in place. Streaming responses pass through untouched.

Regex Replace

The regex_replace policy (Regex Replace in the catalog) rewrites the request prompt or the LLM response with ordered RE2 regular expressions. Rules chain: each rule sees the previous rule’s output. A single policy instance targets one leg (request or response), not both. Streaming responses pass through untouched.

Configure in the console

  1. PoliciesCatalogRegex Replace.
  2. Choose the target leg (request or response) and add ordered rewrite rules (pattern, replacement, optional case-insensitive / multiline).
  3. Set mode and scope, then save.

Choosing a guardrail

  • trustguard — the richest, NeuralTrust-native detection; use it as the primary guardrail and correlate its findings with Telemetry Alerts.
  • openai_moderation / azure_content_safety — lightweight content moderation if you already use those providers.
  • bedrock_guardrail — reuse guardrails you’ve already defined in AWS Bedrock, including in-place PII anonymization.
  • regex_replace — deterministic string rewrite when you need simple pattern-based redaction or rewriting without an external moderator.
Guardrails compose: run several in one policy chain (e.g. TrustGuard on the request plus a Bedrock guardrail for PII anonymization on the response).