Skip to main content

Guide

Test AI agent answers before release

An agent change that reads well can still answer worse. The only way to know is to run it against the questions it will actually get, before it reaches customers.

Test cases

A test case is a question a customer might ask, and what a good answer must do.

A case holds:

  • The question, exactly as a customer would send it.
  • What a good answer must do, in starter cases, as plain-language requirements such as "offers a refund only within 30 days" or "hands off to a person when asked". A model reads the answer and judges each one.
  • Which skills or tools it should use, for an agent that looks things up or takes actions.

There is no expected answer to match word for word. An agent started from a template comes with starter cases, and anyone on the team can add one from a real conversation: open the run in the agent's Runs tab, type the question the customer asked, and save it as a case. Contexory fills in the skills and tools that run used as what the case expects, so save a run whose answer was right. The agent's Evals tab lists every case and the recent gate runs.

A quick check while you edit

While you edit the agent's instructions, press Run quick check. It runs a few of the agent's cases, up to three, against your draft with a real model, and shows which pass. Nothing is saved or released.

It is a fast signal, not the full test. The full set runs in the gate, on a release.

The gate before production

Open a release and press Run gate. Every case runs against that release with a real model, and the share that pass decides what happens when an owner or admin tries to make it live:

ResultWhenProduction
PassAt least 95% of cases passMoves
WarnBetween 80% and 95% passMoves, with the warning shown
FailUnder 80% pass, or the run went over its cost budgetHeld
ErrorA case errored, or the run could not finishHeld

A held release can still go live if an owner or admin gives a written reason, which is saved to the activity log.

No gate run, no hold

A release nobody ran the gate on is not held, and an agent with nothing to test has nothing to hold it against. The gate protects production once there is something to test and someone runs it, so make that part of every release.

Cases that catch things

A suite of easy questions passes every release and catches nothing. Cases worth having:

  • Keep the starter cases. An agent started from a template comes with cases whose plain-language checks a model judges.
  • Cover the questions that matter most. Save a good run for each kind of question customers ask often.
  • Know what a saved run checks. It checks which skills and tools the agent used, not its wording, so a wrong answer that uses the right tools still passes.
  • Save from real conversations. A run is saved as a case from the run's own page.

When a bad answer gets through

No suite catches everything. When a bad answer reaches customers, the fix is to go back to the release before it, in one step that no test can hold. See rolling back an agent change.

Contexory is where a team writes, tests and releases an agent's instructions. Start free and connect your first agent.