Overview
Assertions evaluate a completedVevalExecutionContext and return a failure message or null on pass. They can be attached to scenarios (applied to every item) or to individual ScenarioItems.
Built-in assertions
NoErrors
Fails if any step completed with error status.MaxSteps
Fails if the total number of steps (including nested) exceeds the limit.MaxCost
Fails if the totalcost_usd across all steps exceeds the limit.
MaxDuration
Fails if the total step duration exceeds the limit in milliseconds.StepExists
Fails if no step with the given name exists anywhere in the trace (including nested steps).OutputContains
Fails if no step’s output contains the expected string.ToolCalled
Fails if no step withtype = "tool" and the given name was recorded. Use handle.SetMeta("type", "tool") when recording tool steps.
Custom assertions
ImplementITraceAssertion to write your own: