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
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | Yes | Content to validate (from wired block) |
validationType | string | Yes | Type of validation: json, regex, hallucination, or pii |
regex | string | No | Regex pattern (required for regex validation) |
knowledgeBaseId | string | No | Knowledge base ID (required for hallucination check) |
threshold | string | No | Confidence threshold (0-10 scale, default: 3, scores below fail) |
topK | string | No | Number of chunks to retrieve from knowledge base (default: 10) |
model | string | No | LLM model for confidence scoring (default: gpt-4o-mini) |
apiKey | string | No | API key for LLM provider (optional if using hosted) |
piiEntityTypes | array | No | PII entity types to detect (empty = detect all) |
piiMode | string | No | PII action mode: block or mask (default: block) |
piiLanguage | string | No | Language for PII detection (default: en) |
Output
| Parameter | Type | Description |
|---|---|---|
passed | boolean | Whether validation passed |
validationType | string | Type of validation performed |
input | string | Original input |
error | string | Error message if validation failed |
score | number | Confidence score (0-10, 0=hallucination, 10=grounded, only for hallucination check) |
reasoning | string | Reasoning for confidence score (only for hallucination check) |
detectedEntities | array | Detected PII entities (only for PII detection) |
maskedText | string | Text with PII masked (only for PII detection in mask mode) |
Input
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | Yes | Content to validate (automatically receives input from wired block) |
validationType | string | Yes | Type of validation to perform (json, regex, hallucination, or pii) |
regex | string | No | Regex pattern for regex validation. Shown when validationType is 'regex'. |
knowledgeBaseId | string | No | Knowledge base ID for hallucination check. Shown when validationType is 'hallucination'. |
threshold | string | No | Confidence threshold (0-10 scale, default: 3, scores below fail). Shown when validationType is 'hallucination'. |
topK | string | No | Number of chunks to retrieve from knowledge base (default: 5). Shown when validationType is 'hallucination'. |
model | string | No | LLM model for hallucination scoring (default: gpt-4o-mini). Shown when validationType is 'hallucination'. |
apiKey | string | No | API key for LLM provider (optional if using hosted). Shown when validationType is 'hallucination' and applicable to the selected model at runtime. |
piiEntityTypes | json | No | PII entity types to detect (array of strings, empty = detect all). Shown when validationType is 'pii'. |
piiMode | string | No | PII action mode: block or mask. Shown when validationType is 'pii'. |
piiLanguage | string | No | Language for PII detection (default: en). Shown when validationType is 'pii'. |
Output
| Parameter | Type | Description |
|---|---|---|
input | string | Original input that was validated |
maskedText | string | Text with PII masked (only for PII detection in mask mode) |
validationType | string | Type of validation performed |
passed | boolean | Whether validation passed (true/false) |
score | number | Confidence score (0-10, 0=hallucination, 10=grounded, only for hallucination check) |
reasoning | string | Reasoning for confidence score (only for hallucination check) |
detectedEntities | array | Detected PII entities (only for PII detection) |
error | string | Error 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