agentleFS
mejbaurbaharmejbaurbahar/software-tester-skills/skills/ai-agent-evaluation/SKILL.md

ai-agent-evaluation

Skill1 starsChanged 54 days agoMITView on GitHub

Use when testing and evaluating AI agents and tool-using LLM systems — task-success and trajectory evaluation, tool-call correctness, LLM-as-judge calibration, regression datasets, non-determinism (pass@k), cost/latency budgets, and CI evals with DeepEval, promptfoo, LangSmith, Inspect or MLflow.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every production failure becomes a dataset case.

    line 58

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

AI Agent Evaluation & Testing

Agents are non-deterministic, multi-step and act on the world. Test outcomes, trajectories, policy adherence and cost with datasets, not vibes.

What to measure

LevelMetricHow
Task outcomeSuccess rateCheck the end state programmatically (DB row, file, API effect) before using a judge
TrajectorySteps, loops, redundant calls, error recoveryAssert on the recorded trace (must search before answering)
Tool useRight tool, schema-valid args, no invented toolsAssert on tool-call log
Response qualityFaithfulness, relevance, completeness, formatLLM-as-judge with rubric + human spot-check
PolicyRespects permissions, asks confirmation for irreversible actionsScenario set with must-not rules
RobustnessParaphrase, typos, other languages, long contextPerturbation suites
EfficiencyTokens, latency p95, tool calls, cost per taskBudget assertions
Consistencypass@k / pass^k over N runsRun each case 5–10×

Build the dataset

Start with 20–50 real or synthetic tasks from logs and tickets; grow to 200+. Tag by capability, difficulty and risk. Each case: input/context, expected outcome (assertion), optional reference trajectory, must-not rules. Include ambiguous asks (should it clarify?), tool failures (timeouts, 500s, empty results) and untrusted text inside tool outputs.

Tooling

# promptfoo — declarative evals in CI
prompts: [file://prompts/agent.txt]
providers: [openai:gpt-4.1, anthropic:messages:claude-sonnet-4]
tests:
  - vars: { task: "Refund order A-991" }
    assert:
      - type: javascript
        value: output.toolCalls.some(t => t.name === 'issue_refund' && t.args.orderId === 'A-991')
      - type: llm-rubric
        value: "Confirms the refund amount and timeline; mentions no other customer's data"
# DeepEval — metrics as pytest
from deepeval import assert_test
from deepeval.metrics import ToolCorrectnessMetric, TaskCompletionMetric
assert_test(test_case, [ToolCorrectnessMetric(threshold=0.9), TaskCompletionMetric(threshold=0.8)])

Also: LangSmith / Langfuse datasets and traces, UK AISI Inspect, OpenAI Evals, MLflow evaluate, Ragas (rag-evaluation-testing). Emit OpenTelemetry GenAI traces so any failure can be replayed.

Make LLM-as-judge trustworthy

Explicit scoring anchors · judge model different from the agent · randomise order in pairwise comparisons · structured output · calibrate against ~50 human labels (agreement ≥ 80%) · version judge prompts · never expose the rubric to the agent.

Test the harness, not just the model

Mock tools for deterministic unit tests (record/replay) · sandbox real tools · least-privilege tool scopes · human approval for irreversible actions · max-step, budget and timeout limits · resume after crash · concurrent tasks · context-window overflow handling.

Regression workflow

  1. Every production failure becomes a dataset case.
  2. PRs run a fast subset (~30 cases, <5 min); nightly runs the full set.
  3. Gate on success ≥ baseline − ε (statistical test over N runs), policy adherence = 100%, cost ≤ budget.
  4. Compare model/prompt versions side by side and keep an eval changelog.
  5. Online: shadow or canary rollout, user feedback, guardrail monitors.

Pitfalls

Single-run pass/fail on a stochastic system · the judge grading its own output · test set leaked into the prompt · optimising to the eval · happy-path-only tasks · ignoring cost/latency · unlogged seeds and versions.

Related

llm-testing, rag-evaluation-testing, mcp-testing, chatbot-voice-agent-testing, llm-security-audit

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.