The shape: two trials and one floor
A regression test for an agent is a trial: one fixed version of the agent, a candidate, meets every task on a bench, and every attempt runs in a fresh world and is graded on its own. The full trial is the honest one: every task, every archetype of simulated user the bench defines, three repeats. It is also slow. A full trial with many tasks and three repeats takes hours, and a pull request cannot wait for it.
So the pattern most teams settle on has two trials and one rule.
- On every pull request, a small trial. A handful of task ids from the bench, one repeat, started once by hand and reused by every pull-request build. It answers "did this change break something obvious" in minutes.
- Every night, the full trial. Every task, every archetype, three repeats, built from the main branch. Each night's build is added to one long-lived trial, so the console shows every version side by side on the same tasks.
- One floor, judged on the interval. The job fails only when the top of the new version's 95% confidence interval is below the floor you set. Noise alone rarely does that. Start a little below the agent's current pass rate and raise the floor as the agent improves.
Be honest about duration and noise. A bench of 24 tasks with three repeats is 72 attempts a night, which takes a couple of hours, and the interval on 72 attempts is about plus or minus 11 points. Read the nightly chart as a trend, not as a verdict on one night. The pull-request trial trades coverage for speed on purpose; the nightly carries the coverage.
What a bench is and how a trial runs is in the Veris Bench docs. The script below is the one from the docs page Regression testing in CI/CD, unchanged. This page adds the second trial and the pull-request trigger.
Before the workflow runs
Three things exist before the first run, and a fourth is started once.
- A candidate template. Your agent has been on the bench at least once (Add your agent). Save the candidate body as
bench/candidate.jsonin your repository, withoutnameandimage.ref; the script fills both in on each run. It says how the bench talks to your agent: the port, the path and the health check. - Variables and a secret. In the repository's Actions settings:
BENCH_API,BENCH_IDandMIN_PASS_RATEas variables, andBENCH_API_KEYas a secret. The key is issued once in the console and starts withvbk_. - Image access. The workflow pushes to GitHub Container Registry. The first push creates a private package, even from a public repository, and the bench cannot pull a private package without a login. After the first run, make the package public or save a registry login in the bench, once.
- The small trial, started once. A trial fixes the bench's tasks at the moment it starts, and the script adds each build to the trial named by
TRIAL_NAME, so the pull-request trial is a second, smaller full trial you start by hand with a few task ids. Pick the tasks a change is most likely to break.
{
"image": {"port": 8008, "path": "/chat", "health_path": "/health"},
"channel_config": {
"init": null,
"channel": {
"type": "http",
"url": null,
"method": "POST",
"request": {"message_field": "message", "session_field": "session_id"},
"response": {"type": "json", "message_field": "response", "session_field": "session_id"}
}
}
}
# Pick the task ids once: the handful a change is most likely to break.
curl -s "$BENCH_API/benches/$BENCH_ID/tasks?limit=200" \
-H "Authorization: Bearer $VERIS_API_KEY" | jq -r '.items[] | "\(.id) \(.name)"'
# Start the small trial. Every pull-request build is added to it from here on,
# so each one meets the same tasks. One repeat: the nightly carries the repeats.
curl -s -X POST "$BENCH_API/benches/$BENCH_ID/trials" \
-H "Authorization: Bearer $VERIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "pr-check",
"kind": "full",
"candidate_ids": ["cand_..."],
"task_ids": ["task_...", "task_...", "task_...", "task_...", "task_..."],
"repeats": 1
}'
The nightly trial needs no such step: the first nightly run creates it, as a full trial over every task, every archetype and three repeats.
The two workflows
Both call the same script, .github/bench/regression.sh, copied as is from the docs. Each run of the script does five things: builds and pushes the image by digest; checks that the bench can pull it and registers it as a new candidate; adds the candidate to the trial named by TRIAL_NAME, or starts that trial on the first run; polls the trial's results until none of the candidate's attempts is running or waiting for its grade; and reads the candidate's pass rate, failing the job if even the top of its confidence interval is below MIN_PASS_RATE.
name: Bench check
on:
pull_request:
permissions:
contents: read
packages: write # push the image to GHCR
# One check per pull request; a new push cancels the one still running.
concurrency:
group: bench-check-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
bench:
runs-on: ubuntu-latest
# A pull request from a fork cannot read the secret, so skip the bench there.
if: github.event.pull_request.head.repo.full_name == github.repository
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Image name # GHCR needs it in lowercase
run: echo "IMAGE=ghcr.io/${GITHUB_REPOSITORY,,}" >> "$GITHUB_ENV"
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: build
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ env.IMAGE }}:${{ github.sha }}
- name: Run on the bench
env:
BENCH_API: ${{ vars.BENCH_API }}
BENCH_ID: ${{ vars.BENCH_ID }}
MIN_PASS_RATE: ${{ vars.MIN_PASS_RATE }}
VERIS_API_KEY: ${{ secrets.BENCH_API_KEY }}
TRIAL_NAME: pr-check # the small trial, started once by hand (step 3)
IMAGE_REF: ${{ env.IMAGE }}@${{ steps.build.outputs.digest }}
CANDIDATE_JSON: bench/candidate.json
WAIT_MINUTES: "45"
run: bash .github/bench/regression.sh
name: Bench regression
on:
workflow_dispatch:
schedule:
- cron: "0 6 * * *" # every day at 06:00 UTC
permissions:
contents: read
packages: write
concurrency:
group: bench-regression
cancel-in-progress: false
jobs:
bench:
runs-on: ubuntu-latest
timeout-minutes: 360 # GitHub's job limit; WAIT_MINUTES stays inside it
steps:
- uses: actions/checkout@v4
- name: Image name
run: echo "IMAGE=ghcr.io/${GITHUB_REPOSITORY,,}" >> "$GITHUB_ENV"
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: build
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ env.IMAGE }}:${{ github.sha }}
- name: Run on the bench
env:
BENCH_API: ${{ vars.BENCH_API }}
BENCH_ID: ${{ vars.BENCH_ID }}
MIN_PASS_RATE: ${{ vars.MIN_PASS_RATE }}
VERIS_API_KEY: ${{ secrets.BENCH_API_KEY }}
TRIAL_NAME: nightly # the full trial: every task, every archetype, three repeats
IMAGE_REF: ${{ env.IMAGE }}@${{ steps.build.outputs.digest }}
CANDIDATE_JSON: bench/candidate.json
WAIT_MINUTES: "300"
run: bash .github/bench/regression.sh
Two details worth keeping. Every build is pushed by digest and named after the trial, the date and the commit, so a candidate on the bench can always be traced back to the code that produced it. And a trial must stay unchanged while it runs: if the bench's tasks or archetypes are edited after a trial starts, the script stops with a message rather than mixing results, and you start a new series with a new TRIAL_NAME.
Choosing the floor
The job fails only when ci_high, the top of the new version's interval, is below MIN_PASS_RATE. That is deliberate. A pass rate over a few dozen attempts moves from run to run without anything changing, and a gate on the point estimate would fail builds for noise. Start the floor a little below the agent's current pass rate and raise it as the agent improves. With the floor at zero the job reports the result and never fails on it, which is a reasonable first week.
When a run does fail, the message says why: a missing variable, an image the bench cannot pull, a trial whose tasks changed, a trial still running after the wait, or a pass rate under the floor. The last one is the regression. Open the trial in the console, put the new version next to the last one, and read the transcripts and tool calls of the attempts that passed before and fail now.
A nightly in the open: the cookbook card-replacement agent
The card-replacement agent in the Veris cookbook runs this pattern every night, in public. The workflow builds the agent from the main branch, adds it as a new candidate to one long-lived trial on the Card Service Desk bench, waits for its 72 attempts (24 tasks, three repeats) to finish, and redraws a chart from the whole trial. Each dot is one night's pass rate and the bar is its 95% interval; a hollow dot is a night where some attempts did not count.
The bench's 24 tasks run against a Postgres twin of the bank's customers and cards, and the judge grades on the tool trace, the SQL ledger and the transcript, never on what the agent says it did. The agent's code only changes when the repository does, so night-to-night movement is mostly the models drifting: the agent's, the simulated customer's and the judge's. The README says what to read into that and what not to: with 72 attempts a night the interval is about plus or minus 11 points, so trends, not single nights. It also names a known bug (seven tasks fail until the agent can find a card by its owner) that will show up as a step in the chart when it is fixed, which is what a regression series is for.
- The script is generic: register the image as a candidate, find or create the trial, poll until the attempts finish, leave Veris-side failures out of the pass rate, write the results and the chart.
- The only agent-specific input is
bench/candidate.json: how the bench talks to this agent. - Never delete a candidate that is in the trial, and change the series name on purpose rather than editing the bench under a running series.
Coding agents: the same idea one layer down
The bench tests the agent you ship. The code that agent is built from has its own regression problem: integrations against databases, payment APIs and CRMs that a unit test cannot reach. Veris for coding agents runs stateful twins of the services your code calls, so a coding agent builds and tests integrations against them instead of a live vendor account, and your existing tests run unchanged against a sandbox on every pull request. It is a different product on the same twins; the agentic SDLC page describes it.
Where the bench comes from
The bench is set up with Veris during an engagement: the twins in scope built and seeded, the first exam drafted and signed off by your subject-matter experts, your agent connected as version one. The CI hook is what your team runs afterwards. After handover your team adds versions, tasks and personas itself, from the console, the API, or a coding agent reading the docs. A first bench takes about two weeks from signing as SaaS, or from the deployment when the platform runs fully on-prem inside your VPC.
