# How to Know If Your AI Agent Is Any Good: Evals With Phoenix & Claude — Laurie Voss, Arize AI

## Executive summary

This workshop details a comprehensive, multi-stage process for evaluating the reliability and correctness of AI agents, moving beyond simple functional testing. The core methodology involves establishing a full 'evals loop': tracing agent execution with tools like Arize Phoenix, defining specific evaluation criteria (Code, LLM-as-a-Judge, Human), running experiments to prove fixes, and finally, integrating these evaluations into Continuous Integration (CI) using tools like `npm test`. The goal is to prevent agents from being 'confidently wrong' and to provide measurable, repeatable metrics for model upgrades and feature releases.

## Key takeaways

- The Eval Loop: Tracing, Evaluating, and Experimenting: Reliable AI development requires a closed loop: 1) **Tracing** (logging every agent step/span) $\rightarrow$ 2) **Reading** (manual inspection for 'unknown unknowns') $\rightarrow$ 3) **Evals** (running structured tests) $\rightarrow$ 4) **Experimenting** (proving a fix worked) $\rightarrow$ 5) **CI** (gating the release).
- The Three Types of Evals: Evals are categorized by their method: **Code Evals** (fast, deterministic checks like JSON parsing); **LLM-as-a-Judge Evals** (using a second LLM to grade output against a rubric, useful for checking accuracy or faithfulness); and **Human Evals** (the gold standard, slow, but necessary for novel failure modes).
- Addressing Agentic Failure: Agents can fail in complex, non-deterministic ways (e.g., combining data from two unrelated web searches to calculate 116% analyst consensus). The solution is to define specific, measurable criteria (e.g., 'must recommend buy/sell/hold') and use structured evals to catch these subtle errors.
- Model Upgrades and CI Integration: Evals are crucial for safely upgrading models (e.g., from Claude Haiku 4.5 to 5.5). By running experiments and ensuring the new model passes the existing test suite, teams can prove the change is beneficial and gate the release in CI.

## Technical details

- Agent Tracing and Observability: Arize Phoenix is used as the open-source AI observability platform to collect detailed traces. Traces record every agent step, tool call, and LLM interaction (spans), providing visibility into the agent's internal decision-making process, even when the failure is subtle (e.g., a tool call failing due to permissions).
- Code Evals: These are deterministic, fast, and cost-free checks (e.g., asserting if the output parses as JSON or if a required ticker symbol is present). They are ideal for checking format and structure, but cannot assess meaning.
- LLM-as-a-Judge Evals: This method uses a separate, more capable LLM (the 'judge') to grade the agent's output against a defined 'rubric.' The judge provides not only a score but also an explanation, which is critical for identifying the root cause of failure (e.g., 'conflates two different data points').
- Custom Rubric Design: Effective rubrics must be highly specific. They should include a defined role/context for the judge, explicit criteria (e.g., 'must name concrete risks'), and use XML tags to clearly delineate data, instructions, and examples, which helps prevent prompt injection and confusion.
- Experimentation and Regression Testing: To prove a fix, run an experiment using a controlled comparison: the same inputs and the same evals before and after the prompt change. The goal is to ensure that fixing one issue (e.g., actionability) does not break a previously working function (regression).

## Practical implications

- Implement a formal, measurable evaluation suite (evals) for all AI agents before deployment, treating it as a critical quality gate.
- Prioritize reading and analyzing failure traces manually to identify 'unknown unknowns' before automating the evaluation process.
- When designing evals, focus on the *outcome* (e.g., 'Is the report actionable?') rather than the *path* (e.g., 'Did it call Tool A then Tool B?').
- Treat eval prompts as code: version them, test them, and ensure clear boundaries (e.g., using XML tags) to prevent ambiguity and prompt injection.

## Topics

AI Agents, LLM Evaluation (Evals), AI Observability, Continuous Integration (CI), Prompt Engineering, Machine Learning Metrics (Precision, Recall), Arize Phoenix, Claude (Haiku 4.5 to 5.5), npm test

Source: https://www.youtube.com/watch?v=SHMCGrNJJGc
