Prompt Evaluation Techniques
Last updated 2026-07-31What's new
- New Bank (a digital bank in Latin America) uses AI agents (computer programs that can do tasks usually done by humans) alongside human experts to improve customer support, handling routine tasks quickly and letting humans focus on complex issues.
- They found that using simulated data (fake data made to mimic real situations) instead of waiting for real-world data can speed up the process of improving and testing these AI agents by up to 20 times.
- Getting data for these AI agents is difficult and expensive, as each piece of data is complex and time-consuming to create, and testing in the real world can be risky and slow.
- By using simulations, New Bank can test and improve their AI agents much faster, sometimes in just a few hours, instead of waiting weeks or longer for results from real-world tests.
- To improve AI systems, it's crucial to measure quality, speed, cost, and safety repeatedly, using real-world tasks and failures to create test sets (called eval sets).
- AI systems should be tested using different types of graders (like code checks, AI judges, or human graders) based on the risk level and the type of answer expected.
- AI judges (like a teaching assistant grading essays) should be calibrated against human grades to prevent scoring drift, and should use a rubric (a set of guidelines) to make decisions.
- To ensure AI systems keep improving, create a regression suite (a set of tests that run after every change) to catch and fix any issues early.
- AI tools are getting better at coding tasks, but they still make mistakes, especially with security and complexity, which can lead to problems later on.
- AI can make coding much faster at first, but after a few months, the extra speed goes away because of the extra work needed to fix mistakes and manage the more complicated code.
- AI tools can generate code that seems correct but isn't, which can cause big problems for businesses that rely on it, like law firms and accounting companies.
- AI is improving quickly, but it's not perfect yet, and it's important to find ways to make sure the code it generates is accurate and safe to use.
- AI tools like GitHub Copilot and Open Claw (software that writes code for you) are getting better at tasks like coding, thanks to their built-in knowledge (intrinsic knowledge) and reasoning abilities.
- Microsoft's Foundry (a platform for building and managing AI tools) offers thousands of models (pre-trained AI tools) to help you build AI-powered agents (AI tools that can perform tasks for you).
- Microsoft IQ (a set of tools for connecting AI tools to your organization's data) helps AI tools access and use your organization's data, like documents, emails, and analytics (data analysis tools like Power BI).
- AI tools are evolving to use more sophisticated systems (context engineering) to retrieve and use data, moving from simple data sets to company-wide data and from basic search to complex retrieval systems.
- Loop engineering (using AI to automate and improve business processes continuously) can help with tasks like SEO, customer acquisition, and product improvement, making your business more efficient.
- You can use tools like Cloud Code or Codeex (online platforms for running code) to implement these loops, which can run for months or even years, constantly improving your business.
- Loops aren't new; they're similar to the "build-measure-learn" cycle from the Lean Startup method, but now AI can help automate and enhance these processes.
- For example, you can use a loop to improve your SEO by tracking your rankings, identifying areas to improve, and implementing changes, then tracking the results again.
- Claude Code (a tool for building AI-powered automations) lets you work with local files and online services like Gmail, Slack, or a CRM (customer relationship management system), making it more powerful than Claude Chat (a simple AI chatbot).
- Claude Code uses the same AI models (like Opus, Sonnet, or Haiku) as Claude Chat, but adds extra features for working with files and online services.
- Claude Code is like an AI harness (a tool that helps you use AI models), which sits between the AI model (the engine) and you (the driver), helping you build automations and agents (AI systems that can do tasks for you).
- The instructor, Nate, uses Claude Code to build and manage multiple businesses, showing how one person can do the work of a team with AI.
- Andrew Dumont from Watershed (a sustainability platform) discusses using AI to measure emissions for products like wine or jeans, noting that expert opinions can vary greatly even with the same data.
- They initially used a React agent (a type of AI tool) to edit complex supply chain graphs, but it struggled with consistency and context as the number of graphs grew.
- Upgrading to a coding agent (an AI that can write and execute code) improved efficiency and flexibility, allowing it to explore and edit graphs more effectively.
- However, unconstrained coding agents can be risky, as they may access unintended resources or make changes without proper tracking, leading to potential issues like misleading users.
- **Agentic AI engineer** (AI tools that help create and improve other AI tools, called agents) speeds up the process of building and refining AI agents, reducing the time spent on manual tasks like testing and debugging.
- The process involves creating a detailed plan (spec) for the agent, building it, testing it, deploying it, monitoring its performance, diagnosing issues, and making improvements in a continuous loop.
- For new agents, the process starts from scratch with a detailed plan, while for existing agents, the focus is on optimization and improvement.
- This approach increases the number of agents that can be developed and deployed in a given time, making it a scalable solution for organizations looking to implement AI agents.
- You'll learn to improve prompts (the text you give to an AI to get a response) using a measurable process with the Claude API (a tool that lets you interact with the Claude AI model).
- The updated notebook (a file with code and instructions) includes a flexible evaluation pipeline (a series of steps to test and improve your prompts) and a prompt evaluator (a helper tool that automates testing).
- Start with a simple, weak prompt to set a baseline (a starting point for measuring improvement), then make one change at a time and test again to see if the score improves.
- Use the detailed HTML report (a webpage that shows your prompt, the AI's response, and a score) to identify exactly where the prompt failed and make targeted improvements.
- A new "code grader" checks if AI responses (from Anthropic Claude API, a tool for building AI applications) are in the correct format (Python, JSON, or regex) and have valid syntax, while the "model grader" (AI judgment tool) evaluates task relevance and accuracy.
- The code grader uses simple validators to check format and syntax, while the model grader assesses task following and correctness, providing a more comprehensive evaluation.
- Test cases now include a "format" field to specify the expected output format, helping the code grader verify the AI's response.
- The final score combines both graders' results, giving equal weight to technical correctness and flexible quality, with the goal of improving AI responses over time.
- Arize AI (a company that helps businesses use AI effectively) introduces tools for observability (tracking what your AI is doing) and evaluation (measuring how well it's performing), focusing on agents (AI programs that can perform tasks) and harnesses (systems that manage these agents).
- They use open telemetry (a standard for tracking software performance) to create traces (records of what the AI does) and spans (detailed breakdowns of those actions), helping businesses understand and improve their AI systems.
- Arize AX (a product by Arize AI) provides distributional views (overall patterns) of AI agent paths (the different ways an AI can complete a task), helping identify issues like latency (delays) and incorrect task sequences.
- They also discuss trajectory evals (assessing different paths an AI takes), which can reveal problems like dependencies (when one task must happen before another) that the AI might miss.
Key points
What it is
- **Prompt evaluation** is testing how well an AI prompt (a set of instructions for an AI) works by running it through a set of test cases and scoring the results.
- It's different from **prompt engineering** (writing and editing prompts), as it focuses on measuring if the prompt works reliably.
- It uses an **AI judge system** (an automated grader) to score outputs on criteria like functionality or creativity, giving an objective score.
How to use it
- Start by creating a small dataset of example inputs your prompt should handle.
- Run your prompt against this dataset, collect the outputs, and score them using predefined criteria.
- Analyze failures, focusing only on cases where the prompt didn't work, and iterate to improve it.
- Use structured data (like JSON) for easier comparisons and clearer results.
Watch out for
- Don't assume an evaluation is reliable without validating it first; test it on examples with known answers.
- Check that changes to a prompt don't break other tests in your suite.
- Focus on failures first, then expand your evaluation.
- Treat evaluation as a crucial step in deciding if a prompt is ready for real-world use.
Tools named
- Claude API (Anthropic's model service for running prompts), JSON (a data format for structured outputs).
Lesson 1: What is Prompt Evaluation Techniques and why it matters
Prompt evaluation techniques are automated methods for testing how well an AI prompt performs. They work by running a prompt through a fixed set of test cases and producing an objective metric (a measurable score). This differs from prompt engineering, which is about writing and editing the prompt itself. Evaluation asks a separate question: does the prompt actually work reliably?
The process works in a loop. First, you create a data set of representative tasks. Then you run your prompt against that data set, producing outputs. An AI judge system (an automated grader) scores those outputs on criteria like functionality, code quality, or creativity. This gives you an objective score instead of relying on a handful of manual impressions. You can then compare different prompt versions head-to-head using that same metric.
This matters because raw prompting is manual and unreliable. Every run gives different results, and when something breaks, a human has to step in. Without evaluation, you cannot tell whether a bad output means the prompt is bad, your rubric is bad, or your human annotator was unreliable. Building evals iteratively lets you trust your AI components in an application rather than treating each run as a fresh experiment. The API call matters, but measured behavior matters more.
Sources
- 2026-05-14 — Ship Real Agents Hands-On Evals for Agentic Applications Laurie Voss, Arize
- 2026-06-03 — GPT-5.6 Leaked, Mythos Benchmark Leaks, Hermes Desktop App, Qwen 3.7 Plus, & More! AI NEWS
- 2025-12-26 — AI Skill That Pays in 2026 Systems
- 2026-06-01 — I Run 4 AIs at Once in Claude Cowork (Here's My Exact Setup)
- 2026-05-07 — Agent Optimization with Pydantic AI GEPA, Evals, Feedback Loops Samuel Colvin, Pydantic
- 2026-05-20 — Google OMNI Does What Every AI Creator Has Been Waiting For...
- 2026-01-07 — I Built a New AI System in 3 Hours (and got paid $1650)
- 2026-05-09 — Agentic AI Systems, Clearly Explained
- 2026-06-05 — Claude Certified Architect Prerequisite Claude API Part 5 Prompt Eval to Running the Eval
- 2025-12-10 — How I'd Learn n8n if I had to Start Over in 2026
- 2026-06-01 — Claude Certified Architect Prerequisite Building with the Claude API Part 4 Structured Data
- 2026-05-30 — AI Finished the Draft. Now Youre the Bottleneck.
- 2026-06-06 — Gemma 4 12B Is INCREDIBLE! BEST Local AI Coding Model! IS POWERFUL! (Fully Tested)
Lesson 2: How to use Prompt Evaluation Techniques: step-by-step
To evaluate a prompt systematically, start by drafting a single prompt for your use case. Then build a small dataset of example inputs the final prompt must handle. For each input, call the Claude API (Anthropic's model service), collect the output, and score it against predefined criteria.
A strong evaluation (eval) rubric has five parts. First, define the judge's role — tell the evaluator what kind of output it is assessing and what that output should accomplish. Second, write grading criteria: for example, "the result looks like pirate speak" and "the meaning is preserved between input and output." Third, generate test cases that represent real user tasks. Fourth, run the eval by feeding each test case into your prompt and the judge. Fifth, analyze failures — focus only on failing cases and iterate.
Use structured data (outputs formatted as JSON, for instance) to make comparisons easier. Prefill the assistant side with a JSON fence and stop when the closing fence appears, then parse with json.loads. Clean, parseable outputs produce better eval inputs and clearer results.
The full loop is: instrument (capture data), trace, evaluate, annotate, analyze, then change your prompt and start over. Build evals iteratively. Start with built-in evals for an immediate signal, then move to custom LLM-as-a-judge evals. If a result fails, check whether the prompt is bad, the rubric is poor, or the human annotation is unreliable. Treat evaluation as how you decide whether a prompt is ready for an application that sees many user inputs — it is not a side quest but the bridge between prototype and production.
Sources
- 2026-05-07 — Agent Optimization with Pydantic AI GEPA, Evals, Feedback Loops Samuel Colvin, Pydantic
- 2026-06-05 — Claude Certified Architect Prerequisite Claude API Part 5 Prompt Eval to Running the Eval
- 2026-06-01 — Claude Certified Architect Prerequisite Building with the Claude API Part 4 Structured Data
- 2026-05-14 — Ship Real Agents Hands-On Evals for Agentic Applications Laurie Voss, Arize
- 2026-02-09 — Don't Use Claude Code Like ChatGPT—Use It Like This Instead
- 2026-05-03 — Context Is the New Code Patrick Debois, Tessl
- 2026-05-14 — Mind the Gap (In your Agent Observability) Amy Boyd & Nitya Narasimhan, Microsoft
- 2026-05-17 — Fighting AI with AI Lawrence Jones, Incident
Lesson 3: Best practices and pitfalls
Prompt Evaluation: Pitfalls, Mistakes, and Best Practices
When evaluating prompts, the biggest pitfall is treating an eval (a test that measures prompt performance) as reliable without validating it first. An eval you haven’t validated is just a fancy way of being wrong at scale. If your LLM judge disagrees with human labels on 40% of examples, your prompt or rubric (grading criteria) is not good. Always test evals on examples where you know the right answer. Another common mistake is neglecting to check that a prompt change doesn’t break other evals in your test suite. Good practice is to run all existing evals after each change and consolidate at the end.
Best practices start with building evals iteratively. Focus first on failures, then expand. Use built-in evals (pre-made tests for relevance, refusal, etc.) as a starting point for immediate signal without prompt engineering. Move to custom LLM as a judge evals for deeper assessment. Output shape matters—clean structured outputs make better eval inputs, easier comparisons, and clearer results. A lightweight workflow for Claude API is: draft a prompt, build data, call Claude, score results, then repeat. Treat this as prerequisite practice for the Claude Certified Architect exam, because architecture choices depend on knowing how behavior is measured. Advanced practitioners build their own eval process on top of their business case.
Sources
- 2026-05-07 — Agent Optimization with Pydantic AI GEPA, Evals, Feedback Loops Samuel Colvin, Pydantic
- 2026-05-03 — Context Is the New Code Patrick Debois, Tessl
- 2026-05-14 — Ship Real Agents Hands-On Evals for Agentic Applications Laurie Voss, Arize
- 2026-06-01 — Claude Certified Architect Prerequisite Building with the Claude API Part 4 Structured Data
- 2026-05-17 — Fighting AI with AI Lawrence Jones, Incident
- 2026-06-05 — Claude Certified Architect Prerequisite Claude API Part 5 Prompt Eval to Running the Eval
- 2026-05-14 — Mind the Gap (In your Agent Observability) Amy Boyd & Nitya Narasimhan, Microsoft
- 2026-05-06 — Full Walkthrough Writing & Using Skills Nick Nisi and Zack Proser
- 2026-05-16 — How to Leverage Domain Expertise Chris Lovejoy, Notius Labs