Validator Syntax
All validators use thename! suffix convention:
! suffix distinguishes validators from regular YAML keys.
Transforms
Transforms allow you to normalize values before validation. This is useful for case-insensitive matching or handling whitespace.Available Transforms
Chaining Transforms
Apply multiple transforms in order:trim, then lowercase, then collapse_whitespace.
Negation
Most validators support negation using thenot_ prefix or the negate field.
Using Aliases
Using the negate Field
Combining Negation with Transforms
Validator Categories
Comparison
String matching, patterns, and equality checks
Type
Type checking, JSON, and format validation
Length
Length constraints and bounds
LLM
AI-powered checks for claims, meaning, and language
Flow
Execution sequence and parallelism
Quick Reference
Where Validators Apply
Output Validation
Timing Validation
Span Validation
Usage Validation
The token field names depend on the model provider:
- OpenAI: Use
input_text_tokensandoutput_text_tokens(e.g.,input_text_tokens: lte!: 500,output_text_tokens: lte!: 1000) - Anthropic: Use
input_tokensandoutput_tokens(e.g.,input_tokens: lte!: 500,output_tokens: lte!: 1000)