Ai4
Complex agent architectures become obsolete with every foundation model upgrade, making durable evaluation harnesses and continuously failing aspirational benchmarks the only lasting engineering asset.
AI-assisted summary of Five Hard-earned Lessons About Evals With Braintrust — original source. Check the original for full context.
Source published:
Detailed notes
## Background Presented by Ankur Goyal, Founder and CEO of Braintrust, and published on YouTube by the Ai4 channel on August 24, 2025, this talk shares five hard-earned lessons learned from powering thousands of daily LLM evaluations. According to the page description, the session covers engineering data pipelines, writing custom scorers that catch real failures, optimizing context windows, and utilizing continuous improvement tools like Loop.
## TL;DR Ankur Goyal outlines the essential evaluation strategies that high-performing AI teams use to ship reliable, production-grade applications. Mature engineering organizations evaluate new foundation models within 24 hours and maintain 'offensive' aspirational test suites alongside defensive regression tests to unlock transformative capabilities as models improve. The talk emphasizes treating custom scorers as the modern, programmatic version of Product Requirement Documents (PRDs) and managing an agent's context 'token diet' rather than relying on generic tools. Ultimately, engineering teams should focus on building durable, reusable evaluation harnesses instead of over-engineering ephemeral agent frameworks that become obsolete with each model release.
## Atmosphere & style The presentation carries the brisk, authoritative energy of a founder delivering pragmatic wisdom directly from the production trenches. Goyal speaks with punchy conviction, stripping away speculative hype around autonomous agents to focus on the unglamorous, high-leverage reality of data engineering and benchmark testing. The delivery feels intensely practical, fast-paced, and empowering for software engineers and product managers looking to build disciplined LLM workflows.
## Key takeaways - [00:04](https://www.youtube.com/watch?v=KL7I5GHDC58&t=4s) Mature AI teams should be capable of evaluating and shipping support for newly released foundation models within 24 hours. - [00:04](https://www.youtube.com/watch?v=KL7I5GHDC58&t=4s) The feedback loop from production complaints and user bug reports into versioned evaluation datasets must be frictionless, ideally achievable in two clicks. - [02:44](https://www.youtube.com/watch?v=KL7I5GHDC58&t=164s) Evals should not only be used defensively for regression testing, but also offensively through broken 'aspirational evals' that track unsolved, high-value product capabilities. - [02:44](https://www.youtube.com/watch?v=KL7I5GHDC58&t=164s) Aspirational evals signal the exact moment a new model release or retrieval technique unlocks a viable, groundbreaking feature as failing tests turn green. - [04:07](https://www.youtube.com/watch?v=KL7I5GHDC58&t=247s) High-quality evaluation datasets cannot be bought off-the-shelf; they must be actively engineered and continuously reconciled against live user and leadership feedback. - [04:07](https://www.youtube.com/watch?v=KL7I5GHDC58&t=247s) Custom scorers serve as the modern equivalent of Product Requirement Documents (PRDs), allowing PMs to define exact acceptance criteria through prompt or code-based logic. - [06:32](https://www.youtube.com/watch?v=KL7I5GHDC58&t=392s) Context engineering requires managing an LLM's 'token diet,' as tool definitions and retrieved data now constitute the vast majority of context window tokens rather than system prompts. - [06:32](https://www.youtube.com/watch?v=KL7I5GHDC58&t=392s) Generic tool schemas degrade agent performance; tool definitions and return payloads must be customized and prompt-engineered specifically for the agent's task. - [08:15](https://www.youtube.com/watch?v=KL7I5GHDC58&t=495s) Engineering teams should avoid over-indexing on brittle, complex agent frameworks, which often get simplified to basic while loops as underlying models improve. - [08:15](https://www.youtube.com/watch?v=KL7I5GHDC58&t=495s) Investing in a durable, evaluatable system harness ensures agent code can be completely discarded and rewritten without losing testing benchmarks and quality guardrails. - [11:29](https://www.youtube.com/watch?v=KL7I5GHDC58&t=689s) Braintrust developed its AI optimizer 'Loop' by maintaining a year-long failing aspirational eval until a breakthrough model turned the test green, enabling a two-week product rollout.
## Detailed walkthrough ### [00:04](https://www.youtube.com/watch?v=KL7I5GHDC58&t=4s) Introduction and the 24-Hour Model Test
Braintrust is a two-year-old company that collaborates with some of the most advanced AI software teams in the world to solve notoriously difficult problems around evaluation, observability, and cross-functional workflows between technical and non-technical team members. Once organizations are properly equipped to run evaluations, the volume of evals they execute skyrockets, enabling them to build and ship high-quality products at an unprecedented pace. Drawing from these production experiences, there are five major themes and hard-earned lessons that define what mature eval practices look like in practice.
A primary indicator that an organization has mastered evals is its responsiveness to model releases: teams should be capable of confidently evaluating and launching support for a brand-new model within approximately 24 hours. Given how frequently cutting-edge models are released, staying on the capability frontier is critical. With robust evals in place, an engineering team does not have to guess; they can immediately run their test suites, observe where the new model excels or fails, identify specific edge cases to investigate, and make an informed deployment decision in a single day. Another crucial sign of eval maturity is closing the feedback loop between production and development. If an end user files a complaint or encounters a bug, a developer or product manager should be able to capture that exact failure into an eval dataset within two clicks so the failure mode is permanently tracked and never forgotten.
- **The 24-Hour Benchmark**: Teams should possess the automated infrastructure required to benchmark and assess any newly released foundation model within 24 hours. - **Two-Click Production Ingestion**: The feedback loop from production complaints directly into versioned eval datasets must be virtually frictionless.
---
[02:44](https://www.youtube.com/watch?v=KL7I5GHDC58&t=164s) Playing Offense vs. Defense: Unit Tests and Aspirational Evals
Most engineering organizations treat evals purely defensively as unit tests. In a defensive setup, when a developer modifies a system prompt, they run an existing eval suite to check for regressions—confirming, for example, that 75 test cases remain green while three turn red. While defensive unit testing is essential and should always be done, the highest-performing AI companies use evals to play offense.
Offensive evals are deliberately designed to be broken. These "aspirational evals" represent difficult, world-changing use cases that current models or architectures cannot yet solve. Engineering teams keep these failing evals in their repositories indefinitely. Whenever a superior model is released, a new vector database strategy is implemented, or a novel prompting technique is conceived, teams rerun these aspirational suites. The moment those broken tests begin turning green, the team knows they have unlocked a viable, game-changing product feature ready to ship.
```mermaid flowchart TD accTitle: Defensive vs Offensive Eval Workflows subgraph Defensive ["Defensive Evals (Unit Tests)"] D1["Prompt or Code Change"] --> D2["Run Regression Eval Suite"] D2 --> D3{"Pass Threshold?"} D3 -- "Yes" --> D4["Safe to Deploy"] D3 -- "No" --> D5["Fix Regressions"] end
subgraph Offensive ["Offensive Evals (Aspirational)"] O1["Unsolved High-Value Use Case"] --> O2["Continuously Failing Eval Suite"] O3["New Model Drop / Retrieval Tweak"] --> O2 O2 --> O4{"Tests Turning Green?"} O4 -- "Yes" --> O5["Ship Groundbreaking Feature"] O4 -- "No" --> O6["Remain in Backlog for Next Frontier"] end ```
- **Defensive Evals**: Act as regression guardrails (e.g., verifying 75 passing tests remain intact after prompt changes). - **Offensive / Aspirational Evals**: Live permanently broken test cases representing transformative product capabilities that get unlocked as models and architectures mature.
---
[04:07](https://www.youtube.com/watch?v=KL7I5GHDC58&t=247s) Evals as an Engineering Discipline: Datasets and Custom Scorers
Evaluations must be treated as the central engineering problem of AI application development, rather than an afterthought relegated behind complex agentic architectures. High-quality evals depend on two engineered pillars: high-fidelity datasets and customized scoring logic. Datasets cannot simply be bought off-the-shelf or commissioned once from a third party; they must be actively engineered and continuously reconciled against live customer feedback and executive observations. When leadership tests a product and notes discrepancies with real-world behavior, the engineering team must be able to directly map those qualitative observations back to their evaluation data.
Similarly, while off-the-shelf scorers and template evaluation prompts serve as helpful starting points, reaching enterprise-grade quality requires teams to write domain-specific scorers. Custom scorers represent the modern evolution of product management. Instead of authoring static Product Requirement Documents (PRDs) and handing them over the fence to engineers, product managers should define scoring logic directly. With AI coding assistants like Cursor, PMs who cannot code can readily write programmatic scoring functions, and every PM can craft structured prompt-based scorers to define the exact acceptance criteria for what the system should build.
- **Engineered Datasets**: Dynamic, living representations of production realities that cannot be outsourced or statically purchased. - **Scorers as the New PRD**: Product managers define product specifications directly through prompt-based or code-based scoring functions.
---
[06:32](https://www.youtube.com/watch?v=KL7I5GHDC58&t=392s) Context Engineering and the Token Diet
Context engineering is rapidly becoming one of the most critical disciplines in AI development. A practical way to conceptualize context engineering is as managing an LLM's "token diet." The handwritten tokens inside system prompts and the input tokens submitted directly by end users now represent a tiny minority of the total context window an LLM processes. The vast majority of tokens consumed during an execution originate from tool definitions, database retrievals, and tool execution outputs.
Because tool outputs dominate the context window, developers must be just as deliberate and disciplined when engineering tool outputs as they are with system prompts. A common fallacy surrounding emerging protocols like MCP (Model Context Protocol) is the assumption that generic, universally defined tools will function seamlessly across every agent. In practice, both tool definitions and the data payloads returned by tools must be prompt-engineered and tailored specifically to the agent's exact operational task.
- **The Token Diet Analogy**: System prompts and user inputs are a small fraction of the context window; retrieved data and tool outputs constitute the bulk of the model's diet. - **MCP & Tool Optimization**: Generic tool schemas degrade agent performance; tool definitions and return payloads must be customized and prompt-engineered per use case.
---
[08:15](https://www.youtube.com/watch?v=KL7I5GHDC58&t=495s) Building Durable Evaluatable Systems Over Ephemeral Agent Code
Engineering cycles should not be squandered building brittle, over-engineered agent frameworks, state graphs, or complex control flows that teams become emotionally attached to. Foundation models evolve so rapidly that code written today may become obsolete tomorrow. For instance, a leading AI code-generation company systematically *decreased* the total lines of code in its core engine with every subsequent model release—transitioning away from rigid third-party frameworks down to a minimalistic `while` loop because their CTO held zero attachment to custom infrastructure.
Instead of over-indexing on ephemeral agent code, durable engineering effort should be invested into building an "evaluatable system." When teams focus on constructing comprehensive evaluation harnesses—comprising the data pipeline, custom scorers, feedback capture, and orchestration—they create a resilient artifact. If an underlying model update obsoletes the agent logic, the evaluation system remains fully intact to test, optimize, and validate whatever replacement architecture is introduced.
```mermaid flowchart LR accTitle: The Full Evaluatable System Architecture subgraph System ["Evaluatable System Harness"] direction TB subgraph Core ["Agent Execution (Ephemeral)"] A["Input / State"] --> B["Simple While Loop"] B <--> C["Tool Calls & Context Diet"] B --> D["Output"] end subgraph EvalEngine ["Durable Evaluation Layer"] E["Engineered Datasets"] -.-> B D -.-> F["Custom Scorers & Feedback"] F -.-> G["Continuous Optimization / Ingestion"] G -.-> E end end ```
- **Ephemeral Agent Logic**: Complex graphs and frameworks frequently get replaced by simple `while` loops as base models improve. - **Durable Eval Harness**: Investing in the surrounding evaluation box ensures architectures can be completely discarded and rewritten without losing quality benchmarks.
---
[11:29](https://www.youtube.com/watch?v=KL7I5GHDC58&t=689s) Case Study: Building Loop and Automated Continuous Improvement
The culmination of these evaluation principles is embodied in Loop, an AI copilot and optimizer built directly into Braintrust. For roughly a year, Braintrust maintained an aspirational, continuously failing eval designed to test whether LLMs could autonomously optimize prompts, analyze dataset failure patterns, and write their own custom scoring functions. For months across iterative model releases—up to and including GPT-4o—the results were consistently poor, and the evals remained red.
The breakthrough occurred with the release of Claude 4, where evaluation benchmark numbers jumped dramatically. Because the team had maintained their aspirational eval suite for a year, they recognized the capability shift instantly, threw away previous prototype code, and shipped Loop within two weeks as a simple `while` loop augmented with tool calls. Loop automates the entire eval-optimization lifecycle. Testing across current models reveals distinct operational profiles:
| Model | Performance Profile in Loop Optimization | |:--- |:--- | | **Claude 4** | Exceptional performance; robust tool calling and prompt/scorer synthesis. | | **GPT-4.1** | Capable and functions adequately, but trails top-tier optimization quality. | | **GPT-5** | Evaluation and benchmarking are actively ongoing; verdict remains open. | | **Gemini** | Highly ambitious and attempts tasks eagerly, but currently struggles with reliable tool-calling execution. |
Braintrust actively operates Loop in production with a collection of working, fully deployed evals, while concurrently running roughly eight broken, aspirational evals for upcoming capabilities that are monitored daily as frontier models continue to evolve.
## Notable quotes > [00:04](https://www.youtube.com/watch?v=KL7I5GHDC58&t=4s) teams should be capable of confidently evaluating and launching support for a brand-new model within approximately 24 hours. — Ankur Goyal
> [00:04](https://www.youtube.com/watch?v=KL7I5GHDC58&t=4s) If an end user files a complaint or encounters a bug, a developer or product manager should be able to capture that exact failure into an eval dataset within two clicks so the failure mode is permanently tracked and never forgotten. — Ankur Goyal
> [02:44](https://www.youtube.com/watch?v=KL7I5GHDC58&t=164s) Most engineering organizations treat evals purely defensively as unit tests. — Ankur Goyal
> [02:44](https://www.youtube.com/watch?v=KL7I5GHDC58&t=164s) The moment those broken tests begin turning green, the team knows they have unlocked a viable, game-changing product feature ready to ship. — Ankur Goyal
> [04:07](https://www.youtube.com/watch?v=KL7I5GHDC58&t=247s) Evaluations must be treated as the central engineering problem of AI application development, rather than an afterthought relegated behind complex agentic architectures. — Ankur Goyal
> [04:07](https://www.youtube.com/watch?v=KL7I5GHDC58&t=247s) Custom scorers represent the modern evolution of product management. Instead of authoring static Product Requirement Documents (PRDs) and handing them over the fence to engineers, product managers should define scoring logic directly. — Ankur Goyal
> [06:32](https://www.youtube.com/watch?v=KL7I5GHDC58&t=392s) A practical way to conceptualize context engineering is as managing an LLM's 'token diet.' — Ankur Goyal
> [06:32](https://www.youtube.com/watch?v=KL7I5GHDC58&t=392s) The vast majority of tokens consumed during an execution originate from tool definitions, database retrievals, and tool execution outputs. — Ankur Goyal
> [06:32](https://www.youtube.com/watch?v=KL7I5GHDC58&t=392s) In practice, both tool definitions and the data payloads returned by tools must be prompt-engineered and tailored specifically to the agent's exact operational task. — Ankur Goyal
> [08:15](https://www.youtube.com/watch?v=KL7I5GHDC58&t=495s) Engineering cycles should not be squandered building brittle, over-engineered agent frameworks, state graphs, or complex control flows that teams become emotionally attached to. — Ankur Goyal
> [08:15](https://www.youtube.com/watch?v=KL7I5GHDC58&t=495s) When teams focus on constructing comprehensive evaluation harnesses—comprising the data pipeline, custom scorers, feedback capture, and orchestration—they create a resilient artifact. — Ankur Goyal
> [11:29](https://www.youtube.com/watch?v=KL7I5GHDC58&t=689s) Because the team had maintained their aspirational eval suite for a year, they recognized the capability shift instantly, threw away previous prototype code, and shipped Loop within two weeks as a simple while loop augmented with tool calls. — Ankur Goyal
## Mentioned Ankur Goyal, Braintrust, Loop, Notion, Cursor, MCP (Model Context Protocol), Claude 4, GPT-4o, GPT-4.1, GPT-5, Gemini
## Video description Ankur Goyal, Founder & CEO, Braintrust
Abstracts
Are you catching critical issues in your LLM applications before they reach users? In this talk, I’ll share five hard‑earned lessons drawn from powering thousands of daily evals on Braintrust. You’ll discover how to engineer data pipelines and custom scorers that surface real failures, why optimizing your full eval loop outperforms prompt tweaks alone, and how Loop, our AI copilot, automates continuous improvement. I'll share real examples like Notion’s 24‑hour model swaps and demonstrate practical steps to tighten your eval workflows. Join me to learn actionable strategies that ensure your LLM features ship reliably and confidently.
[Source](https://www.youtube.com/watch?v=KL7I5GHDC58)