Managing Guardrails
Create and manage AI guardrails in the Umbraco backoffice.
AI Guardrails allow you to define safety, compliance, and quality rules that evaluate AI inputs and responses at runtime. Rules can block, warn, or redact when content is flagged.
Accessing Guardrails
Navigate to the AI section in the main navigation.
Click Guardrails in the tree.

Creating a Guardrail
Click Create Guardrail in the toolbar.
Fill in the required fields:
Alias
Unique identifier for code references (URL-safe, no spaces)
Name
Display name shown in the backoffice
Click Create.

Adding Rules
Guardrails contain one or more rules. Each rule references a registered evaluator that performs the actual content evaluation:
In the guardrail editor, click Add Rule.
Configure the rule:
Evaluator
The evaluator to use (Contains, Regex Match, or LLM Safety Judge)
Name
Display name for the rule
Phase
When to evaluate: Pre-Generate or Post-Generate
Action
What to do when flagged: Block, Warn, or Redact
Config
Evaluator-specific settings
Click Add.


Evaluation Phases
Pre-Generate
Evaluates user input before sending to the AI provider.
Post-Generate
Evaluates the AI response before returning to the user.
Actions
Block
Stops processing and returns an error to the caller.
Warn
Allows the content through unchanged and logs a warning.
Redact
Replaces flagged content with [REDACTED] before it reaches the AI model or caller.
Available Evaluators
Contains
contains
Code-based
Flags content containing a specific substring.
Yes
Regex Match
regex
Code-based
Flags content matching a regular expression pattern.
Yes
LLM Safety Judge
llm-judge
Model-based
Uses an AI model to evaluate content for safety, misinformation, and compliance.
No
Decision Safety Judge
decision-judge
Model-based
Asks a Decision profile a yes/no question about whether content is safe (experimental).
No
Contains Evaluator
Searches for a substring in the content. Useful for blocking competitor brand mentions, prohibited terms, or specific phrases.
Search Pattern
The substring to find in the content
Ignore Case
Case-insensitive search (default: on)
Regex Match Evaluator
Matches content against a regular expression. Useful for detecting patterns like email addresses, phone numbers, Social Security Numbers (SSNs), or profanity patterns.
Regex Pattern
Regular expression to match against content
Ignore Case
Case-insensitive matching (default: on)
Multiline
Enable multiline mode where ^ and $ match line boundaries
LLM Safety Judge Evaluator
Uses an AI model to evaluate content against custom criteria. Returns a safety score between 0 and 1. Content is flagged when the score falls below the configured threshold.
Judge Profile ID
AI profile to use for evaluation (leave empty for default)
Evaluation Criteria
What aspects to evaluate (safety, compliance, brand voice, etc.)
Safety Threshold
Content is flagged if the safety score is below this value (0-1, default: 0.7).
Decision Safety Judge Evaluator
Asks a Decision profile a yes/no question: is this content safe and compliant, based on your criteria? The answer comes back as a probability between 0 and 1. Content is flagged when the probability falls below the Safety Threshold.
Profile
Decision profile to use for evaluation. Only Decision profiles are listed. Leave empty to use the default Decision profile.
Evaluation Criteria
What aspects to evaluate for safety and compliance.
Safety Threshold
Content is flagged if the safety probability is below this value (0-1, default: 0.7).
The Decision Safety Judge is model-based. During streaming, it runs after the full response is available. It only flags content and cannot redact.
When content is flagged, the rule reason shows the probability and threshold, for example: Safety probability 0.04 below threshold 0.70.
The evaluator does not fall back to the LLM Safety Judge. Instead, it fails safe and flags the content with a reason in these cases:
The Decision feature flag is turned off.
No profile is selected and no default Decision profile is configured.
The call to the Decision profile fails.
Reordering Rules
Rules are evaluated in order. To reorder:
Drag rules using the handle on the left.
Or use the arrow buttons to move rules up/down.
Rules at the top are evaluated first.

Editing a Guardrail
Select the guardrail from the list.
Modify fields as needed.
Add, edit, or remove rules.
Click Save.
Deleting a Guardrail
Select the guardrail from the list.
Click Delete in the toolbar.
Confirm the deletion.
Example: Content Safety Guardrail
A typical content safety guardrail might include:
Name: Content Safety Policy
Rules:
Block competitor mentions (Pre-Generate, Redact)
Evaluator: Contains
Search Pattern: competitor brand name
Redacts competitor mentions before sending to the AI provider.
Block profanity (Pre-Generate, Block)
Evaluator: Regex Match
Pattern matching for prohibited language patterns
LLM content safety check (Post-Generate, Warn)
Evaluator: LLM Safety Judge
Evaluates response quality and safety against custom criteria.
Example: PII Redaction Guardrail
A guardrail that strips sensitive data instead of blocking:
Name: PII Protection
Rules:
Redact email addresses (Pre-Generate, Redact)
Evaluator: Regex Match
Pattern:
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}Replaces email addresses with
[REDACTED]before sending to the AI provider.
Redact phone numbers (Pre-Generate, Redact)
Evaluator: Regex Match
Pattern:
\b\d{3}[-.]?\d{3}[-.]?\d{4}\bReplaces phone numbers with
[REDACTED].
Block SSN patterns (Pre-Generate, Block)
Evaluator: Regex Match
Pattern:
\b\d{3}-\d{2}-\d{4}\bBlocks requests containing Social Security Number patterns.
Assigning Guardrails
Guardrails are assigned via the Governance tab on profiles, prompts, and agents:
Profiles - Open a chat profile and go to the Governance tab to assign guardrails.
Prompts - Open a prompt and go to the Governance tab to assign guardrails (requires Prompt add-on).
Agents - Open an agent and go to the Governance tab to assign guardrails (requires Agent add-on).
When multiple sources assign guardrails (e.g., both a profile and an agent), all guardrails are combined and deduplicated at runtime.
Assigning to a Profile
When editing a chat profile:
Go to the Governance tab.
Click Add Guardrail in the Guardrails section.
Select the guardrail(s) to apply.
Save the profile.
Assigning to a Prompt
When editing a prompt (requires Prompt add-on):
Go to the Governance tab.
Click Add Guardrail in the Guardrails section.
Select the guardrail(s) to apply.
Save the prompt.
Assigning to an Agent
When editing an agent (requires Agent add-on):
Go to the Governance tab.
Scroll to the Guardrails section (below Tool Permissions for standard agents).
Click Add Guardrail.
Select the guardrail(s) to apply.
Save the agent.
Version History
See Version History for information on viewing and restoring previous versions.
Related
Guardrails Concept - Understanding guardrails
Version History - Tracking changes
Last updated
Was this helpful?