Guardrail Rules

The rule types the GenAI Engine runs on prompts and responses

Each guardrail rule checks prompts, responses, or both for one kind of risk. You create rules as defaults that apply to every task, or as task rules that apply to a single application. See the Rule Configuration Guide for request bodies and result formats.

RuleWhat it catchesRuns ontypeHow it detects
HallucinationClaims in a response that the provided context does not supportResponse (requires context)ModelHallucinationRuleV2LLM evaluator
Prompt InjectionJailbreaks and attempts to override or leak the system promptPromptPromptInjectionRuleLocal classifier
ToxicityHate speech, profanity, and harmful requestsPrompt, responseToxicityRuleLocal classifiers and profanity matching
Sensitive Data LeakageConfidential information you define by examplePrompt, responseModelSensitiveDataRuleLLM evaluator with few-shot examples
PII LeakageSSNs, card numbers, email addresses, and other PIIPrompt, responsePIIDataRuleLocal recognizers
Custom RulesKeywords and regex patterns you definePrompt, responseKeywordRule, RegexRuleDeterministic matching

Choosing rules

The hallucination and sensitive data rules call the LLM configured for your engine, so they add latency and model cost to each validation call. Set up a provider first; see Configure Model Provider. The other rules run on models and logic bundled with the engine and need no external calls.

Most teams start with PII, prompt injection, and toxicity as default rules, then add hallucination and sensitive data rules per task where retrieval or confidential data is involved.


Did this page help you?