# Test an agent across different models

> Hold your agent's existing prompts, tools, and skills fixed, run the same deterministic VAIL probes across candidate models, and see which model is the best fit before switching. The page for people is https://agents.projectvail.com/docs/guides/compare-models; all guides: https://agents.projectvail.com/docs/guides.md

## Why compare models against your own definitions

Most agent behavior lives in prose rather than code: in our [model discretion study](https://www.projectvail.com/case-studies/model-discretion), 94% of discovered behavioral risks depended on the language model choosing to follow written instructions. When you switch to a faster, cheaper, or newly released model, you re-roll almost the entire behavioral surface. In our [model-swap case study](https://www.projectvail.com/docs/case-studies/swapping-an-agents-model), moving an internal agent to a smaller model made it 4x faster while compliance with a sensitive-lookup rule dropped from 94% to 50%, even though text-only checks stayed at 99% to 100%.

Public capability benchmarks cannot tell you whether your agent will still check an entitlement before issuing a refund, call the required lookup tool instead of answering from memory, or resolve instructions consistently across runs. With the Agent Assurance Engine, you hold the agent's definitions, rendered probe cases, and deterministic checks fixed, and vary only the underlying model.

## Before you start

- A VAIL organization connected to your coding agent (see the [coding-agent guides](https://agents.projectvail.com/docs/guides) for Claude Code, Codex, Cursor, OpenCode, Hermes Agent, or Google Antigravity).
- The repository of the agent you want to test, plus credentials or provider access for the candidate models you want to compare.
- A sandboxed copy of the agent if running live probes. Probes try to make the agent break its rules, and tool calls are real.

## Generate one shared probe set

Scan your agent once from its current source and generate probes. Because probes and option pools are derived from your agent's written rules and tool schemas, the exact same probe set applies to every candidate model.

Ask your coding agent:

```
Scan the agent in this repository and generate probes for its current definitions. Prioritize high-Impact Fidelity risks and model-based behaviors, and include control probes so we can compare candidate models on both rule adherence and normal task completion.
```

Include **both** vulnerability probes (rules the agent must not break) and **control probes** (legitimate tasks the agent must still complete). A cheaper or overly cautious model that refuses requests can look safe on vulnerabilities while silently failing normal work. Focus first on high-Impact Fidelity risks and `model_based` behaviors, since those are the rules most sensitive to a model swap.

## Option A: Compare models locally

Fastest before deployment or before setting up steering. Local deterministic grading with `vail-grading` supports LangGraph, Hermes, and OpenClaw agents and uses the same grading code as VAIL's hosted engine.

Ask your coding agent (replacing the placeholder model names with the models your agent supports):

```
Test the agent in this repository across <model-a>, <model-b>, and <model-c> using its generated VAIL probes. Keep the prompts, tools, and rendered test cases identical across models, run 5 repetitions per model on the top Fidelity risks and control probes, grade every run with vail-grading, and show a side-by-side comparison of where each model passes, fails, or behaves inconsistently. Do not edit the agent's code yet.
```

What your coding agent does:

- Downloads `vail-grading` via `get_grading_package` into an isolated virtual environment.
- Renders each probe once (`python -m vail_grading render`) so every candidate model receives the exact same filled message and option-pool values.
- Runs the same number of fresh conversations per model (5 to 10 repetitions catches intermittent slips), converts each capture, and grades all repetitions with `python -m vail_grading grade`.
- Saves the comparison under `.vail/improvement/` without changing your agent's code first, giving you an apples-to-apples baseline.

## Option B: Compare models in a hosted steering experiment

Best for staged or deployed LangGraph, Hermes, OpenClaw, or custom HTTP agents (direct or via the [agent connector](https://agents.projectvail.com/docs/guides/connector.md)), when you want reproducible server-side reports, applied-profile receipts proving which model ran, or optional prompt tuning for a cheaper model.

**Expose `model` as a per-request steering control.** Ask your coding agent to wire up `vail-steering.json` and per-request receipts, then collect the updated source (`collect_github_source` if you may promote a winning profile as a draft PR):

```
Set up VAIL steering on this agent so the model (and temperature or reasoning effort if supported) can be overridden per request via vail-steering.json without mutating global state. Validate the contract and add tests confirming each response returns an applied-profile receipt showing the actual model used.
```

**Run a controlled side-by-side comparison.** Freeze the reviewed cases, run the baseline on your current model, define one profile per candidate model (`set_experiment_profiles`), and run `phase: comparison` with equal repetitions:

```
Create a VAIL steering experiment for this agent with the reviewed Fidelity-risk and control probes, run the baseline on our current model, then run a manual comparison with profiles for <model-a>, <model-b>, and <model-c> using 5 comparison repetitions each. Summarize pass rates, control regressions, and applied-profile receipts from the experiment report.
```

**Check applied-profile receipts.** Every response in `get_experiment_execution` reports the model the agent actually used before and after overrides, confirming that candidate model overrides were not silently ignored or clamped back to the default.

**Optional: test whether light steering closes a gap.** If a much cheaper model matches baseline everywhere except one or two rules, run a bounded steering sweep anchored on that model to test whether small instruction or parameter adjustments recover compliance:

```
Run a VAIL steering sweep anchored on <cheaper-model> (max 3 candidates, patience 2) to see whether bounded instruction or parameter adjustments close the remaining failures without regressing controls, and preview the promotion diff before opening any draft PR.
```

## Read the results and pick the best fit

Compare each candidate model on three dimensions: vulnerability pass rate, control pass rate, and run-to-run consistency.

- **Matches or beats baseline on both vulnerabilities and controls:** strong candidate to adopt. Approve the probes in the [web app](https://agents.projectvail.com) and keep them on a schedule to catch future model or provider drift.
- **Fails specific `model_based` hard boundaries** (permissions, confirmation gates, write access): enforce those boundaries in code or credentials instead of rejecting a faster or cheaper model over a prose-only rule, then re-run the same probes.
- **Drops on workflow adherence or control probes:** keep the stronger model, test a bounded steering adjustment, or route only narrower tasks to the cheaper model.

Even for the same open-weight model, different inference providers can behave differently or drift over time, as VAIL's Stability Arena recorded in the [Novita-MiniMax case study](https://www.projectvail.com/docs/case-studies/novita-minimax.md), where endpoints serving the same model showed very different stability and divergence. Once you choose a model for your agent, check its provider endpoints in the [Stability Arena](https://arena.projectvail.com), or use [Model Assurance](https://www.projectvail.com/platform/model-assurance) to monitor the serving endpoint behind your agent.
