Overview
Flow and count assertions verify the behavior of an agent — which tools it called, in what order, how many times, and with what arguments.Assertions reference
assert_called
Tool was called at least once:assert_never_called
Tool was never called:assert_called_before
Toola was called before tool b (positional ordering across all turns):
assert_called_times
Tool was called betweenmin and max times:
assert_called_with
Tool was called with specific argument values (partial match):assert_tool_succeeded
Tool was called and every execution succeeded (no error in any result):assert_max_turns
Trace has at mostn turns:
assert_total_duration_under
Total trace duration is under a threshold (milliseconds):Flow patterns
assert_flow matches the ordered sequence of tool calls against a pattern. Patterns support ... (Ellipsis) for “any number of calls here”: