AI AgentsAI Agent Execution & Lifecycle

How do you evaluate observable outcomes in AI agents?

Question 272 of 280 · Updated

On this page

Evaluating observable outcomes means checking what measurably changed in the world after an agent ran, whether that change satisfied the user's goal, and whether it remained correct and safe. A fluent final response, a successful tool call, a completed workflow, or an agent's own claim that it succeeded is not enough. The outcome must be established using evidence from the system that owns the result.

For an agent that resolves a support request, the outcome may be a correctly updated order or an authorized refund—not a message saying “refund processed.” For a coding agent, it may be a merged, tested change that satisfies acceptance criteria—not merely a patch or passing unit test. For a research agent, it may be a decision-ready report whose material claims are supported—not simply a long answer.

The practical principle is: define the outcome before execution, collect independent evidence after execution, measure the result at the right time horizon, and feed verified failures back into evaluation datasets.

1. Separate activity, output, and outcome#

These are related but different layers:

  • Activity: what the agent did—model calls, tool calls, retries, searches, handoffs, and elapsed time.
  • Output: what the agent produced—a response, file, plan, recommendation, or proposed action.
  • Outcome: what actually happened and whether it achieved the user's intended result under the applicable constraints.

Example: a travel agent calls a booking API and receives HTTP 202. That is evidence that a request was accepted for processing, not proof that a reservation exists. The outcome is established only after checking the booking provider's authoritative reservation record and confirming the requested dates, passengers, price, and status.

A useful outcome record therefore connects the original request to:

  1. The user's intended result and constraints.
  2. The action or artifact the agent produced.
  3. The external system's observed state after execution.
  4. Independent validation against the acceptance criteria.
  5. Any later reversal, correction, complaint, or downstream consequence.

Do not collapse these layers into one generic “success” field.

2. Define an outcome contract before running the agent#

An outcome contract makes success observable and prevents teams from changing the definition after seeing results.

For each task type, specify:

  • Goal: what the user wants to be true at the end.
  • Required conditions: facts that must hold for success.
  • Forbidden conditions: actions or side effects that must never occur.
  • Evidence source: which system or reviewer can prove each condition.
  • Verification time: when the evidence is expected to become available.
  • Partial states: what counts as partial, blocked, pending, or failed.
  • Owner and version: who defined the contract and which version was used.

For example, “resolve a refund request” is too vague. A better contract could say:

  • The order belongs to the authenticated customer.
  • The refund amount does not exceed the eligible amount.
  • The refund follows the current policy and required approval rules.
  • The payment provider records a completed refund for the correct transaction.
  • The customer receives an accurate confirmation.
  • No duplicate refund is created.

The agent may complete some conditions before others. Record them separately rather than marking the whole request successful too early.

3. Choose authoritative evidence for each outcome#

The agent's own response is not an independent source of truth. Prefer evidence from the system that owns the state:

  • Payments: provider transaction or refund ledger, settlement status, and reconciliation record.
  • CRM/support: persisted ticket state, customer account, and audit history.
  • Code changes: repository commit, CI result, deployment health, and acceptance tests.
  • Data workflows: output artifact, schema/quality checks, row counts, and lineage.
  • Research: source documents, claim-level citations, reviewer decisions, and factual checks.
  • Scheduling or booking: confirmed reservation identifier and provider-side status.

Capture evidence references, not just a boolean. A useful record includes source system, resource ID, observed state, timestamp, version or revision, validation result, and a hash or immutable artifact reference where appropriate.

Evidence should be independent of the agent's unverified assertion. If the agent writes “refund succeeded” into its own task record, that is a claim. A read-back from the payment provider is stronger evidence.

When an external system is eventually consistent, distinguish “submitted,” “accepted,” “processing,” and “completed.” Set a verification deadline and a retry/reconciliation policy. A pending outcome is not a success or failure until the defined condition is met.

4. Beginner-friendly numerical production example#

Consider a customer-support agent that handles refund requests. Over one week it receives 500 eligible requests.

The team defines success as: correct customer and order, policy-compliant amount, no duplicate refund, provider-confirmed completion, and accurate customer communication.

After the initial verification window:

  • 500 requests entered the evaluation cohort.
  • 440 received a provider-confirmed refund or a correctly justified no-refund resolution.
  • 20 had an incorrect amount or policy decision.
  • 15 were still pending at the verification deadline.
  • 25 failed, timed out, or had insufficient evidence.

The strict verified-outcome success rate is:

LaTeX

The remaining 60 requests must not be silently removed from the denominator. Their statuses explain why they did not count as verified success.

Now inspect the 440 initially successful cases after seven days. The payment ledger reveals that 12 refunds were reversed or failed settlement, and 8 customer confirmations contained incorrect details. If the success contract requires both durable payment status and correct communication, and these 20 cases are distinct, durable verified successes become:

440 - 12 - 8 = 420

The seven-day durable outcome rate is:

LaTeX

The difference between 88% initially verified and 84% durable success is important. An agent can appear successful at the end of its run while downstream systems later reverse or invalidate the result.

Also measure safety separately. Suppose 2 of the 500 requests involved an unauthorized refund attempt that was blocked before payment. The blocked unsafe-attempt rate is:

LaTeX

Do not count a blocked attempt as a completed harmful refund, but do record it as a safety failure signal. A system can have a high outcome-success rate and still need urgent safety remediation.

5. Build an outcome measurement model#

A practical measurement model has several layers.

A. Goal attainment#

Measure whether the required user-facing result was achieved.

  • Verified task success rate.
  • Partial completion rate.
  • Unresolved or pending rate at the defined deadline.
  • Reopen, correction, reversal, or repeat-contact rate.
  • User acceptance where explicit acceptance is meaningful.

Define the denominator as all eligible requests accepted into the cohort. State exclusions before measurement and report excluded counts. Do not remove timeouts, difficult tasks, or low-confidence cases merely because they lower the score.

B. Correctness and constraint compliance#

A task may appear complete while violating an important condition.

Measure:

  • Correctness of the final state.
  • Compliance with user constraints and business policy.
  • Required-field and artifact completeness.
  • Unsupported claims or incorrect customer communication.
  • Unauthorized or out-of-scope actions.
  • Duplicate or unintended side effects.

Some conditions are hard gates. For example, an unauthorized payment must not be averaged away by several correct low-risk answers. Report critical safety violations separately and define release-blocking thresholds.

C. Evidence quality#

A result cannot be trusted if the system cannot prove it.

Track:

  • Evidence completeness: outcomes with all required evidence / eligible outcomes.
  • Evidence freshness: evidence observed within its allowed age.
  • Provenance validity: evidence came from an approved source.
  • Reconciliation rate: agent-reported result matches authoritative system state.
  • Unknown-state rate: outcomes that cannot yet be confirmed.

“Unknown” is a valid operational state. Do not convert missing telemetry into success or assume that an absent error means the action worked.

D. Durability and downstream impact#

Some outcomes are only meaningful after time passes.

Examples:

  • A payment remains settled after reconciliation.
  • A deployed change remains healthy during a defined observation window.
  • A generated data pipeline produces valid downstream records.
  • A support issue is not reopened within seven days.
  • A recommendation does not create a later policy or compliance incident.

Choose the observation window based on the task. Report initial completion and durable outcome separately, and disclose cases whose observation window has not elapsed.

E. Efficiency and user impact#

Measure efficiency only alongside quality and safety:

  • End-to-end time to verified outcome.
  • Cost per verified successful outcome.
  • Human correction and escalation effort.
  • Number of user follow-up messages or repeated requests.
  • Tool calls, retries, and unnecessary work.
  • User satisfaction or acceptance, with response rate and sampling bias disclosed.

A lower token cost is not an improvement if the agent skips verification and creates more downstream rework.

6. Instrument the full outcome lifecycle#

Create a durable outcome record keyed by a stable task or workflow ID. Link every trace, tool operation, artifact, and external resource to that ID.

A useful event sequence is:

  1. Request accepted: persist the task ID, tenant, task type, and outcome-contract version.
  2. Execution started: record agent/model/prompt/tool versions and relevant environment metadata.
  3. Action proposed: capture structured action intent, arguments, policy checks, and approval state.
  4. Action executed: record the external operation ID and idempotency key.
  5. Tool response received: store the response status, but do not treat it as the final outcome.
  6. Authoritative state checked: read the owning system and compare actual state with the requested result.
  7. Outcome graded: evaluate each required condition and classify the task.
  8. Delayed verification: recheck durability or downstream consequences at the specified horizon.
  9. Outcome closed: mark verified success, partial, failed, unsafe, pending, or unknown with evidence references.

Keep event time and observation time separate. A refund may have been submitted at 10:00 but confirmed at 10:04. This distinction matters for latency and for reconstructing incidents.

Use stable IDs and idempotency keys so retries do not create duplicate actions or inflate the denominator. Keep PII and secrets out of general-purpose traces; store sensitive evidence in appropriately controlled systems and reference it by protected identifiers.

7. Use the right evaluator for each condition#

No single grader is reliable for every outcome.

  • Deterministic code checks: best for exact amounts, status fields, schema validity, permissions, record counts, required fields, and state comparisons.
  • Domain rules: best for business-policy compliance, eligibility, limits, and required workflow conditions.
  • LLM-as-judge: useful for nuanced language quality, completeness, relevance, or rubric-based review when exact rules are not practical.
  • Human review: important for high-impact decisions, ambiguous cases, calibration, and judging whether the rubric itself is fair.
  • User feedback: useful for satisfaction and perceived usefulness, but not a substitute for independent verification of a financial or safety-critical side effect.

Use deterministic checks wherever the result is objectively testable. For subjective graders, define a rubric, compare judge decisions with expert labels, measure disagreement, and recalibrate when the model or prompt changes. A judge model can be wrong, biased, or overly generous. Never let the same agent's self-assessment be the only proof of success.

For trajectories, score whether the actions were appropriate and within scope. Do not require one exact tool sequence when multiple safe paths can reach the same valid outcome. Exact trajectory matching is useful for strict invariants, such as “verify identity before issuing a refund”; it is too brittle as a universal success definition.

8. Offline, online, and delayed evaluation#

A mature evaluation program combines three loops.

Offline evaluation before release

  • Build a representative dataset from real tasks, including edge cases and known failures.
  • Include tasks where the correct action is to refuse, ask a question, or do nothing.
  • Run multiple trials for stochastic agents.
  • Compare versions using the same outcome contract and evidence rules.
  • Gate releases on quality and safety, not just average judge scores.

Online evaluation in production

  • Sample real traces and connect them to actual external outcomes.
  • Score deterministic checks continuously where feasible.
  • Use asynchronous evaluators for expensive or subjective review.
  • Monitor changes by task type, tenant, model, prompt, tool version, and risk category.
  • Alert on critical violations and statistically meaningful deterioration.

Delayed evaluation

  • Revisit cases after settlement, deployment observation, customer follow-up, or another task-specific period.
  • Update provisional outcomes when authoritative evidence arrives.
  • Preserve the original observation and the later correction for auditability.
  • Do not rewrite history so the initial dashboard appears more accurate than it was.

A failure discovered in production should become a labeled test case, with privacy-safe inputs and the expected outcome contract, so the same defect can be caught before the next release.

9. Avoid misleading metrics and attribution errors#

A metric can be mathematically correct but operationally misleading.

  • Survivorship bias: measuring only completed runs hides failures and timeouts. Include all eligible accepted requests.
  • Denominator drift: changing eligibility rules between releases makes success rates incomparable. Version the cohort definition.
  • Proxy optimization: optimizing tool-call success or answer length can improve a proxy while real outcomes get worse.
  • Premature measurement: scoring immediately after a request is submitted misses eventual failures and reversals.
  • Double counting: retries and multiple spans must not become multiple user tasks.
  • Selection bias: human reviewers may see only difficult cases or only cases the agent escalated. Report the sampling method.
  • Judge drift: changing judge models, prompts, or rubrics can change scores without any change in agent behavior.
  • Confounding: an improvement after a model update may actually be caused by a policy change, provider recovery, or a different task mix.

For causal claims, use a controlled comparison where practical: randomize eligible traffic between versions, preserve the same outcome definition, compare comparable cohorts, and check for safety regressions. If the rollout is not randomized, describe the result as an observed association rather than claiming the agent caused the improvement.

10. Production failure scenarios and prevention#

Scenario 1: The tool returned success, but the outcome did not happen. A payment API returns HTTP 200 with an accepted request, but the payment later fails settlement.

  • Prevention: distinguish accepted, processing, and completed states; read the authoritative ledger; reconcile after the provider's settlement window.
  • Monitoring: accepted-to-settled conversion, unresolved status age, and reversal rate.

Scenario 2: The agent reports success without evidence. A support agent says it updated the customer's address, but the CRM write was rejected.

  • Prevention: require a read-after-write check and record the CRM resource version. The final response must be generated from verified state.
  • Monitoring: agent-claimed success versus externally verified success mismatch.

Scenario 3: The aggregate success rate hides a dangerous subgroup. Overall success is 96%, but high-value refunds have a 3% policy-violation rate.

  • Prevention: segment by risk, action type, customer cohort, and environment. Use hard safety gates for critical categories.
  • Monitoring: subgroup confidence intervals, policy violations, and high-severity incident counts.

Scenario 4: Delayed outcomes reverse the initial result. A deployment passes immediate health checks but causes elevated errors 30 minutes later.

  • Prevention: define task-specific observation windows and staged rollout checks. Keep the outcome provisional until the required window closes.
  • Monitoring: post-deployment error rate, rollback rate, and delayed incident rate.

Scenario 5: Retries inflate success or create duplicate side effects. A timed-out refund call is retried even though the provider completed the first request.

  • Prevention: use an idempotency key per intended business action, query the provider by operation ID, and reconcile before retrying.
  • Monitoring: duplicate-operation conflicts, repeated action IDs, and reconciliation mismatches.

Scenario 6: The evaluator rewards the wrong behavior. An LLM judge prefers confident, concise answers and gives high scores to unsupported claims.

  • Prevention: add evidence-grounded criteria, deterministic checks, expert-labeled calibration cases, and periodic blind audits.
  • Monitoring: judge-human disagreement, false-pass rate, and score changes after judge upgrades.

Scenario 7: Missing telemetry is treated as success. A logging outage leaves no outcome record, but the dashboard counts the run as completed because the worker exited normally.

  • Prevention: use explicit unknown states, reconcile from the source system, and keep workflow completion separate from business outcome completion.
  • Monitoring: telemetry completeness, orphaned workflow IDs, and unknown-outcome rate.

11. A practical evaluation and release workflow#

  1. Define the user outcome and non-negotiable constraints for each task family.
  2. Map every condition to an authoritative evidence source and verification time.
  3. Create a versioned dataset containing normal, edge, adversarial, and no-action cases.
  4. Instrument traces and external actions with stable IDs and protected evidence references.
  5. Run offline trials and grade outcomes with deterministic checks, domain rules, calibrated judges, and human review.
  6. Compare versions on outcome quality, safety, durability, cost, and time to verified completion.
  7. Release gradually with online outcome sampling and hard stop conditions.
  8. Recheck delayed outcomes and reconcile provisional statuses.
  9. Turn verified failures into regression cases and update the outcome contract only through a reviewed, versioned change.

A release decision should not be based on one blended score alone. Require minimum thresholds for critical safety and correctness dimensions, then compare efficiency among versions that meet those gates.

  • Q80, evaluating whether agent memory is useful: measures whether memory improves decisions and task performance. This lesson evaluates the agent's actual end-to-end task outcome, regardless of whether memory was involved.
  • Q203, measuring multi-agent system performance: covers broad workflow performance, including quality, latency, cost, and throughput. This lesson focuses on defining and proving the real-world outcome, including authoritative evidence and delayed durability.
  • Q206, evaluating collaboration quality: measures handoffs and contributions between agents. Good collaboration does not by itself prove that the user received the intended result.
  • Q210, SLIs, SLOs, and SLAs: defines service-level reliability targets. Outcome evaluation supplies the task-level evidence and classifications that can feed those service indicators.
  • Q267, validated agent loops: checks actions, observations, and completion criteria during execution. This lesson adds the outcome measurement system across the full lifecycle and after the run ends.
  • Q271, inspecting and steering paused agents: covers operator intervention while execution is paused. This lesson measures whether the completed or partially completed work actually achieved its intended result.

In short: evaluate the world state, not the agent's confidence. Define success in advance, verify it through authoritative evidence, keep partial and unknown outcomes visible, measure durability over the right time horizon, and use every verified failure to improve the next evaluation cycle.

Related questions

Explore other topics:Large Language ModelsRetrieval-Augmented GenerationMLOps