Guardrails

Validate content with guardrails

Configuration

Content to Validate*
Enter content to validate
Validation Type*
Valid JSON
Regex Pattern
e.g., ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
Shown when validationType is 'regex'.
Knowledge Base
Select knowledge base
Shown when validationType is 'hallucination'.
Model
Type or select a model...
Shown when validationType is 'hallucination'.
Confidence
3
Shown when validationType is 'hallucination'.
Number of Chunks to Retrieve
5
Available in Advanced mode. Shown when validationType is 'hallucination'.
API Key
••••••••
Shown when validationType is 'hallucination' and applicable to the selected model at runtime.
PII Types to Detect
PII Types to Detect
Shown when validationType is 'pii'.
Action
Block Request
Shown when validationType is 'pii'.
Language
English
Shown when validationType is 'pii'.

Tools

guardrails_validate

Validate content using guardrails (JSON, regex, hallucination check, or PII detection)

Input

ParameterTypeRequiredDescription
inputstringYesContent to validate (from wired block)
validationTypestringYesType of validation: json, regex, hallucination, or pii
regexstringNoRegex pattern (required for regex validation)
knowledgeBaseIdstringNoKnowledge base ID (required for hallucination check)
thresholdstringNoConfidence threshold (0-10 scale, default: 3, scores below fail)
topKstringNoNumber of chunks to retrieve from knowledge base (default: 10)
modelstringNoLLM model for confidence scoring (default: gpt-4o-mini)
apiKeystringNoAPI key for LLM provider (optional if using hosted)
piiEntityTypesarrayNoPII entity types to detect (empty = detect all)
piiModestringNoPII action mode: block or mask (default: block)
piiLanguagestringNoLanguage for PII detection (default: en)

Output

ParameterTypeDescription
passedbooleanWhether validation passed
validationTypestringType of validation performed
inputstringOriginal input
errorstringError message if validation failed
scorenumberConfidence score (0-10, 0=hallucination, 10=grounded, only for hallucination check)
reasoningstringReasoning for confidence score (only for hallucination check)
detectedEntitiesarrayDetected PII entities (only for PII detection)
maskedTextstringText with PII masked (only for PII detection in mask mode)

Input

ParameterTypeRequiredDescription
inputstringYesContent to validate (automatically receives input from wired block)
validationTypestringYesType of validation to perform (json, regex, hallucination, or pii)
regexstringNoRegex pattern for regex validation. Shown when validationType is 'regex'.
knowledgeBaseIdstringNoKnowledge base ID for hallucination check. Shown when validationType is 'hallucination'.
thresholdstringNoConfidence threshold (0-10 scale, default: 3, scores below fail). Shown when validationType is 'hallucination'.
topKstringNoNumber of chunks to retrieve from knowledge base (default: 5). Shown when validationType is 'hallucination'.
modelstringNoLLM model for hallucination scoring (default: gpt-4o-mini). Shown when validationType is 'hallucination'.
apiKeystringNoAPI key for LLM provider (optional if using hosted). Shown when validationType is 'hallucination' and applicable to the selected model at runtime.
piiEntityTypesjsonNoPII entity types to detect (array of strings, empty = detect all). Shown when validationType is 'pii'.
piiModestringNoPII action mode: block or mask. Shown when validationType is 'pii'.
piiLanguagestringNoLanguage for PII detection (default: en). Shown when validationType is 'pii'.

Output

ParameterTypeDescription
inputstringOriginal input that was validated
maskedTextstringText with PII masked (only for PII detection in mask mode)
validationTypestringType of validation performed
passedbooleanWhether validation passed (true/false)
scorenumberConfidence score (0-10, 0=hallucination, 10=grounded, only for hallucination check)
reasoningstringReasoning for confidence score (only for hallucination check)
detectedEntitiesarrayDetected PII entities (only for PII detection)
errorstringError message if validation failed

Usage Instructions

Validate content using guardrails. Check if content is valid JSON, matches a regex pattern, detect hallucinations using RAG + LLM scoring, or detect PII.

Notes

  • Category: blocks
  • Type: guardrails