How to Build an AI Evaluation Framework from Scratch
12.01.2026
Key Takeaways
-
Start evaluating at the prototype stage: Add tracing from day one and log every scenario you test by hand, so evaluation grows with the agent instead of appearing before launch.
-
Build a small but varied golden dataset: 30 to 50 cases is enough to start, as long as it covers typical requests, edge cases and negative scenarios.
-
Automate deterministic checks first: Verify tool calls, output format and limits with code, then add an LLM-as-a-judge calibrated against human scores.
-
Test every change in CI/CD: Run the eval suite whenever a prompt, model or tool changes, and block releases that fall below agreed thresholds.
-
Close the loop in production: Score live traffic with the same metrics and feed problem cases back into the golden dataset.
Most teams treat AI evaluation as a gate at the end of the project. The agent gets built, someone runs a few dozen prompts by hand a week before launch, and the results are judged by feel. That's how quality problems reach production unnoticed.
A working AI evaluation framework isn't something you bolt on before release. It grows with the agent: light and manual while you're prototyping, automated once the behavior settles, and continuous after launch. Each stage builds on the data the previous one collected, so you never have to start from a blank page.
This guide walks through how to build AI evals from scratch in five stages, starting from the point where all you have is a prototype:
-
Prototype: add tracing and start saving the scenarios you test by hand.
-
Golden dataset: turn those scenarios into 30 to 50 reference cases.
-
Metrics: automate with deterministic checks first, then LLM-as-a-judge.
-
CI/CD: run evals on every change to a prompt, model or tool.
-
Production monitoring: score live traffic and feed failures back into the dataset.

Each stage feeds the next, and problem cases found in production return to the golden dataset to start the cycle again.
Stage 1: Start with tracing while it's still a prototype
At the prototype stage, you probably can't define clear metrics yet. You're still figuring out what "good" looks like for this agent. That's fine. What you can do from day one is make every run visible.
Set up tracing. Connect an observability tool such as Langfuse (or an alternative like LangSmith or Arize Phoenix) so every run records the input, the model's reasoning steps, each tool call and the final output. When something goes wrong, you'll see exactly where, instead of guessing from the final answer.
Save the scenarios you test by hand. Every time you or a teammate tries the agent manually, write the scenario down in a shared file: the input, what you expected and what actually happened. It feels like overhead, but this file is the raw material for your first evaluation dataset. Teams that skip it end up reconstructing test cases from memory months later.
By the end of this stage you should have:
-
Traces for every agent run
-
A growing list of real scenarios, including the ones that failed
Stage 2: Build your golden dataset
Once the agent's behavior is reasonably stable, turn the scenarios you've collected into your first golden dataset: a fixed set of reference cases you run the agent against every time something changes.
Start small. 30 to 50 examples is enough for a first version. What matters more than size is coverage:
-
Typical requests: the everyday tasks the agent was built for.
-
Edge cases: ambiguous inputs, missing data, unusual formats, long or multi-step requests.
-
Negative scenarios: requests the agent should refuse, escalate or answer with "I don't know", such as out-of-scope questions or attempts to bypass its instructions.
For each case, write down an approximate expected result. It doesn't have to be a word-for-word answer. "Calls the policy lookup tool, returns the deductible amount, doesn't give legal advice" is a perfectly useful expectation.
Treat the dataset as a living asset. Version it alongside your code, and involve the people who know the domain: a claims adjuster or compliance officer will spot a wrong "expected answer" that an engineer would miss.
Stage 3: Measure with metrics, deterministic first
When the golden dataset grows to around a hundred cases, running it by hand starts eating days. That's the signal to automate.
Start with deterministic metrics. These are checks with a clear pass or fail that code can verify without interpretation:
- Tool selection: Did the agent call the right tool for this request?
- Output format: Is the response valid JSON, or does it follow the required template?
- Limits: Did the agent stay within its token, step, cost or latency budget?
- Required content: Does the answer include the fields or disclaimers it must include? Deterministic checks are cheap, fast and fully reproducible. They catch a large share of regressions and give you a baseline you can trust.
Then add LLM-as-a-judge. Some qualities can't be checked with code: whether an answer is accurate, complete, grounded in the retrieved documents or written in the right tone. For these, use a second model as a judge, scoring each output against a written rubric.
A few rules keep LLM-as-a-judge honest:
- Give the judge a specific rubric, not "rate this from 1 to 10".
- Calibrate it: have people score a sample of the same cases and check that the judge agrees with them.
- Re-check the calibration whenever you change the judge model or the rubric.
Stage 4: Run evals in your CI/CD pipeline
Once your evals run automatically, add them to the deployment pipeline. Trigger the eval suite every time someone changes:
-
A prompt, even a one-word edit
-
The model, including a version upgrade from your provider
-
A tool, its description, parameters or the API behind it
This is eval-driven development: no change ships until it has been scored against the golden dataset. Set thresholds for each metric, for example "tool selection must stay above the current baseline", and block the release if a change pushes any score below them.
The payoff is speed. Teams that test every change can try a cheaper model or a rewritten prompt in an afternoon, because they know within minutes whether quality held.
Stage 5: Monitor in production and close the loop
Passing your evals before release doesn't mean the agent stays good. Model providers update their models, and real users bring scenarios nobody thought to test.
After launch, sample a share of live traffic and score it with the same metrics you used before production. Using the same metrics matters: it lets you compare pre-release and live quality directly, and spot degradation as soon as it starts instead of when complaints arrive.
Then close the loop. Every problem case you find in production goes back into the golden dataset, and the cycle starts again. Over time, your dataset stops reflecting what you imagined users would do and starts reflecting what they actually do. That's what makes the framework stronger with every release.
Why evals matter even more in regulated industries
In insurance, financial services and other regulated industries, "the agent seemed fine in testing" isn't an acceptable answer for auditors or risk teams. A staged AI evaluation framework gives you what they ask for:
-
An audit trail: traces show what the agent did and why, for every run.
-
Documented test coverage: the golden dataset shows which scenarios, including refusals and edge cases, were tested before release.
-
Evidence of control: CI/CD thresholds prove no change reached production without passing agreed quality bars.
-
Ongoing oversight: production monitoring shows quality is tracked continuously, not checked once.
These are the same building blocks you need for a broader AI governance framework, so the work pays off twice.
FAQ
How do you evaluate AI models when you don't have metrics yet?
Start with tracing and a written log of manual tests. The patterns you see in those runs tell you which metrics to define later.
How big should a golden dataset be?
30 to 50 well-chosen cases is enough to start, as long as they include edge cases and negative scenarios. Grow it as production reveals new failures.
When should I use LLM-as-a-judge instead of deterministic checks?
Use deterministic checks for anything code can verify, like tool calls, formats and limits. Use LLM-as-a-judge for qualities that need interpretation, such as accuracy, completeness and tone, and calibrate it against human scores.
How do you evaluate AI agents differently from a single LLM call?
Agents take several steps, so evaluate the path as well as the final answer: which tools were called, in what order, and whether the agent stayed within its step and cost limits.
What's the difference between AI evals and traditional software testing?
Traditional tests expect the same output every time. AI outputs vary, so evals score results against expectations and thresholds rather than exact matches.
Build evals into your AI roadmap from day one
The most expensive time to start evaluating an AI agent is the week before launch. Start with tracing on your prototype, and each stage of the framework will have the data it needs when you get there.
Not sure where your team stands? DOOR3 helps enterprise teams in regulated industries design, build and evaluate AI agents they can put in front of customers and auditors. Talk to our team