Agent Evals and Prompt Governance
Treat prompts, models, retrieval settings, tool schemas, and routing rules as one versioned behavioral release. Do not declare improvement from anecdotal examples or aggregate scores alone.
Use agent-builder for agent architecture and implementation. Use this skill to define how behavior is measured, compared, released, monitored, and rolled back.
Read references/eval-design.md when selecting metrics, datasets, or release gates.
Workflow
Define the behavior contract.
- Inputs and source of truth
- Required output or action
- Allowed abstention and fallback
- Forbidden side effects
- Latency and cost limits
- Evidence required for correctness
Inventory the release surface.
- System/task prompts and templates
- Model and effort settings
- Tool names, schemas, permissions, and timeouts
- Retrieval/index/filter configuration
- Memory extraction and lifecycle rules
- Deterministic routing, retries, and fallbacks
Build a versioned dataset.
- Include happy paths, edge cases, adversarial inputs, historical failures, and realistic distributions.
- Keep immutable case IDs and provenance.
- Separate development, regression, and blind holdout sets.
- Prevent generated outputs from silently becoming their own ground truth.
Choose metrics by failure mode.
- Exact/schema validation for deterministic contracts
- Precision/recall for extraction and routing
- Citation support and retrieval coverage for grounded answers
- Tool selection, argument correctness, side-effect success, and unnecessary-call rate
- Duplicate, ordering, supersession, and stale-state rates for memory
- P50/P95 latency, token use, and monetary cost
- Human review for high-impact ambiguity
Compare candidate and baseline.
- Run both on the same immutable cases.
- Report per-slice deltas and regressions, not only averages.
- Preserve raw outputs, traces, tool calls, model/config versions, and failures.
- Require repeated runs when model variance can change the decision.
Gate release.
- Block on hard safety or contract failures.
- Set explicit maximum regression by critical slice.
- Canary with stable assignment and observable rollback criteria.
- Keep the previous known-good release immediately recoverable.
Monitor production.
- Sample real failures into a review queue.
- Add confirmed failures to the regression set after independent labeling.
- Detect distribution drift, fallback growth, cost growth, and model/provider changes.
Non-Negotiable Rules
- Never use an LLM judge as the sole gate for deterministic correctness.
- Never compare versions on different datasets or changed scoring code without labeling the comparison invalid.
- Never optimize a single aggregate score while critical slices regress.
- Never log secrets, raw credentials, or unnecessary personal data in traces.
- Never update golden labels merely to make the candidate pass.
- Keep prompt text and evaluation criteria independently reviewable.
Deliverables
Produce the smallest set needed:
- behavior contract,
- dataset manifest,
- metric and slice table,
- baseline-versus-candidate report,
- failure taxonomy,
- release gate,
- canary and rollback plan,
- production monitoring plan.
Verification
Before sign-off, confirm:
- every case has stable provenance and an immutable ID,
- scoring is deterministic where expected,
- raw evidence can reproduce the aggregate report,
- critical slices meet their thresholds,
- cost and latency stay within budget,
- the rollback target is known and tested,
- newly discovered failures become durable regression cases.
1---2name: agent-evals-and-prompt-governance3description: Design, implement, review, and operate evaluations and release governance for production AI agents and prompts. Use for golden datasets, regression tests, prompt/model/tool versioning, structured-output validation, retrieval grounding, tool-call correctness, memory quality, routing and fallback evaluation, cost/latency budgets, canary releases, rollback gates, and comparing agent versions with reproducible evidence.4---56# Agent Evals and Prompt Governance78Treat prompts, models, retrieval settings, tool schemas, and routing rules as one versioned behavioral release. Do not declare improvement from anecdotal examples or aggregate scores alone.910Use `agent-builder` for agent architecture and implementation. Use this skill to define how behavior is measured, compared, released, monitored, and rolled back.1112Read [references/eval-design.md](references/eval-design.md) when selecting metrics, datasets, or release gates.1314## Workflow15161. Define the behavior contract.17 - Inputs and source of truth18 - Required output or action19 - Allowed abstention and fallback20 - Forbidden side effects21 - Latency and cost limits22 - Evidence required for correctness23242. Inventory the release surface.25 - System/task prompts and templates26 - Model and effort settings27 - Tool names, schemas, permissions, and timeouts28 - Retrieval/index/filter configuration29 - Memory extraction and lifecycle rules30 - Deterministic routing, retries, and fallbacks31323. Build a versioned dataset.33 - Include happy paths, edge cases, adversarial inputs, historical failures, and realistic distributions.34 - Keep immutable case IDs and provenance.35 - Separate development, regression, and blind holdout sets.36 - Prevent generated outputs from silently becoming their own ground truth.37384. Choose metrics by failure mode.39 - Exact/schema validation for deterministic contracts40 - Precision/recall for extraction and routing41 - Citation support and retrieval coverage for grounded answers42 - Tool selection, argument correctness, side-effect success, and unnecessary-call rate43 - Duplicate, ordering, supersession, and stale-state rates for memory44 - P50/P95 latency, token use, and monetary cost45 - Human review for high-impact ambiguity46475. Compare candidate and baseline.48 - Run both on the same immutable cases.49 - Report per-slice deltas and regressions, not only averages.50 - Preserve raw outputs, traces, tool calls, model/config versions, and failures.51 - Require repeated runs when model variance can change the decision.52536. Gate release.54 - Block on hard safety or contract failures.55 - Set explicit maximum regression by critical slice.56 - Canary with stable assignment and observable rollback criteria.57 - Keep the previous known-good release immediately recoverable.58597. Monitor production.60 - Sample real failures into a review queue.61 - Add confirmed failures to the regression set after independent labeling.62 - Detect distribution drift, fallback growth, cost growth, and model/provider changes.6364## Non-Negotiable Rules6566- Never use an LLM judge as the sole gate for deterministic correctness.67- Never compare versions on different datasets or changed scoring code without labeling the comparison invalid.68- Never optimize a single aggregate score while critical slices regress.69- Never log secrets, raw credentials, or unnecessary personal data in traces.70- Never update golden labels merely to make the candidate pass.71- Keep prompt text and evaluation criteria independently reviewable.7273## Deliverables7475Produce the smallest set needed:7677- behavior contract,78- dataset manifest,79- metric and slice table,80- baseline-versus-candidate report,81- failure taxonomy,82- release gate,83- canary and rollback plan,84- production monitoring plan.8586## Verification8788Before sign-off, confirm:8990- every case has stable provenance and an immutable ID,91- scoring is deterministic where expected,92- raw evidence can reproduce the aggregate report,93- critical slices meet their thresholds,94- cost and latency stay within budget,95- the rollback target is known and tested,96- newly discovered failures become durable regression cases.