Polyaxon v3 is coming →

How to evaluate AI agents

A practical framework for evaluating AI agent outcomes, trajectories, tool use, safety, latency, and cost before and after release.

May 21, 2026by Polyaxon

AI Agent Evaluation Framework

Evaluating an AI agent requires more than grading its final answer. An agent can produce a plausible response after calling the wrong tool, using stale context, repeating an expensive loop, or attempting an action it was not authorized to take. It can also follow a reasonable path and fail because an external tool was unavailable.

A useful evaluation process examines both the outcome and the trajectory that produced it. It combines task-specific success criteria with evidence about decisions, tool calls, retrieved context, safety, latency, and cost.

What is AI agent evaluation?

AI agent evaluation is the systematic process of measuring whether an agent completes a task correctly, safely, and efficiently across representative scenarios.

An agent evaluation can ask:

  • Did the agent achieve the user's goal?
  • Did it select the right tools and supply valid arguments?
  • Was the sequence of actions reasonable for the task?
  • Did it use relevant and permitted context?
  • Did it respect authorization, privacy, and policy constraints?
  • How much time, model usage, and external-tool activity did completion require?
  • Did it recognize uncertainty, recover from failure, or escalate appropriately?

These questions turn an open-ended interaction into a set of observable behaviors. The objective is not to require one exact reasoning path. It is to identify acceptable outcomes, unacceptable actions, and operating boundaries that can be tested consistently.

Why agent evaluation is different from LLM evaluation

An LLM evaluation usually focuses on a model response: Is it correct, relevant, grounded, well-written, or safe? An agent evaluation includes those properties but must also assess actions and state across a workflow.

LLM response evaluationAI agent evaluation
Usually evaluates one input and outputEvaluates a multi-step task or session
Focuses on response qualityCovers outcomes, decisions, tools, state, and response quality
Often has a bounded contextContext can change after retrieval, tools, memory, or handoffs
Cost and latency are measured per callCost and latency accumulate across the complete trajectory
A failure is often in the responseA failure may originate in planning, permissions, a tool, state, or recovery logic

Agent systems also have more than one source of nondeterminism. The model may choose a different plan, a search tool may return different results, an external service may be slow, and a downstream agent may interpret the handoff differently. Evaluation must preserve enough context to separate these causes.

The dimensions of a useful agent evaluation

Avoid compressing agent quality into one score too early. Start with distinct dimensions that correspond to decisions the team can make.

Task success

Task success measures whether the requested outcome was achieved. The definition must be specific to the application.

For a research agent, success might require an accurate synthesis with valid citations. For a support agent, it might require resolving the issue or routing it to the correct queue. For an operations agent, it might require changing the intended resource and verifying the new state.

Use deterministic verification when the environment exposes an objective result. If an agent is asked to create a ticket, check whether the ticket exists with the correct fields rather than judging only the confirmation message.

Response quality

When the final response matters, assess the properties users care about: correctness, relevance, completeness, clarity, groundedness, tone, and citation quality. The rubric should define each property and show examples of strong and weak performance.

Trajectory quality

The trajectory is the sequence of decisions and actions between the request and the outcome. Evaluation can check whether the agent:

  • Chose a valid plan for the task.
  • Avoided unnecessary or repeated steps.
  • Recovered appropriately from a tool error.
  • Stopped when the goal was complete.
  • Requested clarification when required information was missing.
  • Escalated when the task exceeded its authority or capability.

Do not require an exact path unless the path itself is a policy or safety requirement. Several trajectories may be equally valid.

Tool selection and arguments

Check whether the agent selected the correct tool, called it at the correct time, and supplied complete, valid, and authorized arguments. Separate these checks because they point to different fixes.

For example, an agent may correctly decide to update a customer record but put the new value in the wrong field. Tool selection passed; argument construction failed.

Retrieval and context use

For agents that search or retrieve information, evaluate whether the selected context was relevant, current, sufficient, and permitted. Then evaluate whether the agent used that context faithfully.

This separation matters. A false answer can result from poor retrieval even when the model accurately summarizes the supplied material.

Safety and policy compliance

Safety checks should focus on prohibited outcomes and actions, not only undesirable wording. Test authorization boundaries, sensitive-data handling, prompt injection, tool permissions, financial or operational limits, and escalation rules.

Critical safety checks are usually release guardrails rather than dimensions to average into a general quality score. Excellent writing should not compensate for an unauthorized action.

Efficiency and reliability

Measure the resources required to achieve the outcome:

  • End-to-end latency.
  • Model calls and input/output tokens.
  • Tool calls, retries, and failure rates.
  • Retrieval volume.
  • Cost per task or successful task.
  • Loop length and completion rate.

Efficiency should be interpreted with quality. Fewer steps are not better if the task fails, and a more expensive trajectory may be justified for a high-risk case.

User and business outcomes

Where possible, connect agent behavior to real outcomes such as resolution rate, human escalation, correction rate, time saved, conversion, or user satisfaction. These signals are often delayed or noisy, but they prevent a team from optimizing technical proxies that do not improve the product.

Build a representative evaluation dataset

The quality of an evaluation depends on the cases it contains. A random collection of easy examples can create false confidence.

Start by mapping the agent's tasks and risks. Divide them into meaningful groups, such as task type, user segment, language, tool, permission level, and consequence of failure. Include:

  • Common, high-volume requests.
  • Important but infrequent tasks.
  • Ambiguous and incomplete requests.
  • Tool timeouts, malformed results, and partial failures.
  • Requests that require clarification or escalation.
  • Safety, privacy, and authorization boundaries.
  • Known production failures and previously fixed regressions.
  • Long sessions and context-window pressure.
  • Adversarial instructions and prompt-injection attempts.

Every case should include the input, environment or initial state, expected outcome, relevant constraints, and evaluation rubric. If tools change external state, use a controlled test environment or a simulator that can be reset.

Version the dataset. Record why a case was added, which application versions were evaluated against it, and whether its expected behavior changed. This makes evaluation results reproducible and prevents silent edits from invalidating comparisons.

Choose the right evaluation methods

Agent evaluations usually combine several methods.

Deterministic checks

Use code or rules when a property has an objective answer. Examples include schema validation, expected tool selection, allowed action sequences, record state, citation existence, latency limits, and maximum cost.

Deterministic checks are fast, inexpensive, and easy to interpret. They should cover every critical invariant that can be expressed reliably.

Reference-based metrics

When a reference answer or state exists, compare the result with it. Exact matching works for structured values, while semantic or retrieval metrics can help with open-text fields. Avoid using lexical similarity as a substitute for factual or task-level correctness.

Model-based evaluators

An LLM-as-a-judge can assess nuanced properties such as relevance, clarity, groundedness, or whether a trajectory was reasonable. Give the evaluator a clear rubric, the minimum necessary evidence, and an output schema that includes the rating and reason.

Model-based evaluation is scalable but not automatically objective. Calibrate judges against examples rated by knowledgeable humans. Test agreement by task and segment, watch for position and verbosity bias, and version the judge model and prompt like any other production dependency.

Human review

Human review is essential for ambiguous criteria, high-risk decisions, novel failure modes, and calibrating automated evaluators. Use structured labels and rubrics so reviewers produce evidence that can improve the automated suite.

Reviewing every interaction rarely scales. Prioritize low-confidence cases, evaluator disagreements, new task types, policy-sensitive actions, and representative samples from important segments.

Simulation

Agents often interact with users, tools, or other agents. Simulations can test multi-turn behavior and failure recovery before production. A simulator can provide incomplete information, reject an action, time out, change state, or attempt to redirect the agent.

Keep simulations realistic and inspect whether success in the simulated environment transfers to production. A simulator that is too predictable can teach the agent or evaluator the wrong shortcuts.

A step-by-step agent evaluation workflow

1. Define acceptable behavior

Write the task outcome, constraints, and unacceptable actions before selecting metrics. If stakeholders disagree about what success means, a larger test suite will not resolve the problem.

2. Instrument the trajectory

Capture the request, session, model calls, retrieved context, tool inputs and outputs, state changes, errors, retries, handoffs, and final outcome. Apply redaction and access controls to sensitive fields.

Without a trace, evaluators can grade the final response but cannot reliably attribute a failure to planning, retrieval, a tool, or state management.

3. Create a small, high-quality seed set

Begin with cases that represent the main tasks and highest risks. Write explicit expected outcomes and rubrics, and have domain experts resolve ambiguous labels. A carefully reviewed seed set is more useful than a large, weakly labeled benchmark.

4. Combine evaluators by dimension

Use deterministic checks for invariants, model-based evaluators for semantic qualities, and humans for calibration and edge cases. Keep the individual results available even if the release process also uses an aggregate score.

5. Establish a baseline

Evaluate the current application version and inspect failures, not only averages. Break results down by task, tool, language, risk level, and other important segments. Record latency and cost alongside quality.

6. Compare changes and gate releases

Run the same versioned suite for every meaningful change to the model, prompt, retrieval layer, tool, or orchestration logic. Define hard safety requirements and acceptable regression budgets. Require human approval for high-impact changes where needed.

7. Evaluate in production

Apply lightweight or sampled evaluators to production traces, combine them with explicit and implicit user feedback, and monitor task outcomes. Online evaluation can reveal new behavior, but it does not replace pre-release testing.

8. Turn failures into regression cases

Review production failures, remove or protect sensitive data, assign a failure category, define the expected behavior, and add the case to the offline dataset. This makes the evaluation suite a living record of what the team has learned.

Example: evaluating a refund-support agent

Suppose an agent can answer questions, look up an order, determine refund eligibility, issue refunds below a limit, and escalate other cases.

A test case contains a customer request, order state, refund policy, account permissions, and simulated tools. The evaluation checks:

StageEvaluation
UnderstandCorrectly identifies the order and refund request; asks for missing information
RetrieveLoads the applicable policy and current order state
DecideApplies the correct eligibility rule and refund limit
ActSelects the refund or escalation tool with valid arguments
VerifyConfirms the resulting order and payment state
RespondClearly explains the outcome without exposing sensitive information
OperateCompletes within latency and cost budgets without unnecessary retries

An exact action sequence is unnecessary if several safe paths can reach the same verified state. However, issuing a refund without checking eligibility is a trajectory failure even if the final state happens to be acceptable.

The test suite should also cover unavailable order services, duplicate requests, conflicting policy documents, prompt injection in a support attachment, refunds above the authorized amount, and a user who changes the request mid-conversation.

Common agent evaluation mistakes

Grading only the final message

The final response can hide unsafe or wasteful behavior. Evaluate the state change and the trajectory when the agent can take actions.

Requiring one exact trajectory

Overly rigid path matching penalizes valid behavior and can encourage brittle agents. Specify required and prohibited actions while allowing alternative safe paths where appropriate.

Using an uncalibrated judge as ground truth

Model-based evaluators can be inconsistent and biased. Compare them with human judgments, track disagreement, and retest them when the model or rubric changes.

Reporting only an average score

A high average can conceal severe failures in a small but important segment. Report safety requirements separately and segment results by task and risk.

Testing against static tools

Happy-path mocks do not expose recovery behavior. Include timeouts, partial results, schema changes, permission errors, and ambiguous tool responses.

Separating evaluation from production evidence

A benchmark that never absorbs real failures becomes less relevant over time. Create a repeatable process for sampling, reviewing, labeling, and promoting production cases.

Polyaxon and the agent-evaluation roadmap

Polyaxon's current experiment-tracking and orchestration capabilities can provide the versioned runs, artifacts, metadata, automation, and infrastructure context needed to make evaluation workflows repeatable. The AI agent lifecycle guide describes how development, evaluation, deployment, and improvement fit into one operational loop.

Full agent evaluation and monitoring are active areas on the Polyaxon roadmap, alongside OpenTelemetry-compatible LLM and agent observability, prompt management, an AI gateway, and an agent sandbox for inspecting step-by-step execution and state.

The direction is to connect evaluation evidence with the exact application version and its production traces, so teams can diagnose a failure, reproduce it, test a fix, and measure the result in one lifecycle.

Evaluate the outcome and the path

A trustworthy agent is not one that produces a convincing final message in a demo. It is one whose outcomes, actions, constraints, and operating costs have been tested across the situations it will encounter.

Start with explicit success criteria, preserve the complete trajectory, combine evaluation methods, and keep the dataset connected to production evidence. That approach makes agent quality measurable without pretending that one score can describe every behavior that matters.