Evaluation
Generative AI Evals: Groundedness, Tools, and Safety
Design evaluation suites for generative systems that test task success, evidence use, structured outputs, tool execution, safety, and change over time.
By the end you can
- Decompose generative-system quality into independently testable properties
- Design eval datasets from real tasks, failures, and adversarial cases
- Evaluate groundedness, citations, structured output, and tool-use traces
- Validate model-based graders against human-labeled examples
Example
One deployed chatbot, failing at five separate layers
New York City put an AI chatbot in front of business owners in September 2023. It was still in beta when the Office of the New York City Comptroller re-tested it. The audit was published on 30 December 2025. The failures it documented do not sit at a single layer of the system.
The chatbot told businesses they could take workers' tips and refuse housing vouchers. The Markup reported that in March 2024. More than a year later the auditors found it still returned different answers to identical questions. The Office of Technology and Innovation answered the audit in writing with “over 95% accuracy” and “nearly zero hallucinations”. The auditors went to the denominator. The rate had been computed on prompts recorded, not on questions asked. “Had OTI calculated accuracy rates based on the number of questions asked, rates would have ranged from 84.8% to 92.7% for August 2025.”
One deployed system. Five distinct things that had to be tested separately. And one accuracy headline that concealed every one of them.
- Policy failure: fluent answers, wrong law. The Markup found in March 2024 that the assistant told businesses they could take workers' tips and refuse housing vouchers.
- Consistency failure: re-tested by the Comptroller's auditors, the chatbot still returned different answers to identical questions. A single passing test proves nothing about the next run.
- Measurement failure: OTI claimed “over 95% accuracy”, but the rate rested on prompts recorded rather than questions asked. On the right denominator, August 2025 accuracy was 84.8% to 92.7%.
- Reporting failure: OTI's own monitoring “did not record any inconsistent responses” while independent testers were finding them. The absence of logged failures is a property of the logging, not of the system.
- Feedback failure: of 70 users who left feedback on more than 2,200 questions in July-August 2025, 50 — 71.4% — were negative. The operator had the signal and did not act on it.
Visual
EchoLeak entered through retrieval and left through the tools
A failure can enter at any of five layers: task and user state, context and retrieval, model behavior, tools and actions, product controls. The layer where it surfaces is rarely the layer where it began. EchoLeak is that path traced end to end in a production system. The record is CVE-2025-32711, published 11 June 2025.
A single crafted email placed instructions into Microsoft 365 Copilot's retrieved context. That is the context-and-retrieval layer doing exactly its job: pulling in a document from an untrusted sender. The assistant then exfiltrated internal data to the attacker through auto-fetched images and an allowed proxy. That is the tools-and-actions layer, again behaving as configured. The victim did nothing at all. The exploit is zero-click. Microsoft, which assigned the record, describes it in one sentence: “Ai command injection in M365 Copilot allows an unauthorized attacker to disclose information over a network.”
Note what is not in that sentence. No claim that the model wrote something false, ungrammatical or off-policy. An evaluation suite pointed at generated text would have scored this interaction as a pass.
Even the severity is layered. Microsoft scored the record CVSS 9.3 (Critical) under CWE-74. NIST's own analysis of the same record scored it 7.5 (High). Two competent bodies, one vulnerability, different numbers. A single score is a summary of a judgement, not a measurement of a system.
- 01
Task and user state
Intent, constraints, missing information, and success definition.
- 02
Context and retrieval
Documents, freshness, permissions, ranking, and evidence coverage.
- 03
Model behavior
Reasoning, instruction following, uncertainty, and output generation.
- 04
Tools and actions
Arguments, authorization, side effects, retries, and idempotency.
- 05
Product controls
Policy, UI, logging, fallback, monitoring, and human review.
Steps
Two eval sets that grew out of public failures
An eval set that arrives complete from a benchmark repository covers the benchmark. The five steps here — sample real tasks, add known failures, create contrasts, define graders, version and refresh — are not advice about being thorough. They are dated events in public work.
Step 2 is what the Comptroller's auditors did to MyCity. Their scope says they tested “previously documented problematic responses from media reports”. The Markup's March 2024 findings about workers' tips and housing vouchers became regression cases in a 2025 audit, and the system was made to face them again. An incident nobody turns into a test case is an incident the system is free to repeat. MyCity did repeat it: the same audit found inconsistent answers to identical questions.
Step 3 is why those cases are written in pairs. A question can differ from its neighbour in one decisive fact — the plan, the date, the jurisdiction, the voucher. That tests whether behaviour tracks the distinction that matters or the wording around it. Step 4 decides who scores it. A deterministic check where the answer is checkable, a rubric and a human where it is not.
Step 5 is not housekeeping either. Princeton's HAL leaderboard removed one scaffold's results from the τ-bench airline set over “a critical data leakage issue”, after test-set examples turned up in that scaffold's demonstration file. Contamination is not a theoretical property of eval sets. It is a maintenance event, with a date, a cause and a retraction. It happened in the open, on a public leaderboard, to results that had already been reported.
1. Sample real tasks
Collect representative prompts, contexts, tools, and user constraints.
2. Add known failures
Turn incidents, complaints, and red-team findings into regression cases.
3. Create contrasts
Include near-neighbor cases that differ in one decisive fact.
4. Define graders
Specify deterministic checks, references, rubrics, or human review.
5. Version and refresh
Track provenance, difficulty, contamination, and changing product behavior.
Comparison
65% accurate, 17% hallucinating, 62% refusing: one score cannot hold this
Collapse quality into one number and you lose the direction each part is moving in. Two AI legal research tools show how far apart those directions can be. The first preregistered evaluation of proprietary RAG legal research tools ran in May 2024. The set was 202 legal queries: 162 hand-written or adapted, 20 taken verbatim from LegalBench's Rule QA task, 20 from BARBRI bar-exam prep. Magesh and colleagues report what the tools did with them: “Lexis+ AI provides accurate (i.e., correct and grounded) responses on 65% of queries, while Ask Practical Law AI refuses to answer queries 62% of the time and responds accurately just 18% of the time.”
Read the four properties off those figures. Task success: LexisNexis's Lexis+ AI succeeds on roughly two queries in three, Thomson Reuters's Ask Practical Law AI on fewer than one in five. Groundedness: Lexis+ AI hallucinates 17% of the time while returning real, linked citations. The citation resolves. The document exists. The claim it is offered to support is not in it. Safety and refusal: a tool that declines 62% of questions will look excellent on any average that counts only the answers it gave. That is why refusal rate goes next to accuracy rather than inside it. Format correctness sits underneath all of this, and it is the one property a machine can settle on its own. Valid citation syntax was never in question here.
That this separation is a standard rather than a preference is written down. NIST AI 600-1, the generative-AI profile of the AI Risk Management Framework, was published in July 2024. It enumerates 12 risks specific to generative systems. They run from CBRN Information or Capabilities through Confabulation, Data Privacy, Information Integrity and Information Security to Value Chain and Component Integration. Its confabulation section describes the legal-research failure precisely: “GAI outputs may also include confabulated logic or citations that purport to justify or explain the system's answer, which may further mislead humans into inappropriately trusting the system's output.” The profile exists because Executive Order 14110, signed 30 October 2023, ordered a companion resource to the AI RMF for generative AI within 270 days.
Safety adds a fifth column that none of these rates capture. EchoLeak's crafted email is not a question the suite asked. It is a document the retrieval layer accepted. Indirect injection is tested with adversarial inputs, not measured on the query set.
Task success
The response or action accomplishes the user’s allowed goal.
- Needs scenario state
- Can be deterministic or judged
- Includes completion criteria
- May require follow-up
Groundedness
Claims are supported by permitted evidence.
- Needs claim-evidence alignment
- Citation presence is insufficient
- Freshness matters
- Can require abstention
Format correctness
Output obeys a schema or protocol.
- Can be checked deterministically
- Does not prove semantic truth
- Includes required fields
- Supports reliable integration
Safety and policy
Behavior respects constraints under ordinary and adversarial inputs.
- Needs threat models
- Includes refusals and safe completion
- Tests indirect injection
- Requires severity weighting
Key idea
τ-bench grades the database, not the sentence
A generated function name or a schema-valid JSON object is not evidence that an action was correct. τ-bench, released in June 2024, settles this by grading the world the agent leaves behind. Its reward r = r_action × r_output requires the final database to be identical to the annotated ground-truth outcome database. Separately, the agent's replies must contain the required information as substrings. A confident, well-worded answer over a wrong database state scores zero.
The result on that grader: “Our experiments show that even state-of-the-art function calling agents (like gpt-4o) succeed on <50% of the tasks, and are quite inconsistent (pass^8 <25% in retail).” Two numbers, two different questions. Fewer than half of tasks completed at all. Fewer than a quarter completed reliably enough to survive repetition. A single green run tells you close to nothing about the next one.
Princeton's independent HAL leaderboard runs the 50-task public airline test set across 26 evaluations of 15 models under 2 scaffolds. Its best score is 56%, held jointly by o4-mini High under TAU-bench Tool Calling and Claude-3.7 Sonnet under the HAL Generalist Agent. That is the state of the art on a state-diff grader, on fifty tasks.
So evaluate tool selection, arguments, authorization, preconditions, result interpretation, retry behaviour and side effects. Use simulators or sandboxes for destructive operations. Review the trace, not the closing paragraph.
Under a state-diff grader, the leading function-calling agents finished fewer than half their tasks and repeated fewer than a quarter.
A grader whose ceiling is human agreement
Model-based graders scale evaluation, compare alternatives and apply detailed rubrics. They can also show position bias, verbosity preference, reference leakage and failure correlated with the system they are judging.
A 2023 study of LLM-as-a-judge, run on MT-Bench and Chatbot Arena, put numbers on that. It names “position, verbosity, and self-enhancement biases” in model judges. Zheng and colleagues also found that “strong LLM judges like GPT-4 can match both controlled and crowdsourced human preferences well, achieving over 80% agreement, the same level of agreement between humans”.
The second half of that sentence is the one to hold on to. The benchmark being matched is human agreement, not correctness. A grader that reaches the human rate inherits whatever the raters got wrong together. So validate graders on human-adjudicated cases. Measure agreement by failure type rather than in aggregate. Randomise presentation order. Keep deterministic checks wherever the answer admits one. τ-bench's database comparison is such a check, and no judge model is involved in it.
A grader model does not become objective because its output is numerical.
Analogy
A flight simulator with instrumented failures
Pilots are not certified on smooth landings. They are put through ordinary flights, equipment failures, ambiguous instructions and emergency checklists, with every control input recorded. The landing alone would not explain whether the procedure was safe.
τ-bench's pass^8 column is the same instinct in a benchmark. It separates doing it once from doing it repeatedly. The gap between under 50% and under 25% in retail is precisely the part a single run cannot show you. MyCity's auditors met the other half of the problem: a system that answered the same question differently on different occasions, which no one-shot certification would have caught.
And a pilot who passed the check ride is the same pilot next week. The system under evaluation is not. A model update can change behaviour the suite already certified. Scenarios and traces have to be re-run, not cited.
Open-ended systems need instrumented scenarios, not only answer snapshots.
The FTC priced the absence of an eval suite at $193,000
Use a stable core suite for comparability, a rotating fresh set for novelty, targeted safety cases and production-sampled tasks. Report pass rates by severity and property rather than burying them in one average. Block a release on critical regressions even when the global score rises. Feed post-deployment incidents into the next version of the suite.
This is a legal control now, not only an engineering habit. On 25 September 2024 the FTC charged DoNotPay, Inc. — marketed as “the world's first robot lawyer” — with deceptive claims, voting 5-0 to authorise the complaint and proposed order. The proposed consent order, published on 30 September 2024, requires $193,000 in monetary relief and notice to consumers who subscribed between 2021 and 2023. The core allegation was an absence of evaluation. No test compared the chatbot's output to a human lawyer's, and no attorneys were retained to check it. Commissioner Andrew N. Ferguson, concurring, put it in one line: “DoNotPay employees had not even tested the quality and accuracy of the legal documents and advice generated by the service.”
The MyCity audit closes the same loop from the public-sector side. The operator's “over 95% accuracy” was 84.8% to 92.7% once the denominator was the number of questions actually asked. The Comptroller's remedy was not a better dashboard. It was a recommendation to conduct structured AI red-teaming — testing designed to find failures, run by people whose job is to find them.
An eval suite is a living product control, and both a federal regulator and a city auditor have now treated its absence as a finding.
Case
817 questions on which the largest models were the least truthful
A benchmark becomes legible when a human baseline is attached to it. TruthfulQA, published in 2021, “comprises 817 questions that span 38 categories, including health, law, finance and politics”. The gap it opens is not marginal: “The best model was truthful on 58% of questions, while human performance was 94%.”
Then the scaling result ran backwards. “The largest models were generally the least truthful”. The routine upgrade — newer, larger, better on the leaderboard you were watching — can regress the suite it was meant to improve. That is the case for re-running evals on every release rather than inheriting the previous verdict. It is also the case for reading results per category. 817 questions across 38 categories leaves roughly twenty items behind any single category score.
Figure
Key takeaways
- Generative applications fail as stacks. EchoLeak entered Microsoft 365 Copilot through retrieved email context and left through its tools, with nothing wrong in the generated prose — Microsoft scored CVE-2025-32711 at 9.3 Critical, NIST at 7.5 High.
- Task success, groundedness, format correctness and safety move in different directions on the same product: “Lexis+ AI provides accurate (i.e., correct and grounded) responses on 65% of queries, while Ask Practical Law AI refuses to answer queries 62% of the time and responds accurately just 18% of the time.”
- Eval sets should grow from documented incidents and then be maintained. The Comptroller's auditors re-tested MyCity on “previously documented problematic responses from media reports”, and Princeton's HAL leaderboard withdrew a scaffold's results over “a critical data leakage issue”.
- Tool-use evaluation grades the state the agent leaves behind. τ-bench's r = r_action × r_output put GPT-4o function-calling agents under 50% on tasks and pass^8 under 25% in retail, with the HAL airline best score at 56%.
- LLM judges are instruments with a human ceiling. GPT-4 judges reach “over 80% agreement, the same level of agreement between humans”, so a grader inherits whatever the raters got wrong together.
- An eval suite is a product control with legal weight. The FTC priced DoNotPay's missing tests at $193,000 plus notice to 2021-2023 subscribers, and MyCity's claimed “over 95% accuracy” was 84.8% to 92.7% once the denominator was the questions asked.