Skip to main content
Validators are the core of Timbal’s eval system. They check specific properties of your agent’s execution and determine whether an eval passes or fails.

Validator Syntax

All validators use the name! suffix convention:
The ! 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:
Transforms are applied left-to-right: first trim, then lowercase, then collapse_whitespace.

Negation

Most validators support negation using the not_ 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_tokens and output_text_tokens (e.g., input_text_tokens: lte!: 500, output_text_tokens: lte!: 1000)
  • Anthropic: Use input_tokens and output_tokens (e.g., input_tokens: lte!: 500, output_tokens: lte!: 1000)

Combining Validators

Multiple Validators on One Target

Apply multiple validators to the same target:
All validators must pass for the eval to succeed.

Nested Validation

Validate nested properties in span inputs/outputs:

Error Messages

When a validator fails, it provides detailed error information:
For LLM validators: