anvil eval <file> to execute a structured test suite against an agent route. Each suite is a TypeScript file that default-exports a suite object created with defineEvalSuite from anvil/eval. Anvil loads the file, runs every test case through your agent, evaluates all assertions, and prints a pass/fail report. Because anvil eval exits with code 1 when any case fails, you can plug it directly into CI pipelines.
Usage
<file> is the path to a suite file that default-exports the result of defineEvalSuite(...). Relative and absolute paths are both accepted.
Assertions
anvil/eval ships two families of assertions.
Deterministic assertions
These assertions run synchronously against the agent’s recorded run and never make additional model calls:LLM-as-judge assertion
judge({ client, rubric, model? }) scores the agent’s final output against a free-text rubric using a model. The judge prompt is strict: the model must respond with {"pass": boolean, "reason": string}. Judge calls run through the same LlmClient instance you provide — so they are traced and cost-tracked exactly like any other model call, and their spend is visible in the dashboard.
defineEvalSuite
Import defineEvalSuite from anvil/eval and use it as the default export of your suite file. It is a typed identity function — its only job is to give you autocomplete and type safety:
EvalSuite has three fields:
Use
agentRunner from anvil/eval to build a runner from your agent configuration without wiring up the streaming loop yourself.
Minimal eval suite example
Example report output
1 because one case failed.
A fully passing run looks like:
0.
CI integration
Judge model calls are routed through the same
LlmClient you provide to judge(...). This means they are traced, and their token usage and cost appear in the Anvil dashboard alongside the agent calls they evaluate.