Agent Evaluation Methods

Agent Evaluation Methods

Guides an AI agent in building evaluation systems for agent pipelines, with deterministic checks, regression suites, rubrics, quality gates and production monitoring.

Skill files3 files

references/

scripts/

SKILL.md287 lines
1
---
2
name: evaluation
3
description: "This skill should be used when building agent evaluation systems: deterministic checks, regression suites, multi-dimensional rubrics, quality gates, production monitoring, baseline comparison, and outcome measurement for agent pipelines."
4
---
5
6
# Evaluation Methods for Agent Systems
7
8
Evaluate agent systems differently from traditional software because agents make dynamic decisions, are non-deterministic between runs, and often lack single correct answers. Build evaluation frameworks that account for these characteristics, provide actionable feedback, catch regressions, and validate that context engineering choices achieve intended effects.
9
10
## When to Activate
11
12
Activate this skill when:
13
- Testing agent performance systematically
14
- Validating context engineering choices
15
- Measuring improvements over time
16
- Catching regressions before deployment
17
- Building quality gates for agent pipelines
18
- Comparing different agent configurations
19
- Evaluating production systems continuously
20
21
Do not activate this skill for adjacent work owned by other skills:
22
- Designing the LLM judge itself, pairwise comparison, judge calibration, or bias mitigation: `advanced-evaluation`.
23
- Designing autonomous control surfaces, novelty gates, rollback, or PR approval boundaries: `harness-engineering`.
24
- Debugging a specific context failure mode before measuring it: `context-degradation`.
25
- Comparing harness-driven and model-driven compaction across context budgets, or profiling a model's compaction behavior: `compaction-control-profiling`.
26
27
## Core Concepts
28
29
Focus evaluation on outcomes rather than execution paths, because agents may find alternative valid routes to goals. Judge whether the agent achieves the right outcome via a reasonable process, not whether it followed a specific sequence of steps.
30
31
Use multi-dimensional rubrics instead of single scores because one number hides critical failures in specific dimensions. Capture factual accuracy, completeness, citation accuracy, source quality, and tool efficiency as separate dimensions, then weight them for the use case.
32
33
Use model-judged evaluation only after deterministic checks and rubrics are stable. When the work centers on judge prompts, pairwise comparison, calibration, or bias mitigation, switch to Advanced Evaluation.
34
35
Run deterministic validation before LLM judgment whenever the artifact has machine-checkable structure. Schema validity, duplicate keys, rubric math, manifest sync, retrieval status, and required evidence paths should fail fast before an evaluator spends tokens or returns a subjective score.
36
37
**Performance Drivers**
38
39
Apply browsing-agent research when designing evaluation budgets: token usage, tool calls, and model choice can dominate measured performance variance (claim-evaluation-browsecomp-variance).
40
41
| Factor | Variance Explained | Implication |
42
|--------|-------------------|-------------|
43
| Token usage | Primary driver | More exploration can improve performance until cost or context quality collapses |
44
| Number of tool calls | Secondary driver | More tool use helps only when calls retrieve useful evidence |
45
| Model choice | Secondary but multiplicative | Better models often use tokens and tools more efficiently |
46
47
Act on these implications when designing evaluations:
48
- **Set realistic token budgets**: Evaluate agents with production-realistic token limits, not unlimited resources.
49
- **Compare model upgrades against token increases**: Better models may use tokens more efficiently than weaker models with larger budgets.
50
- **Validate multi-agent architectures**: Extra agents add tokens and tool calls; evaluate them against single-agent baselines.
51
52
## Detailed Topics
53
54
### Evaluation Challenges
55
56
**Handle Non-Determinism and Multiple Valid Paths**
57
58
Design evaluations that tolerate path variation because agents may take completely different valid paths to reach goals. One agent might search three sources while another searches ten; both may produce correct answers. Avoid checking for specific steps. Instead, define outcome criteria (correctness, completeness, quality) and score against those, treating the execution path as informational rather than evaluative.
59
60
**Test Context-Dependent Failures**
61
62
Evaluate across a range of complexity levels and interaction lengths because agent failures often depend on context in subtle ways. An agent might succeed on simple queries but fail on complex ones, work well with one tool set but fail with another, or degrade after extended interaction as context accumulates. Include simple, medium, complex, and very complex test cases to surface these patterns.
63
64
**Score Composite Quality Dimensions Separately**
65
66
Break agent quality into separate dimensions (factual accuracy, completeness, coherence, tool efficiency, process quality) and score each independently because an agent might score high on accuracy but low on efficiency, or vice versa. Then compute weighted aggregates tuned to use-case priorities. This approach reveals which dimensions need improvement rather than averaging away the signal.
67
68
### Evaluation Rubric Design
69
70
**Build Multi-Dimensional Rubrics**
71
72
Define rubrics covering key dimensions with descriptive levels from excellent to failed. Include these core dimensions and adapt weights per use case:
73
74
- Factual accuracy: Claims match ground truth (weight heavily for knowledge tasks)
75
- Completeness: Output covers requested aspects (weight heavily for research tasks)
76
- Citation accuracy: Citations match claimed sources (weight for trust-sensitive contexts)
77
- Source quality: Uses appropriate primary sources (weight for authoritative outputs)
78
- Tool efficiency: Uses right tools a reasonable number of times (weight for cost-sensitive systems)
79
80
**Convert Rubrics to Numeric Scores**
81
82
Map dimension assessments to numeric scores (0.0 to 1.0), apply per-dimension weights, and calculate weighted overall scores. Set passing thresholds based on use-case requirements, typically 0.7 for general use and 0.9 for high-stakes applications. Store individual dimension scores alongside the aggregate because the breakdown drives targeted improvement.
83
84
### Evaluation Methodologies
85
86
**Use LLM-as-Judge for Scale**
87
88
Build LLM-based evaluation prompts that include: clear task description, the agent output under test, ground truth when available, an evaluation scale with explicit level descriptions, and a request for structured judgment with reasoning. LLM judges provide consistent, scalable evaluation across large test sets. Use a different model family than the agent being evaluated to avoid self-enhancement bias.
89
90
**Supplement with Human Evaluation**
91
92
Route edge cases, unusual queries, and a random sample of production traffic to human reviewers because humans notice hallucinated answers, system failures, and subtle biases that automated evaluation misses. Track patterns across human reviews to identify systematic issues and feed findings back into automated evaluation criteria.
93
94
**Apply End-State Evaluation for Stateful Agents**
95
96
For agents that mutate persistent state (files, databases, configurations), evaluate whether the final state matches expectations rather than how the agent got there. Define expected end-state assertions and verify them programmatically after each test run.
97
98
### Test Set Design
99
100
**Select Representative Samples**
101
102
Start with small samples (20-30 cases) during early development when changes have dramatic impacts and low-hanging fruit is abundant. Scale to 50+ cases for reliable signal as the system matures. Sample from real usage patterns, add known edge cases, and ensure coverage across complexity levels.
103
104
**Stratify by Complexity**
105
106
Structure test sets across complexity levels to prevent easy examples from inflating scores:
107
- Simple: single tool call, factual lookup
108
- Medium: multiple tool calls, comparison logic
109
- Complex: many tool calls, significant ambiguity
110
- Very complex: extended interaction, deep reasoning, synthesis
111
112
Report scores per stratum alongside overall scores to reveal where the agent actually struggles.
113
114
### Context Engineering Evaluation
115
116
**Validate Context Strategies Systematically**
117
118
Run agents with different context strategies on the same test set and compare quality scores, token usage, and efficiency metrics. This isolates the effect of context engineering from other variables and prevents anecdote-driven decisions.
119
120
**Run Degradation Tests**
121
122
Test how context degradation affects performance by running agents at different context sizes. Identify performance cliffs where context becomes problematic and establish safe operating limits. Feed these limits back into context management strategies.
123
124
### Continuous Evaluation
125
126
**Build Automated Evaluation Pipelines**
127
128
Integrate evaluation into the development workflow so evaluations run automatically on agent changes. Track results over time, compare versions, and block deployments that regress on key metrics.
129
130
**Monitor Production Quality**
131
132
Sample production interactions and evaluate them continuously. Set alerts for quality drops below warning (0.85 pass rate) and critical (0.70 pass rate) thresholds. Maintain dashboards showing trend analysis over time windows to detect gradual degradation.
133
134
## Practical Guidance
135
136
### Building Evaluation Frameworks
137
138
Follow this sequence to build an evaluation framework, because skipping early steps leads to measurements that do not reflect real quality:
139
140
1. Define quality dimensions relevant to the use case before writing any evaluation code, because dimensions chosen later tend to reflect what is easy to measure rather than what matters.
141
2. Create rubrics with clear, descriptive level definitions so evaluators (human or LLM) produce consistent scores.
142
3. Build test sets from real usage patterns and edge cases, stratified by complexity, with at least 50 cases for reliable signal.
143
4. Implement automated evaluation pipelines that run on every significant change.
144
5. Establish baseline metrics before making changes so improvements can be measured against a known reference.
145
6. Run evaluations on all significant changes and compare against the baseline.
146
7. Track metrics over time for trend analysis because gradual degradation is harder to notice than sudden drops.
147
8. Supplement automated evaluation with human review on a regular cadence.
148
9. Separate deterministic validation failures from quality judgments so invalid artifacts cannot be laundered by a favorable LLM score.
149
150
### Avoiding Evaluation Pitfalls
151
152
Guard against these common failures that undermine evaluation reliability:
153
154
- **Overfitting to specific paths**: Evaluate outcomes, not specific steps, because agents find novel valid paths.
155
- **Ignoring edge cases**: Include diverse test scenarios covering the full complexity spectrum.
156
- **Single-metric obsession**: Use multi-dimensional rubrics because a single score hides dimension-specific failures.
157
- **Neglecting context effects**: Test with realistic context sizes and histories rather than clean-room conditions.
158
- **Skipping human evaluation**: Automated evaluation misses subtle issues that humans catch reliably.
159
160
## Examples
161
162
**Example 1: Simple Evaluation**
163
```python
164
def evaluate_agent_response(response, expected):
165
rubric = load_rubric()
166
scores = {}
167
for dimension, config in rubric.items():
168
scores[dimension] = assess_dimension(response, expected, dimension)
169
overall = weighted_average(scores, config["weights"])
170
return {"passed": overall >= 0.7, "scores": scores}
171
```
172
173
**Example 2: Test Set Structure**
174
175
Test sets should span multiple complexity levels to ensure comprehensive evaluation:
176
177
```python
178
test_set = [
179
{
180
"name": "simple_lookup",
181
"input": "What is the capital of France?",
182
"expected": {"type": "fact", "answer": "Paris"},
183
"complexity": "simple",
184
"description": "Single tool call, factual lookup"
185
},
186
{
187
"name": "medium_query",
188
"input": "Compare the revenue of Apple and Microsoft last quarter",
189
"complexity": "medium",
190
"description": "Multiple tool calls, comparison logic"
191
},
192
{
193
"name": "multi_step_reasoning",
194
"input": "Analyze sales data from Q1-Q4 and create a summary report with trends",
195
"complexity": "complex",
196
"description": "Many tool calls, aggregation, analysis"
197
},
198
{
199
"name": "research_synthesis",
200
"input": "Research emerging AI technologies, evaluate their potential impact, and recommend adoption strategy",
201
"complexity": "very_complex",
202
"description": "Extended interaction, deep reasoning, synthesis"
203
}
204
]
205
```
206
207
**Example 3: Deterministic gate before model judgment**
208
```python
209
def evaluate_pr_candidate(candidate):
210
structure = run_validate_repo(candidate)
211
if not structure.ok:
212
return {"passed": False, "reason": "deterministic validation failed", "details": structure.errors}
213
214
quality = run_rubric_eval(candidate)
215
return {"passed": quality.overall >= 0.8, "scores": quality.dimensions}
216
```
217
218
**Example 4: Quality gate dimensions**
219
```yaml
220
gate:
221
deterministic:
222
- schema_valid
223
- required_files_present
224
- no_duplicate_ids
225
quality:
226
factual_accuracy: min 0.85
227
completeness: min 0.80
228
source_traceability: min 0.90
229
```
230
231
## Guidelines
232
233
1. Use multi-dimensional rubrics, not single metrics
234
2. Evaluate outcomes, not specific execution paths
235
3. Cover complexity levels from simple to complex
236
4. Test with realistic context sizes and histories
237
5. Run evaluations continuously, not just before release
238
6. Supplement LLM evaluation with human review
239
7. Track metrics over time for trend detection
240
8. Set clear pass/fail thresholds based on use case
241
242
## Gotchas
243
244
1. **Overfitting evals to specific code paths**: Tests pass but the agent fails on slight input variations. Write eval criteria against outcomes and semantics, not surface patterns, and rotate test inputs periodically.
245
2. **LLM-judge self-enhancement bias**: Models rate their own outputs higher than independent judges do. Use a different model family as the evaluation judge than the model being evaluated.
246
3. **Test set contamination**: Eval examples leak into training data or prompt templates, inflating scores. Keep eval sets versioned and separate from any data used in prompts or fine-tuning.
247
4. **Metric gaming**: Optimizing for the metric rather than actual quality produces agents that score well but disappoint users. Cross-validate automated metrics against human judgments regularly.
248
5. **Single-dimension scoring**: One aggregate number hides critical failures in specific dimensions. Always report per-dimension scores alongside the overall score, and fail the eval if any single dimension falls below its minimum threshold.
249
6. **Eval set too small**: Fewer than 50 examples produces unreliable signal with high variance between runs. Scale the eval set to at least 50 cases and report confidence intervals.
250
7. **Not stratifying by difficulty**: Easy examples inflate overall scores, masking failures on hard cases. Report scores per complexity stratum and weight the overall score to prevent easy-case dominance.
251
8. **Treating eval as one-time**: Evaluation must be continuous, not a launch gate. Agent quality drifts as models update, tools change, and usage patterns evolve. Run evals on every change and on a regular production cadence.
252
253
## Integration
254
255
This skill owns outcome measurement and quality gates. Adjacent skills own specialized evaluator design and control-loop governance:
256
257
- `advanced-evaluation`: LLM-as-judge prompt design, pairwise comparison, calibration, and bias mitigation.
258
- `harness-engineering`: locked evaluators, editable surfaces, rollback, and human approval boundaries.
259
- `context-degradation`: detecting and measuring degradation patterns.
260
- `context-optimization`: measuring token, cost, latency, and quality effects of optimizations.
261
- `compaction-control-profiling`: compaction-specific conditions and metrics for deciding who controls compaction per model.
262
- `multi-agent-patterns`: evaluating coordination quality and parallelization trade-offs.
263
- `tool-design`: evaluating tool selection and recovery effectiveness.
264
- `memory-systems`: evaluating memory retrieval and retention quality.
265
266
## References
267
268
Internal reference:
269
- [Metrics Reference](./references/metrics.md) - Read when: designing specific evaluation metrics, choosing scoring scales, or implementing weighted rubric calculations
270
271
Internal skills:
272
- All other skills connect to evaluation for quality measurement
273
274
External resources:
275
- LLM evaluation benchmarks - Read when: selecting or building benchmark suites for agent comparison
276
- Agent evaluation research papers - Read when: adopting new evaluation methodologies or validating current approach
277
- Production monitoring practices - Read when: setting up alerting, dashboards, or sampling strategies for live systems
278
279
---
280
281
## Skill Metadata
282
283
**Created**: 2025-12-20
284
**Last Updated**: 2026-05-15
285
**Author**: Agent Skills for Context Engineering Contributors
286
**Version**: 1.2.0
287

© Context Engineering Agent Skills Contributors · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 6,373 prompts

More by @OpenSourceBuffGuy

See all
Website Clone Architect prompt image

Website Clone Architect

Reverse-engineers a website section by section, writes component specs, and hands them to parallel builder agents in git worktrees to rebuild it.

agent-skill, orchestrator, parallel-agents, multi-agent, plan-then-execute, web-development, frontend, codebase-analysis, scaffolding, css, html, nextjs, typescript, git, mcp, claude-code, for-developers, for-designers, long-form, advanced, technical-spec, task-decomposition, structured-output, design-systems, ui-ux, tool-use, checklist, report, vibe-coding

Italian Terrace Cafe Candid Portrait prompt image

Italian Terrace Cafe Candid Portrait

Generates a photorealistic candid shot of a woman in a white corset dress laughing at a sunny hotel terrace cafe, written as detailed JSON.

image-prompt, json-prompt, structured-output, photorealistic, portrait, woman, candid, fashion, cottagecore, natural-light, golden-hour, bokeh, summer, travel, cityscape, mountains, medium-shot, vibrant-colors, for-photographers, nano-banana, fashion-shoot, luxury

Night Street Photo With Leashed Cat prompt image

Night Street Photo With Leashed Cat

Generates a flash-lit night street photo of a blonde woman in a retro track jacket walking a hissing tabby cat on a leash.

image-prompt, json-prompt, nano-banana, structured-output, portrait, woman, animals, pet-portrait, night-scene, street-photography, candid, editorial, fashion, dramatic-lighting, photorealistic, vertical-format, medium-shot, graffiti, for-photographers, for-content-creators

1 view

Reviews

Loading reviews…

Discussion

Loading comments…