JT / SAGE IDEAS Work with me

04 ReasoningEvaluationCI gatesEvidence gates · 3/4LLM evals

Field note 04 · 2026·08

LLM regression testing with Promptfoo in CI: the minimum viable gate

30 golden traces, one judge, one failing exit code. The smallest setup that stops a bad prompt change from reaching production — runnable this afternoon.

By Jason Teixeira2 min read

Every LLM team I talk to has the same confession: prompt changes ship because they "seemed better" in a couple of manual checks. Nobody can prove the last change didn’t make something else worse, because nothing is measuring. Here is the smallest setup that fixes that — not a platform, not a framework migration. One config file, one CI step, one afternoon.

PR openedprompt changepromptfoo eval30 golden tracesjudge scorevs ratcheted floormerge gatepass or block
fig. 1 — the minimum viable gate: four stops, no exceptions

Step 1: the golden set

Collect 30 real inputs from logs or support tickets — not invented ones; real phrasing is weirder than anything you’ll write. For each, record the output your domain expert agrees is good. Commit them next to the code. This file is now the definition of "working," and changing it requires a reviewed diff — which is the entire point.

Step 2: the judge

A minimal promptfooconfig.yaml that runs every golden input through your prompt and scores the output with an LLM rubric:

yaml
prompts:
  - file://prompts/support-answer.txt
providers:
  - anthropic:claude-sonnet-5
tests: file://golden/*.yaml   # 30 cases: vars + assertions
defaultTest:
  assert:
    - type: llm-rubric
      value: >-
        Faithful to the provided context, answers the actual
        question, no invented policies or prices.
    - type: cost
      threshold: 0.02

Step 3: the gate

Promptfoo exits non-zero when assertions fail, so CI needs exactly one honest step:

yaml
# .github/workflows/eval.yml
- run: npx promptfoo eval --config promptfooconfig.yaml
  # non-zero exit = merge blocked. that's the whole gate.

Wire it to trigger on changes to prompts/**, golden/**, and wherever your model or retrieval config lives. A red eval that can’t block a merge is a report, not a gate.

Your first eval suite doesn’t need to be good. It needs to exist, run in CI, and be allowed to say no.

What to add when you outgrow the minimum

In rough order of payoff: a ratcheting floor (every improvement becomes the new minimum, so quality can’t silently regress); safety runners for injection, PII, and toxicity on the same golden set; retrieval-quality metrics in front of generation for RAG; and per-request cost budgets that fail the run like any other assertion. That fuller battery is what my LLM evaluation engagement builds — but the 30-trace version above is free, takes an afternoon, and catches the regression you currently can’t see. Start there.

Evidence

Receipts for this note

  • Verified

    The template: llm-eval-gate

    Runs keyless on a mock provider with deterministic assertions; the rubric block is commented out until a real provider is wired. The config in this note is the real-provider variant.

    promptfooconfig.yaml

  • Verified

    The ratchet script and committed floor

    floor.json records 7/7 golden cases. The template ships 7 example cases (golden/*.yaml); the 30 in this note is the size to grow your real set to.

    scripts/ratchet.mjs, floor.jsonfloor raised 2026-08-15

  • Verified

    The CI workflow

    Runs the eval and then scripts/ratchet.mjs as a second step.

    .github/workflows/eval.yml

  • Owned

    Pattern shipped in nexural-qa-os

  • Owned

    Full service: LLM evaluation and QA

Series

Evidence gates, part 3 of 4

Checks that can say no, and what they have to count to be believed.

  1. No fake green: what a proof ledger taught me about AI agents
  2. Your LLM feature needs a regression suite more than a better prompt
  3. LLM regression testing with Promptfoo in CI: the minimum viable gate
  4. The day my own quality gate blocked me

Keep going

Next, in the reasoning stage

Topic hubs: LLM evaluation

All field notes · RSS feed

Receipts · the newsletter

Receipts: AI engineering, with the evidence attached.

One real finding with its proof, one runnable lab, and one thing I would do differently. Weekly, Tuesday morning, a five-minute read.

required

Free. One email a week. Confirm first, unsubscribe in one click. How it works

Not ready to talk yet?

Get the AI release-readiness checklist

Eighteen checks to pass before an LLM feature meets a customer. The checklist is free and open: no email wall. Leave one email and I also send the sample evaluation report that goes with it. One email is all I ask for.

required

Inside the checklist: 18 checks, 5 groups

  • Ground truthwithout this, every other check is opinion3 checks
  • Measurement"it seems better" is not a metric4 checks
  • Safety batterythe failure modes that end up in screenshots5 checks
  • The gatea red eval that blocks nothing is decoration3 checks
  • Blast-radius controlautonomy is earned with evidence, never assumed3 checks

Have a system that needs to work?

Tell me the problem. I will tell you honestly whether I am the right engineer for it.

Book a 15-minute call Run a free audit Not sure what you need? Answer 3 questions