Guardrail
On this page
Purpose
Guardrail checks an English Message for selected PII entities and selected OpenAI moderation categories. It routes the original Message to Pass or Fail. It does not redact or rewrite the message.

When to use it
- Route a user Message with selected PII to a review path.
- Check an Agent response for selected moderation categories before display.
- Send clean and flagged Messages to different downstream paths.
Required setup
PII checks need no credential. Moderation checks require an OpenAI API key.
How to use it
- Connect the Message to Message.
- Select the PII categories, moderation categories, or both.
- Connect Pass to the clean-message path and Fail to the flagged-message path.
- Use Single Output when the two paths should not both run.
Configuration
| Setting | What it controls | Recommended starting point |
|---|---|---|
| Personally identifiable information | Selected Presidio PII entity types. | Select only the PII types the flow must route. |
| Moderation | Selected OpenAI moderation categories. | Select only the categories required by the flow policy. |
| OpenAI API Key | Authenticates moderation requests. | Use a saved Credential when moderation is enabled. |
| Output Mode | Controls the inactive branch. | Start with Both Outputs; use Single Output for separate downstream chains. |
Expected result
With no selected detection, Pass returns the original Message. With any selected PII or moderation detection, Fail returns the original Message. In Both Outputs mode, the inactive output is an empty Message. In Single Output mode, the inactive branch is stopped.
Both category lists default to empty, so every Message passes until you select a detector. The component returns no scores, detected categories, redaction, or audit record. A moderation selection without a valid OpenAI key fails instead of routing the Message.
Reference details
PII detection uses Presidio with English text. Moderation uses OpenAI omni-moderation-latest. PII-only use does not call OpenAI. Guardrail does not provide custom rules, regexes, keywords, sensitivity thresholds, jailbreak checks, hallucination checks, or general policy enforcement. Guardrail is not supported in Agent deployments. Automated PII detection can miss sensitive information, so a Pass result is not a privacy or compliance guarantee.
Related components
- Chat Input supplies a user Message before model processing.
- Agent Core can receive approved input or have its response checked before display.
- Chat Output displays either handled path.
