# How Evals and Prompts Shape Agent Behavior — Preetika Bhateja & Daniel Bump, YouTube Ads

## Executive summary

Building reliable AI agents requires a comprehensive evaluation loop that extends far beyond prompt engineering. The process involves optimizing foundational tools, establishing rigorous evaluation workflows (Evals), and iteratively refining behavior using feedback signals rather than simple scorecards. Key strategies include starting with small-scale, intuition-based evaluations to identify failure patterns early, analyzing agent trace logs for reasoning failures, and focusing on systemic patterns of error rather than isolated instances.

## Key takeaways

- Agent Reliability Loop: Agent behavior is a function of its capabilities, guardrails, and the evaluation process. The system relies on an iterative loop: Prompts $\rightarrow$ Evals $\rightarrow$ Iteration $\rightarrow$ Feedback.
- Foundational Optimization: Before large-scale agent evals, optimize the core set of LLM-friendly tools. Consider implementing an independent critique agent with a remediation loop to fill gaps in base tool limitations.
- Starting Small (Vibing): Instead of immediately building comprehensive, scalable evals, start with an intuition-based approach ('vibing'). This allows for quick iteration and radical architectural changes without being hindered by strict scalability requirements.
- Deep Failure Analysis: To understand failures, analyze agent trace logs to see the reasoning behind a conclusion (e.g., why an agent removed a disclaimer despite explicit instructions). This is more valuable than simple pass/fail metrics.
- Scaling Evals and Consensus: When involving human raters (scale raiders), provide clear rubrics, detailed examples, and train the team on expected outcomes. For complex systems, collect explanations from raters rather than just a binary pass/fail rating.
- Focusing on Patterns: When diagnosing model performance degradation (regressions), focus on identifying systemic patterns of failure across the entire golden set, rather than hyper-fixingating on single, isolated examples.

## Technical details

- Agent Architecture: A strong agent foundation requires a focused and optimized set of LLM-friendly tools. The reliability is managed by the interplay between capabilities, guardrails, and evals.
- Evaluation Strategy: Evals must be strict and measurable to handle the non-deterministic nature of generative AI outputs. The goal is defining 'what good looks like' by setting a target output.
- Golden Set Management: The golden set must be expansive, cover a broad range of use cases, and maintain high human agreement. It should also evolve by incorporating online evals refreshed with production data.
- Evaluation Metrics: When performing launch readiness checks, identify acceptable trade-offs versus critical failures (regressions). The evaluation process should also consider multi-output criteria (e.g., accuracy AND brand safety) rather than just binary pass/fail.

## Practical implications

- Implement detailed agent tracing and logging to understand the internal reasoning path when failures occur.
- Establish clear 'gatekeeping rules' or launch criteria (e.g., minimum precision/recall) before production rollout.
- Treat evaluation design as an evolving process, ensuring test sets are regularly refreshed with real-world production data.
- When building cross-functional teams for evaluation, invest in training and standardized rubrics to ensure consistent rating consensus.

## Topics

Generative AI, Agent Development, LLM Evaluation (Evals), Build Engineering, CI/CD Testing, YouTube Ads

Source: https://www.youtube.com/watch?v=xyL2Ltkh-SA
