AI Agent Eval Spec Skill
Use When
- Produce or update AI evaluation specification from approved project evidence.
- Resolve decisions about representative datasets, evaluators, thresholds, calibration, regression gates, and evidence.
- Prepare a reviewable handoff for AI engineering and release teams.
Do Not Use When
- The task is primarily owned by test-plan; route there and use this skill only for its named output.
- Required project evidence or decision authority is unavailable and the requester expects a pass, release, certification, or production change.
Required Inputs
| Artefact |
Source/provider |
Required? |
Behaviour when absent |
| Project _context/, approved requirements, and relevant architecture |
Project owner and upstream phase skills |
Required |
Stop at a gap register; do not invent scope, thresholds, integrations, or owners. |
| Existing artefact, implementation, configuration, and evidence named below |
Repository, delivery team, or service owner |
Required when updating or assessing |
Mark inaccessible items not assessed; do not treat them as passed. |
| Target audience, environment, risk tolerance, and authority |
Requester and accountable owner |
Required |
Produce a read-only outline with explicit assumptions; do not mutate project or production state. |
Outputs
| Artefact |
Consumer |
Observable acceptance condition |
| AI Evaluation Specification |
AI engineering and release teams |
Each evaluated behaviour has a representative dataset, deterministic scoring rule, threshold rationale, and retained run evidence. |
| Decision and gap register |
Reviewer and downstream phase owner |
Every assumption, rejected option, unresolved dependency, waiver, and owner is explicit. |
| Validation evidence |
Release or governance reviewer |
Checks identify command or method, date, result, evidence location, and all unassessed items. |
Evidence Produced
| Evidence |
Minimum content |
Acceptance |
| Traceability record |
Source artefact, decision, output section, owner |
No mandatory decision is source-free. |
| Quality-gate result |
Check, expected result, observed result, evidence path |
Failures and unavailable checks cannot appear as passes. |
| Review record |
Reviewer, date, disposition, open actions |
The consumer can reproduce the acceptance decision. |
Capability and Permission Boundaries
- Minimum capabilities: read and search the authorised project sources. Execution is optional and limited to non-destructive validation.
- Assessment and planning default to read-only. Create or edit the named project document only when the request explicitly authorises it. Production mutation, publishing, destructive action, spending, external communication, or certification claims require separate explicit authority.
- Treat secrets, tenant data, incident evidence, and financial records as least-privilege inputs; expose only the minimum evidence needed for review.
Degraded Mode
If files, execution, network, rendering, environment access, fonts, or current evidence are unavailable, return the narrowest useful draft plus a gap register. Label affected checks not assessed, retain the intended acceptance oracle, and state who must supply or verify the missing evidence. Never convert an unavailable check into a pass.
Decision Rules
| Choice |
Action |
Failure or risk avoided |
| Evidence is complete and authority is explicit |
Choose evaluators and thresholds from the stated product risk and produce the full artefact. |
A benchmark score without a release oracle. |
| A required source or approval is missing |
Stop the affected branch; record the gap, owner, and unblock condition. |
Fabricated requirements or unauthorised action. |
| Evidence conflicts across sources |
Preserve both claims, identify the controlling owner, and request a recorded decision. |
Silent selection of a convenient but wrong source. |
| A check cannot run in the available environment |
Keep its oracle and mark it not assessed; require later execution evidence. |
False assurance from capability limits. |
Workflow
- Confirm the named deliverable, consumer, scope, environment, authority, and neighbouring-skill boundary.
- Inventory required sources and validate provenance, freshness, internal consistency, and missing inputs. Stop the affected branch on a mandatory gap.
- Extract traceable requirements, invariants, risks, and measurable acceptance criteria; record conflicts before choosing a design or procedure.
- Apply the decision rules and the domain workflow below. For a failed branch, preserve evidence, choose the documented recovery path, or escalate to the named owner.
- Draft the artefact, decision register, and evidence record together. Do not defer failure handling, rollback, security, tenancy, accessibility, or operational ownership.
- Run available checks, review every result, repair failures, and hand off only when acceptance is observable. If recovery fails or authority is exceeded, stop and escalate without mutation.
Quality Standards
- Ground every section in a named project source, decision, measured result, or accountable owner.
- Give each requirement or procedure a deterministic oracle that another reviewer can reproduce.
- Keep assumptions, exclusions, degraded checks, residual risks, and waivers visible at handoff.
- Preserve the domain invariants and more specific controls in the existing workflow below; this contract does not replace them.
- Run the repository anti-AI-slop gate: remove filler, verify named standards and dependencies, and retain purposeful domain detail.
Anti-Patterns
- Copying a generic template without mapping it to project sources. Fix: attach each section to an approved requirement, configuration, risk, or owner.
- Choosing a threshold because it is common practice. Fix: derive it from a requirement, measured baseline, risk decision, or current verified source.
- Reporting an inaccessible or unexecuted check as passed. Fix: mark it
not assessed, preserve the oracle, and name the verifier.
- Mixing the neighbouring test-plan concern into this artefact without a boundary. Fix: cross-reference its output and keep ownership explicit.
- Omitting failure, rollback, empty-state, security, tenancy, or escalation behaviour. Fix: specify the trigger, safe action, verification, and owner for each applicable case.
- Mutating a repository, environment, tenant, ledger, or external system while drafting guidance. Fix: remain read-only until the exact mutation and authority are explicit.
- Claiming compliance, certification, readiness, or release from prose alone. Fix: require source-attributed evidence and a named acceptance decision.
Worked Example
Given an approved project source and a conflicting implementation detail, record both with provenance, stop the affected branch, and obtain the accountable owner's decision. Then update the relevant contract, define a reproducible acceptance check, and retain its observed result. The artefact is accepted only when each evaluated behaviour has a representative dataset, deterministic scoring rule, threshold rationale, and retained run evidence.
References
- logic.prompt - load only when its template, logic, or detail is needed.
- README.md - load only when its template, logic, or detail is needed.
Overview
The agent-specific complement to ai-eval-harness-spec. Agents are evaluated on outcomes and trajectories, not single-shot generations. Eval requires (a) golden-task sets that capture the goal state, (b) replay environments that make every tool call deterministic, and (c) agent-specific metrics.
Core Instructions
Step 1: Inventory golden-task sets per feature
For each agent FR declare a GOLDEN-AGT-<FEATURE>-NNN set. Each task carries:
id: AGT-TRG-001
feature: inbox-triage
initial_state: <world state before the run>
user_goal: <natural-language goal>
gold_trajectory: <ordered list of (tool, args, observation) tuples that a competent operator would execute>
goal_state: <world state the agent should reach>
acceptance_rubric: <how a judge decides whether goal_state was reached>
tags: [tier:pro, locale:en-US, sensitivity:low]
Step 2: Define the replay environment
For each feature, declare a deterministic synthetic environment that responds to tool calls with canned outputs:
- Storage:
replay-env/<feature>/<task_id>.yaml.
- Responder: maps
(tool_name, input_args_canonical) to a fixed output.
- Variance: zero (the environment is byte-deterministic given the same agent trajectory).
- Failure injection: parameterised — the environment can be configured to return errors, timeouts, or malicious outputs for adversarial replays.
Step 3: Declare the six core agent metrics with thresholds
| Metric |
Definition |
Default threshold |
| Task success rate |
judge marks goal_state reached |
>= 0.90 |
| Step efficiency |
mean(actual_steps / gold_steps) on successful runs |
<= 1.5 |
| Tool-choice quality |
% of tool calls that match the gold tool at the gold step |
>= 0.92 |
| Hallucinated-argument rate |
% of tool calls with at least one fabricated argument |
<= 0.01 |
| Irreversible-action-incident rate |
irreversible actions that the judge marks as incorrect |
0 (zero-tolerance) |
| Intervention rate |
% of runs where mid-run human intervention was required |
feature-specific; declared in PRD |
Step 4: Define the judge-LLM rubric per metric
- Task success: pairwise compare
goal_state claimed by agent vs the YAML goal_state; rubric 3 binary criteria.
- Tool-choice quality: exact-match for
tool_name; semantic-match for args via judge-LLM.
- Hallucinated argument: judge inspects each arg; flags any arg not derivable from the observation history.
Calibration set per feature scored monthly by humans; recalibrate if drift > 5 pp.
Step 5: Define the CI gate
CI gate runs on every PR touching planner/, tools/, prompts/agent/, or action-catalogue/:
- Task success on the affected feature's golden set not down > 2 pp.
- Tool-choice quality not down > 1 pp.
- Hallucinated-argument rate not up > 0.005 pp.
- Irreversible-action-incident rate = 0.
Step 6: Define scheduled regression
| Cadence |
Suite |
Action on drop |
| Nightly |
Golden + adversarial smoke per feature |
SEV3 to AI lead if any metric down > 3 pp |
| Weekly |
Full agent red-team replay |
SEV2 if any new HIGH finding |
| Monthly |
Calibration recheck |
recalibrate judge if drift > 5 pp |
| Quarterly |
Full sweep |
update agent model card; review with security |
Step 7: Operational ownership
The agent eval rig is owned by the AI lead with a named back-up. Replay-env updates require PR with a reviewer from the back-end owner of every called system. Golden-task additions require sign-off from the AI lead and the product owner of the feature.
Step 8: Write the spec
AI_Agent_Eval_Spec.md sections: 1) Per-feature Golden-Task Inventory, 2) Replay Environments, 3) Metrics & Thresholds, 4) Judge-LLM Rubrics, 5) CI Gate, 6) Scheduled Regression, 7) Operational Ownership, 8) Traceability.
Standards
- OpenAI Evals (agents)
- Anthropic agent-eval patterns
- NIST AI RMF MEASURE
- ISO/IEC 42001 Clause 9
Compliance evidence cross-link
Eval coverage is primary evidence for:
- SOC 2 PI1.2 (processing accuracy), CC4.1 (ongoing monitoring), CC8.1 (change management).
- ISO/IEC 27001:2022 A.8.25 (secure development lifecycle), A.8.29 (security testing).
- EU AI Act Art. 15 (accuracy and robustness).
- NIST AI RMF MEASURE.
The CI gate results, weekly regression report, and monthly calibration recheck are collected per 09-governance-compliance/25-ai-agent-evidence-pack-spec (frequency-table rows 23, 24). Sampling: 25 PR eval results stratified across features and tiers per audit window.
Resources
logic.prompt, README.md, references/ai-agent-eval-spec-template.md.
1---2name: 06-ai-agent-eval-spec3description: Use when evaluating a multi-step AI agent for task success, tool selection, budgets, intervention, recovery, and side-effect evidence; use ai-eval-harness-spec for single-call or non-agentic AI feature evaluation.4---567# AI Agent Eval Spec Skill89<!-- dual-compat-start -->10## Use When1112- Produce or update AI evaluation specification from approved project evidence.13- Resolve decisions about representative datasets, evaluators, thresholds, calibration, regression gates, and evidence.14- Prepare a reviewable handoff for AI engineering and release teams.1516## Do Not Use When1718- The task is primarily owned by test-plan; route there and use this skill only for its named output.19- Required project evidence or decision authority is unavailable and the requester expects a pass, release, certification, or production change.2021## Required Inputs2223| Artefact | Source/provider | Required? | Behaviour when absent |24|---|---|---|---|25| Project _context/, approved requirements, and relevant architecture | Project owner and upstream phase skills | Required | Stop at a gap register; do not invent scope, thresholds, integrations, or owners. |26| Existing artefact, implementation, configuration, and evidence named below | Repository, delivery team, or service owner | Required when updating or assessing | Mark inaccessible items `not assessed`; do not treat them as passed. |27| Target audience, environment, risk tolerance, and authority | Requester and accountable owner | Required | Produce a read-only outline with explicit assumptions; do not mutate project or production state. |28## Outputs2930| Artefact | Consumer | Observable acceptance condition |31|---|---|---|32| AI Evaluation Specification | AI engineering and release teams | Each evaluated behaviour has a representative dataset, deterministic scoring rule, threshold rationale, and retained run evidence. |33| Decision and gap register | Reviewer and downstream phase owner | Every assumption, rejected option, unresolved dependency, waiver, and owner is explicit. |34| Validation evidence | Release or governance reviewer | Checks identify command or method, date, result, evidence location, and all unassessed items. |3536## Evidence Produced3738| Evidence | Minimum content | Acceptance |39|---|---|---|40| Traceability record | Source artefact, decision, output section, owner | No mandatory decision is source-free. |41| Quality-gate result | Check, expected result, observed result, evidence path | Failures and unavailable checks cannot appear as passes. |42| Review record | Reviewer, date, disposition, open actions | The consumer can reproduce the acceptance decision. |4344## Capability and Permission Boundaries4546- Minimum capabilities: read and search the authorised project sources. Execution is optional and limited to non-destructive validation.47- Assessment and planning default to read-only. Create or edit the named project document only when the request explicitly authorises it. Production mutation, publishing, destructive action, spending, external communication, or certification claims require separate explicit authority.48- Treat secrets, tenant data, incident evidence, and financial records as least-privilege inputs; expose only the minimum evidence needed for review.4950## Degraded Mode5152If files, execution, network, rendering, environment access, fonts, or current evidence are unavailable, return the narrowest useful draft plus a gap register. Label affected checks `not assessed`, retain the intended acceptance oracle, and state who must supply or verify the missing evidence. Never convert an unavailable check into a pass.5354## Decision Rules5556| Choice | Action | Failure or risk avoided |57|---|---|---|58| Evidence is complete and authority is explicit | Choose evaluators and thresholds from the stated product risk and produce the full artefact. | A benchmark score without a release oracle. |59| A required source or approval is missing | Stop the affected branch; record the gap, owner, and unblock condition. | Fabricated requirements or unauthorised action. |60| Evidence conflicts across sources | Preserve both claims, identify the controlling owner, and request a recorded decision. | Silent selection of a convenient but wrong source. |61| A check cannot run in the available environment | Keep its oracle and mark it `not assessed`; require later execution evidence. | False assurance from capability limits. |6263## Workflow64651. Confirm the named deliverable, consumer, scope, environment, authority, and neighbouring-skill boundary.662. Inventory required sources and validate provenance, freshness, internal consistency, and missing inputs. Stop the affected branch on a mandatory gap.673. Extract traceable requirements, invariants, risks, and measurable acceptance criteria; record conflicts before choosing a design or procedure.684. Apply the decision rules and the domain workflow below. For a failed branch, preserve evidence, choose the documented recovery path, or escalate to the named owner.695. Draft the artefact, decision register, and evidence record together. Do not defer failure handling, rollback, security, tenancy, accessibility, or operational ownership.706. Run available checks, review every result, repair failures, and hand off only when acceptance is observable. If recovery fails or authority is exceeded, stop and escalate without mutation.7172## Quality Standards7374- Ground every section in a named project source, decision, measured result, or accountable owner.75- Give each requirement or procedure a deterministic oracle that another reviewer can reproduce.76- Keep assumptions, exclusions, degraded checks, residual risks, and waivers visible at handoff.77- Preserve the domain invariants and more specific controls in the existing workflow below; this contract does not replace them.78- Run the repository anti-AI-slop gate: remove filler, verify named standards and dependencies, and retain purposeful domain detail.7980## Anti-Patterns8182- Copying a generic template without mapping it to project sources. Fix: attach each section to an approved requirement, configuration, risk, or owner.83- Choosing a threshold because it is common practice. Fix: derive it from a requirement, measured baseline, risk decision, or current verified source.84- Reporting an inaccessible or unexecuted check as passed. Fix: mark it `not assessed`, preserve the oracle, and name the verifier.85- Mixing the neighbouring test-plan concern into this artefact without a boundary. Fix: cross-reference its output and keep ownership explicit.86- Omitting failure, rollback, empty-state, security, tenancy, or escalation behaviour. Fix: specify the trigger, safe action, verification, and owner for each applicable case.87- Mutating a repository, environment, tenant, ledger, or external system while drafting guidance. Fix: remain read-only until the exact mutation and authority are explicit.88- Claiming compliance, certification, readiness, or release from prose alone. Fix: require source-attributed evidence and a named acceptance decision.8990## Worked Example9192Given an approved project source and a conflicting implementation detail, record both with provenance, stop the affected branch, and obtain the accountable owner's decision. Then update the relevant contract, define a reproducible acceptance check, and retain its observed result. The artefact is accepted only when each evaluated behaviour has a representative dataset, deterministic scoring rule, threshold rationale, and retained run evidence.9394## References9596- [logic.prompt](logic.prompt) - load only when its template, logic, or detail is needed.97- [README.md](README.md) - load only when its template, logic, or detail is needed.98<!-- dual-compat-end -->99## Overview100101The agent-specific complement to `ai-eval-harness-spec`. Agents are evaluated on outcomes and trajectories, not single-shot generations. Eval requires (a) golden-task sets that capture the goal state, (b) replay environments that make every tool call deterministic, and (c) agent-specific metrics.102103## Core Instructions104105### Step 1: Inventory golden-task sets per feature106107For each agent FR declare a `GOLDEN-AGT-<FEATURE>-NNN` set. Each task carries:108109```yaml110id: AGT-TRG-001111feature: inbox-triage112initial_state: <world state before the run>113user_goal: <natural-language goal>114gold_trajectory: <ordered list of (tool, args, observation) tuples that a competent operator would execute>115goal_state: <world state the agent should reach>116acceptance_rubric: <how a judge decides whether goal_state was reached>117tags: [tier:pro, locale:en-US, sensitivity:low]118```119120### Step 2: Define the replay environment121122For each feature, declare a deterministic synthetic environment that responds to tool calls with canned outputs:123124- Storage: `replay-env/<feature>/<task_id>.yaml`.125- Responder: maps `(tool_name, input_args_canonical)` to a fixed output.126- Variance: zero (the environment is byte-deterministic given the same agent trajectory).127- Failure injection: parameterised — the environment can be configured to return errors, timeouts, or malicious outputs for adversarial replays.128129### Step 3: Declare the six core agent metrics with thresholds130131| Metric | Definition | Default threshold |132|--------|------------|---------------------|133| Task success rate | judge marks `goal_state` reached | >= 0.90 |134| Step efficiency | mean(actual_steps / gold_steps) on successful runs | <= 1.5 |135| Tool-choice quality | % of tool calls that match the gold tool at the gold step | >= 0.92 |136| Hallucinated-argument rate | % of tool calls with at least one fabricated argument | <= 0.01 |137| Irreversible-action-incident rate | irreversible actions that the judge marks as incorrect | 0 (zero-tolerance) |138| Intervention rate | % of runs where mid-run human intervention was required | feature-specific; declared in PRD |139140### Step 4: Define the judge-LLM rubric per metric141142- Task success: pairwise compare `goal_state` claimed by agent vs the YAML `goal_state`; rubric 3 binary criteria.143- Tool-choice quality: exact-match for `tool_name`; semantic-match for `args` via judge-LLM.144- Hallucinated argument: judge inspects each arg; flags any arg not derivable from the observation history.145146Calibration set per feature scored monthly by humans; recalibrate if drift > 5 pp.147148### Step 5: Define the CI gate149150CI gate runs on every PR touching `planner/`, `tools/`, `prompts/agent/`, or `action-catalogue/`:1511521. Task success on the affected feature's golden set not down > 2 pp.1532. Tool-choice quality not down > 1 pp.1543. Hallucinated-argument rate not up > 0.005 pp.1554. Irreversible-action-incident rate = 0.156157### Step 6: Define scheduled regression158159| Cadence | Suite | Action on drop |160|---------|-------|------------------|161| Nightly | Golden + adversarial smoke per feature | SEV3 to AI lead if any metric down > 3 pp |162| Weekly | Full agent red-team replay | SEV2 if any new HIGH finding |163| Monthly | Calibration recheck | recalibrate judge if drift > 5 pp |164| Quarterly | Full sweep | update agent model card; review with security |165166### Step 7: Operational ownership167168The agent eval rig is owned by the AI lead with a named back-up. Replay-env updates require PR with a reviewer from the back-end owner of every called system. Golden-task additions require sign-off from the AI lead and the product owner of the feature.169170### Step 8: Write the spec171172`AI_Agent_Eval_Spec.md` sections: 1) Per-feature Golden-Task Inventory, 2) Replay Environments, 3) Metrics & Thresholds, 4) Judge-LLM Rubrics, 5) CI Gate, 6) Scheduled Regression, 7) Operational Ownership, 8) Traceability.173174## Standards175176- OpenAI Evals (agents)177- Anthropic agent-eval patterns178- NIST AI RMF MEASURE179- ISO/IEC 42001 Clause 9180181## Compliance evidence cross-link182183Eval coverage is primary evidence for:184185- SOC 2 PI1.2 (processing accuracy), CC4.1 (ongoing monitoring), CC8.1 (change management).186- ISO/IEC 27001:2022 A.8.25 (secure development lifecycle), A.8.29 (security testing).187- EU AI Act Art. 15 (accuracy and robustness).188- NIST AI RMF MEASURE.189190The CI gate results, weekly regression report, and monthly calibration recheck are collected per `09-governance-compliance/25-ai-agent-evidence-pack-spec` (frequency-table rows 23, 24). Sampling: 25 PR eval results stratified across features and tiers per audit window.191192## Resources193194- `logic.prompt`, `README.md`, `references/ai-agent-eval-spec-template.md`.