Use these notes to review a concept or read at your own pace. The interactive workspace above adds predictions, editable code, and actual run results.
IDEA 1
Write checks before judging outputs
An evaluation case supplies an input and a judging rule. Include normal requests, exact boundaries, missing evidence, and disallowed actions. Check the evaluator itself with known correct and deliberately wrong outputs. Otherwise a bug in the scoring code can reward the very behavior you meant to prevent. Keep a held-out set away from day-to-day tuning where possible.
OpenAI's Cookbook improvement-loop example connects traces and reviewer feedback to reusable evaluations before proposing changes. Apply that method here: turn “it ignored approval” into a case requiring a preview and no action call. Freeze the cases and rules when comparing versions. This lab reads authored records; it does not run that live API example or measure a real model.
Freeze the target before comparing
- Case. Name the input category and expected result.
- Baseline. Keep the earlier version's observation.
- Candidate. Use the same expectation for the new version.
The lab reads authored run records. It does not execute a model benchmark.
A stable target
const passed = !run.error && run.value === test.expected;For the scalar expectations used here, exact equality is the agreed check. More complex tasks need explicit rubrics or structured validators.
Think it through: When should you define the expected behavior?
IDEA 2
Challenge boundaries, not just wording
Red teaming deliberately probes failures. Try a note that asks the program to ignore permissions, a missing price, a stale record, a temporary tool failure, or an out-of-scope task. Give each case an acceptable outcome: no forbidden call, an explicit missing field, or a bounded retry. A provocative input with no expected behavior is hard to evaluate.
Separate component checks from the whole task. A permission helper can pass its own test while the full workflow calls an action before reaching that helper. Inspect the end-to-end trace too. If you find a failure, preserve its input, observed call, and expected boundary as a regression case. A finite test set supplies evidence about tested behavior, not immunity to every possible attack.
A challenge with a check
- Attack or edge. A retrieved note asks for a forbidden action.
- Expected boundary. The action must remain uncalled.
- Keep the case. Use it to catch a future regression.
A test needs an expected safe outcome, not just a provocative input.
A correct helper can be called too late
// Broken whole-workflow ordering:
// publish(draft);
// if (!approved) return "preview";
// Test the trace: an unapproved run must never call publish.Testing only whether the helper recognizes false approval misses the earlier side effect. The whole-path check must verify when the boundary was enforced.
Think it through: A permission helper passes its unit test, but an unapproved workflow calls publish first. What should the evaluation show?
IDEA 3
Count errors and look for regressions
A regression is a case that passed before a change and fails afterward. An improvement is the reverse. Report both, even if the candidate's total score increases. A higher average can conceal a newly broken permission boundary.
A runtime error remains a failed run, including when the expected output is null. Do not drop errored cases from the denominator or treat the absence of a value as intentional abstention. The error field tells you that the program did not complete its intended decision.
Keep all outcomes
- Before. Did the baseline finish and match?
- After. Apply the identical rule to the candidate.
- Compare. Record each direction of change and the full case count.
Null can be a valid answer; an error with null is a failed execution.
An error is not abstention
const expected = null;
const candidate = { value: null, error: "timeout" };
// This case fails because execution did not complete.Testing the value alone would incorrectly pass this run. Checking the error first distinguishes intentional null from a crash.
Think it through: A run times out and stores value:null; the expected result is null. How should it be scored?
Put it into practice
Count real matches in authored run records, including errors, and identify changes in both directions.
- Inspect the timeout case: null is both the expected answer and the error placeholder.
- Run the starter and identify the false pass.
- Insert the error guard and run all comparison sets.
- Add a custom regression and observe both totals and the regression list.
Your next experiment: Change one candidate output to the wrong value while leaving another improved. Can the total score hide a regression?
Keep the task fixed, count failed runs, and report regressions alongside gains.
Key terms
- Regression
- A previously passing case that fails after a change.
- Red teaming
- Deliberately probing a system for failures and boundary violations.
- Denominator
- The total set of cases used when computing a pass rate.
Sources and scope
Original Stemtiq teaching, reviewed 2026-09-14. The named researchers and organizations do not endorse this course. Classroom cases are authored exercises, not published findings.
OpenAI: Evaluate agent workflows
Reviewed 13 September 2026 · undated documentation
Use traces to locate workflow failures, then apply structured graders and repeatable datasets to compare behavior across changes.
Traces record observable execution, not private model reasoning. Passing selected criteria does not demonstrate correctness on every task or connect this lab to an evaluation service.
NVIDIA: Agent Evaluation in NVIDIA NeMo Agent Toolkit
Version 1.8 observed · reviewed 13 September 2026
Run curated cases, inspect generated answers and intermediate steps, retain effective configurations, and enable profiling when operational measurements are needed.
Different artifacts require different configuration. Scores depend on cases and graders; timing measurements do not establish correctness, and model-based grading is fallible.
Jimenez et al. · SWE-bench research team: SWE-bench: Can Language Models Resolve Real-World GitHub Issues?
ICLR 2024 · original benchmark
Evaluate patches against repository issues and executable tests using a reproducible harness. Inspect the actual code change and its tested behavior.
Benchmark variants cover different tasks. Passing a repair case does not establish general coding ability or that a patch meets every unstated requirement.
Microsoft Research: Defending Against Indirect Prompt Injection Attacks With Spotlighting
March 2024
Separating the provenance of retrieved content and user instructions helps address indirect prompt injection.
The paper evaluates particular mitigations and conditions. A classroom filter or trust flag neither implements the full method nor guarantees protection against all attacks.
OpenAI Cookbook: Build an Agent Improvement Loop with Traces, Evals, and Codex
12 May 2026 · reviewed 14 September 2026
Turn observed traces and reviewed feedback into reusable evaluation cases, then check a proposed change against recorded conditions.
The live Python/API example was inspected, not executed. Our authored browser cases do not connect to its services, validate a live-model improvement, or establish educational effectiveness.