All posts
AI AgentsEvaluationProduction ReadinessAgentic AI

AI Agent Evaluation: Execution Traces, Tool Calls & Production Readiness

10 min readThomas Stermole
AI agent evaluation infographic showing task, execution trace, tool call, human gate and outcome as a complete execution path evaluated for success, permissions and regressions.

An agent is not production-ready because it completes a task successfully once. What matters is whether its relevant, observable execution path can be assessed for correctness, safety, repeatability and economic viability.

The core question is:

How can a company show that an agent handles real tasks with the right tools, within defined boundaries and reliably even when things fail?

For the upstream choice between agent, workflow and automation, see AI Agent vs Workflow vs Automation. The Enterprise AI Architecture Checklist covers whether the wider architecture for data, identity, security and operations is viable.

Task success is not enough: execution quality decides

For a chat use case, a correct answer can represent much of the quality objective. An agent can also read data, call APIs, change files, send messages or initiate business processes. The same outcome can therefore be reached through very different paths.

Run A

  1. The agent reads authorised CRM data.
  2. It uses the approved pricing tool with correct parameters.
  3. It creates an offer draft.
  4. It waits for human approval before release.

Run B

  1. The agent also reads sensitive notes.
  2. It selects the wrong tool and overwrites a record.
  3. A retry triggers the same action a second time.
  4. It then produces the same offer draft.

Both runs produce the right text. Only one is an acceptable execution path. An agent can make unnecessary tool calls, use incorrect parameters, exceed permissions, compensate for an error by chance, or be materially more expensive and slower without any of that being visible in the final outcome.

The same outcome does not mean the same quality.

Task success remains necessary. For production agents, the route to the outcome must also meet its technical, business and economic contract.

The execution trace is the evaluation object

An execution trace is not a complete record of internal model reasoning, and it is not a mandate to log everything. It is the minimum, purpose-bound technical evidence needed to assess, debug and, where necessary, reproduce a run.

Depending on the use case, it can include:

  • task or request ID,
  • model, prompt and policy versions used,
  • tool selection and relevant parameters,
  • relevant tool results,
  • expected and actual state changes or side effects,
  • errors, retries, approvals and human handoffs,
  • stop condition and final outcome,
  • cost and latency for the run.

This evidence answers a central release question: Why was this task rated successful? It should remain data-minimising: record or reference content, parameters and tool results only to the extent required to diagnose, audit and reproduce the specific risk.

Agent evaluation as a release path

  1. 01

    Task

    Which business outcome, roles and boundaries apply?

    Accepted outcome defined

  2. 02

    Execution trace

    Which versions, tools, states and decisions are technically observable for this run?

    Minimum evidence available

  3. 03

    Tool and state validation

    Were selection, parameters, ordering and side effects correct?

    Execution assertions met

  4. 04

    Failure and guardrail check

    When errors or policy boundaries occur, does the agent stop, reconcile or hand off safely?

    Risky paths tested

  5. 05

    Cost and latency

    Does the correctly executed task remain within its economic and time boundary?

    Unit economics measurable

  6. 06

    Release decision

    Is sufficient evidence available for critical failure classes and actions?

    GO, MITIGATION NEEDED or BLOCKED

No single score decides: the task must be assessed reliably along its observable execution path.

What an agent test case must verify beyond the outcome

A test case does not only assess whether a useful answer appears at the end. It defines the observable contract for execution.

A. Tool selection and parameters

Check whether the agent uses the right tool, whether the call is needed at all, and whether parameters, ordering and call count fit the task. The wrong tool can create a security, cost or maintenance risk even when the final result is correct.

For IDs, amounts, recipients, tenants, read/write operations, JSON schemas or maximum call counts, deterministic assertions are often more reliable than semantic scoring.

B. State changes and side effects

An agent test case should be able to define expected and prohibited state changes:

  • Which system may be changed?
  • Which new state is expected after successful execution?
  • Which side effect would be unacceptable?
  • May the same effect occur only once?
  • Is the action reversible, or does it require compensation?

A correct piece of text does not compensate for an incorrect record, a message sent twice or an unexpected transaction.

C. Policy boundaries and human approval

For every action, it must be clear whether it is allowed autonomously, allowed only after approval or prohibited altogether. The test also checks that the agent uses the right identity and the minimum necessary permission.

Retrieval ACLs, security trimming and revocation are separate architecture concerns. RAG Permissions and Security Trimming explains how unauthorised evidence is excluded before it reaches model context.

Agent test cases as execution fixtures

A RAG golden dataset primarily evaluates retrieval and answer quality. An agent test set builds on that, but also evaluates the action path and state changes. A versioned execution fixture is therefore more useful than an input with a reference answer alone.

FieldExample: review a complaint and prepare a resolution
Task and initial stateOrder exists; refund has not been initiated
RoleSupport employee with read and draft permissions
allowed toolsCRM read, Order API read, Draft Email
prohibited toolsRefund execute
parameter boundariesonly the current customer's order; no write access
expected state transitionResolution draft created; no refund initiated
prohibited side effectsNo changes to the order or customer data
approval requirementApproval before every refund
failure and recovery expectationOrder missing: stop safely and hand off for manual review
accepted outcomeEvidence-based resolution proposal plus draft
release assertionsNo prohibited calls, correct parameters, approval gate observed

This does not retest the entire architecture. It tests the agentic execution contract for a specific task.

Failure paths: stop, reconcile or hand off

The happy path shows that an agent can do something. Production readiness shows up when a tool fails, a schema is unexpected, an external API responds too late or the next step is uncertain.

Relevant failure paths include:

  • A tool call fails or returns an unexpected response schema.
  • An external API responds too late or hits a rate limit.
  • A required step is skipped, or the agent finishes too early.
  • A loop causes excessive tool use.
  • Part of the workflow has run but its final state remains unknown.
  • A retry triggers a mutating action twice.
  • A human handoff is needed but not initiated.

An unknown execution state is not a retry signal

A timeout does not automatically mean an action did not happen. If the agent sends a mutating request and the connection drops, the receiving system may already have stored the change. Blindly retrying can create a second refund, message or data change.

A test case needs explicit expectations for:

  • idempotency or deduplication for appropriate actions,
  • status reconciliation with the target system,
  • safe escalation and human handoff when state is unclear,
  • recovery or compensation when an action can be reversed,
  • an explicit stop condition when no safe continuation exists.

A production-ready agent needs defined states after uncertainty, not only success paths.

Guardrails are only credible when their bypass has been tested

A prompt rule such as “the agent must not initiate a refund” is not a robust boundary. It describes desired behaviour. A technical boundary limits what the agent can actually do, for example through allow-lists, schemas, narrow tool scopes, permissions, action limits, human approval or egress restrictions.

A guardrail only becomes evidence when its bypass has been tested. Suitable cases include context or prompt injection, unexpected tool outputs, adversarial inputs, policy-bypass attempts and parameters outside the permitted boundary.

A guardrail is only evidence when its bypass has been tested.

This does not replace a complete security architecture. It verifies whether the boundaries claimed for this agent actually hold in its specific execution path.

Deterministic checks, LLM graders and human review

These methods assess different parts of the execution trace. None should imitate another type of control when a more direct check is available.

Deterministic assertions

Useful for tool selection, parameters within a schema, prohibited actions, expected state changes, present approvals, retry counts and stop conditions. Hard security and permission boundaries should not depend on an LLM grader when they can be checked technically.

LLM graders

Useful for semantic quality, plausibility, task completion, completeness and the appropriateness of an escalation. They assess outcome quality; they are not a substitute for technical policy enforcement.

Human review

Targeted review is needed for new failure classes, business cases with genuine ambiguity, high-risk actions, new tool combinations and calibrating graders. Human review is a defined control point, not an undefined residual process.

Regression also detects degraded execution paths

Changes to the model, prompt, system prompt, tool schema, API, retrieval, policy or workflow can degrade the execution path even when task success remains steady or improves.

A new version may require more tool calls, call tools in a riskier order, retry more often, create more human handoffs, introduce additional side effects or increase cost and tail latency.

A “better” model can be a worse agent.

Every meaningful change should therefore run against the same execution fixtures. Results should be separated by failure class: a good average must not hide regression in prohibited actions, critical state changes or recovery. The methodology for retrieval, evidence and answer quality remains in RAG Evaluation: Metrics, Golden Datasets & Regression Tests.

Cost and latency per successfully completed task

Raw token counts and average runtime do not establish whether an agent is economically viable. The relevant metrics use the correctly executed task as their denominator:

  • Cost per Successful Task,
  • Cost per Correctly Executed Task,
  • Latency per Successful Task,
  • Tail Latency, such as p95, where the process is time-critical,
  • retry and failure rate,
  • tool calls per successfully completed task.

A cheaper individual request can be economically worse if it causes more failed attempts, retries or escalations. Likewise, low average latency does not help if critical tasks regularly get stuck in high tail latency. This is not a FinOps discussion; it is part of deciding whether the agent performs its task reliably enough.

Release decision: evidence, not a composite score

Before an agent takes production actions, there should be reliable evidence for:

  • task success across real, representative tasks,
  • execution assertions for tools, parameters and ordering,
  • expected and prohibited state changes,
  • policy compliance and human approval,
  • tested failure, recovery and handoff paths,
  • regression after relevant changes,
  • cost and latency per correctly executed task.

The status model from the Enterprise AI Architecture Checklist applies here too: GO, MITIGATION NEEDED or BLOCKED. A numerical composite score does not replace this decision. A critical policy or state-change blocker cannot be offset by good outcome metrics.

Next step

If an agent or agentic workflow already exists but nobody can assess its execution path, failure states and unit economics with confidence, building more autonomy should not be the first move.

First establish realistic execution fixtures, trace assertions, tested guardrails and clear release criteria. AI Production Readiness helps assess existing systems, establish regression and evidence, and define a responsible path from pilot to production.

Next step

Sounds relevant for your company?

In a no-obligation initial call, we clarify within 30 minutes whether and where getting started is worthwhile for you — honestly and without sales pressure.

Request an initial call