Yeo Wen Da
← Guides
Guide · Evalsreview loop for an internal agent workflow

Evals before features

Five to fifteen named cases beat another tool call. On an internal agent review workflow at work, I ship the evaluation loop first — then grow the prompt.

Published
Length8 min
StackClaude · internal review harness
StatusActive at work
The rulecheck before capability

Pass/fail before the prompt grows

I added a clarifying step to an internal agent review workflow at work. The demo looked sharper. Two weeks later nobody could say whether intake-ambiguous still asked one question or had started inventing fields again. We were arguing from vibes.

That is the expensive pattern: when the agent feels thin, people reach for a tool, a step, or a longer prompt. Failures get harder to pin. Every feature without a named check becomes something you can only debate.

Write the evaluation loop first. Lock what pass and fail look like on a small case set. Grow the prompt, the tools, and the autonomy only after that. A bigger agent with no check is still a vibe — louder, and harder to kill.

(01)

Write the cases

Pull 5–15 real inputs the workflow already sees, including the ones that bite you. Skip anything without an expected outcome — that is a story, not a case.

(02)

Name pass and fail

For each case, write what must be true to pass and what counts as fail. Prefer wording a second person can score without pinging you for intent.

(03)

Freeze the harness

Run the same cases the same way every time the prompt or a feature moves. If the harness drifts with the feature, you relocated the vibe. You did not evaluate.

The loopcases, score, change, re-run

What the shape actually is

Four moves, always in this order. A feature may enter only after a failing case has a written expectation. Most teams skip freezing the score before they touch the agent. That skip is the whole bug.

01 · fixed inputs02 · human standard0304 · expectationpassfailCase setExpected pass/failAgent runScore against itKeepChange prompt or toolRe-run same cases →
Fig. 1 · Vermilion marks the expected-outcome step — that is the gate features may not skip. A dashed return from change back to agent run; the case set stays fixed unless you deliberately add a new case with its own expectation.
Copy this prompt
eval-first-loop.txt
Turn the agent workflow in this conversation into an eval-first loop.

Before proposing any new feature, tool, or prompt expansion:
1. Draft 5–15 representative cases from the real inputs described.
2. For each case, write a pass condition and a fail condition a
   second reviewer could apply without asking me.
3. Describe a minimal harness: how each case is run, what evidence
   is recorded, and how pass/fail is decided.
4. Only after that, list at most three feature changes — each tied
   to a case it would improve, and each with the re-run plan.

Return: case table → harness sketch → feature proposals gated by
failing cases. If you cannot name pass/fail for a case, drop the
case or ask one clarifying question — do not invent metrics.

The quality gate. A good result returns scored cases and a harness you can run twice. Feature lists first, or metrics nobody defined, mean the prompt failed — fix the cases, not the feature count in the instructions.

What it coststable 1

Each case costs authoring time up front and attention on every re-run. That is why a tiny frozen set beats a fat set you never re-score. Skip the re-run after a change and you wrote documentation. You did not build a loop.

KindCostCatchesFails when
frozen case setMedium to write, cheap to re-runRegressions you already namedThe failure mode is new
ad-hoc spot checkLow once, high foreverWhatever you happened to openYou are tired or biased
feature with no evalZero nowNothingThe first silent wrong answer
evals:
  harness: fixed case set, same runner, same scorer
  cases:
    - id: intake-ambiguous
      expect: asks one clarifying question; does not invent facts
      on_fail: tighten the refusal / clarify rule before adding tools
    - id: known-good-path
      expect: produces the required artefact fields without extras
      on_fail: treat as regression; do not ship the latest prompt change
  rule: no new feature lands unless it maps to a failing case
Where it breaks

An eval that moves with the feature proves nothing

Rewrite the expected outcome so the new prompt “passes,” and you negotiated. You did not evaluate. Keep the case set and the pass/fail text stable across changes. When reality shifts, add a new case with a new expectation. Do not edit history to flatter the model.

Happy-path-only sets also break the loop. At work, the review loop earned trust only after the set included ambiguous, partial, and adversarial inputs the agent already mishandled — intake-ambiguous style cases, not just known-good-path. A green board of easy cases is still a vibe.

Source boundary
  1. Method is first-party evals practice from building and revising an internal agent workflow — not a vendor playbook or a product guarantee.
  2. The prompt and harness sketch are my own implementation shape; adapt the case count and scorer to your domain.
Next in series

Give an AI agent a checkpoint it cannot skip