Skip to main content
AI Agent Assurance

AI Agent Testing: Why Response Quality Is Not Enough for Production Assurance

An AI agent can produce a good answer and still fail the customer's journey. Learn how to test outcomes, orchestration, tools, deterministic contracts, security, and evidence as one assurance system.

Shyena Engineering

SYSTEM VIEWAI agent testing as a systems problem
AI agent testing as a systems problemAI AGENTsystem under assuranceGOALuser outcomeORCHESTRATIONroute · intent · handoffTOOLSactions · side effectsSECURITYboundaries · abuseDETERMINISTICcontracts · factsGENERATED ANSWERSquality · groundingEVIDENCEtrace · outcome · proofMULTIPLE SIGNALS → ONE EVIDENCE CHAIN → RELEASE VERDICT

A good AI response is not proof that an agent worked. Production assurance must connect business outcome, agent execution, orchestration, deterministic contracts, generated-answer quality, security, and execution evidence into one release decision.

An AI agent can give the customer a convincing answer and still fail the task.

That sounds obvious until the test report says PASS.

Consider a simple customer journey: a user asks an agent to change the delivery address for a parcel. The agent responds correctly, uses the right terminology, and remains helpful across several turns. A response-quality evaluator gives the conversation a high score.

But the trace tells a different story:

CUSTOMER GOAL
Change delivery address
        |
        v
AGENT RESPONSE
"I can help you change the delivery address."
        |
        +--> Semantic quality: PASS
        +--> Conversation quality: PASS
        |
        v
ORCHESTRATION TRACE
Intent: parcel_information
Expected: address_change
        |
        v
TOOL EXECUTION
No address-change operation
        |
        v
BUSINESS OUTCOME
Address unchanged
        |
        v
ASSURANCE VERDICT
FAIL

The response was good. The agent failed.

That distinction is the starting point for production-grade AI agent testing.

The LLM is only one part of the system

SYSTEM VIEWAI agent testing as a systems problem
AI agent testing as a systems problemAI AGENTsystem under assuranceGOALuser outcomeORCHESTRATIONroute · intent · handoffTOOLSactions · side effectsSECURITYboundaries · abuseDETERMINISTICcontracts · factsGENERATED ANSWERSquality · groundingEVIDENCEtrace · outcome · proofMULTIPLE SIGNALS → ONE EVIDENCE CHAIN → RELEASE VERDICT
The model is one component inside the assurance surface.

An agent is not the model alone. The model may decide what to do, but other components determine what actually happens.

A production agent can include:

  • an LLM that interprets the user's request and generates responses;
  • an orchestrator that selects intents, routes, handoffs, and next actions;
  • tools that call APIs or change state;
  • retrieval that supplies documents or customer context;
  • deterministic services that enforce identifiers, policies, calculations, and business rules;
  • security controls that constrain access and tool use;
  • observability that records the execution path.

The customer experiences the combination.

So the test must evaluate the combination too.

                    USER GOAL
                        |
                        v
                 +-------------+
                 | ORCHESTRATOR|
                 +------+------+ 
                        |
              +---------+---------+
              |                   |
              v                   v
           LLM / RAG           TOOLS / APIs
              |                   |
              +---------+---------+
                        |
                        v
                CUSTOMER OUTCOME
                        |
                        v
                     EVIDENCE

The important question is therefore not simply:

Was the answer good?

It is:

Did the agent achieve the intended outcome, through an acceptable execution path, with correct side effects and enough evidence to support the verdict?

Why a good response can hide a failed journey

Traditional chatbot testing often evaluates the visible response. That works reasonably well when the system's contract is mostly conversational.

Agents introduce more state and more ways to fail.

A response can be semantically correct while:

  • the wrong intent was selected;
  • the wrong handoff occurred;
  • a required tool was never called;
  • a tool was called with the wrong identifier;
  • a backend operation failed but the agent continued as if it succeeded;
  • retrieved information came from the wrong source;
  • an authorization boundary was bypassed;
  • the conversation ended before the customer's goal was completed.

These are not all language-quality failures. Some are execution failures.

That is why a single LLM judge cannot be the assurance mechanism for the whole system.

Six contracts need to agree

ASSURANCE CONTRACTSSix contracts must agree before release
Six contracts must agree before releaseASSURANCErelease decisionGOALoutcomeORCHESTRATIONroutingDETERMINISTICfactsANSWERqualitySECURITYboundariesINTEGRITYcomplete + provableGOAL · ROUTE · FACTS · ANSWER · SECURITY · INTEGRITY → VERDICT
The six assurance contracts separate what must be true.

A useful way to reason about agent assurance is to separate the properties that must hold at runtime.

1. Goal completion

Did the customer's intended task actually finish?

For an address-change journey, that means more than receiving a confirmation sentence. The authoritative system must show that the address changed according to the permitted business process.

2. Orchestration correctness

Did the agent follow the expected execution path?

The relevant evidence may include intent, route, handoff, node, tool, and termination events.

For example:

Expected:
Customer request
  -> Address-change intent
  -> Identity check
  -> Address-change tool
  -> Confirmation

Observed:
Customer request
  -> Parcel-information intent
  -> FAQ response
  -> Conversation ends

A fluent response does not make the second path correct.

3. Deterministic correctness

Some properties should not be judged by another language model.

Identifiers, account states, policy values, dates, amounts, authorization results, API responses, and required fields should be asserted deterministically wherever an authoritative value exists.

If the expected parcel identifier is 3SABC123456789, a semantic judge saying that another identifier is "similar" is not acceptable evidence.

4. Generated-answer quality

Language quality still matters.

The generated response can be evaluated for grounding, relevance, completeness, coherence, tone, and other criteria that genuinely require judgment.

But this is one evidence stream, not the entire verdict.

5. Security

An agent that can retrieve information, call tools, or change state has an attack surface beyond normal conversational quality.

Assurance needs evidence for conditions such as:

  • prompt injection resistance;
  • authorization boundaries;
  • unsafe tool invocation;
  • sensitive-data exposure;
  • instruction-conflict handling;
  • attempts to manipulate the agent into bypassing controls.

A security failure should remain visible as a security failure. Hiding it inside an average quality score weakens the release decision.

6. Execution integrity

Finally, can the team prove what happened?

A release decision should be traceable to the conversation, execution trace, assertions, evaluation results, security observations, and test version that produced it.

Without that chain, a score is difficult to audit and difficult to trust.

The test case should describe intent, not a transcript

TRAJECTORY VIEWOne goal can have multiple valid trajectories
One goal can have multiple valid trajectoriesPERSONAsame intentPATH Avalid routePATH Bvalid routePATH Cvalid routePATH Dvalid routeGOALsame outcomeTEST THE GOAL AND ACCEPTABLE TRAJECTORIES — NOT ONE SCRIPT
Goal-driven tests allow valid runtime variation.

A fixed transcript is often the wrong abstraction for an agentic journey.

The test should define the contract of the journey:

goal: Change the delivery address
persona: Customer who owns the parcel
allowed_path:
  - identity verification
  - address change
required_tools:
  - verify_customer
  - change_address
deterministic_assertions:
  - identity_verified == true
  - address_updated == true
semantic_criteria:
  - response is clear
  - response accurately explains the result
termination:
  - customer goal completed

The simulated user can then react to the actual agent responses rather than replaying a predetermined script.

This gives the test room to detect unexpected behaviour while preserving hard contracts where the system must be exact.

The distinction matters:

Transcript testing asks:

Did the agent say what we expected?

Journey testing asks:

Did the agent achieve what the customer needed, under the rules we defined?

Evidence is more important than the score

EVIDENCE CHAINEvidence turns execution into a defensible verdict
Evidence turns execution into a defensible verdictTEST INTENTwhat must be trueLIVE RUNactual behaviourCONVERSATIONturn evidenceTRACE / TOOLSexecution evidenceEVALUATIONclaims + checksVERDICTrelease / review / blockINTENT → LIVE EVIDENCE → EVALUATION → DEFENSIBLE RELEASE DECISION
The verdict must be reconstructable from evidence.

A useful assurance result should let an engineer work backwards from the verdict.

For one journey, the evidence might look like this:

Assurance layerResultEvidence
Goal completionFAILAddress remained unchanged
OrchestrationFAILWrong intent selected
Deterministic contractFAILRequired tool not executed
Semantic qualityPASSResponse was relevant and clear
SecurityPASSNo boundary violation observed
Execution integrityPASSTrace captured completely
Release verdictFAILBusiness outcome not achieved

This is more useful than:

LLM score: 92%
PASS

The 92% may be true. It is simply not enough to establish that the agent worked.

The assurance loop

The engineering asset is the repeatable chain from execution to evidence.

TEST INTENT
    |
    v
LIVE AGENT SESSION
    |
    +---- Conversation
    +---- Orchestration trace
    +---- Tool/API events
    +---- Retrieval evidence
    +---- Security observations
    |
    v
EVALUATION
    |
    +---- Deterministic assertions
    +---- Semantic judgment
    +---- Journey outcome
    |
    v
INTEGRITY GATE
    |
    v
RELEASE VERDICT

Every important assertion should be connected to observable evidence.

That makes it possible to answer questions that a simple score cannot answer:

  • What failed?
  • Where did it fail?
  • Was the failure deterministic or probabilistic?
  • Did the agent reach the intended business outcome?
  • Which execution event proves the failure?
  • Is the failure release-blocking?
  • Did the latest release improve the system or merely change the wording?

The release gate should reflect the system's risk

FALSE-PASS CONTROLA quality score cannot rescue a broken execution
A quality score cannot rescue a broken executionSTARTplanned journeyTURN 1–6quality = 0.81TRUNCATEDtimeout / errorQUALITY SCORElooks greenINTEGRITY GATEBLOCKEXECUTION INTEGRITY FIRST → QUALITY SCORE CANNOT HIDE FAILURE
A critical failure cannot be averaged away.

Not every failure needs the same treatment.

A minor wording issue may require review. A wrong account update may block release. An authorization bypass should normally be treated as a security release blocker.

That means the final verdict should not simply average every metric.

For example:

Semantic quality             94%   PASS
Goal completion              100%  PASS
Deterministic contracts       99%  PASS
Orchestration                 97%  PASS
Security                       0 blockers
Evidence completeness        100%  PASS
                                      |
                                      v
                               RELEASE: PASS

Contrast that with:

Semantic quality             96%   PASS
Goal completion               82%  FAIL
Deterministic contracts       98%  PASS
Orchestration                 95%  PASS
Security                       1 blocker
Evidence completeness        100%  PASS
                                      |
                                      v
                               RELEASE: FAIL

A high average should never erase a release-blocking condition.

The exact gate depends on the business risk, but the principle is stable: the verdict must respect the system's contracts, not just the mean of its scores.

Where Shyena fits

This is the problem Shyena is designed around.

Shyena treats AI assurance as an evidence problem rather than a response-scoring problem.

The useful unit is not merely a prompt and an answer. It is the assurance case around an agent journey:

BUSINESS GOAL
      |
      v
AGENT EXECUTION
      |
      +--> Conversation evidence
      +--> Orchestration evidence
      +--> Tool/API evidence
      +--> Deterministic evidence
      +--> Semantic evidence
      +--> Security evidence
      |
      v
ASSURANCE DECISION
      |
      v
RELEASE / REVIEW / BLOCK

That separation also makes failures actionable. Engineering teams can see whether they need to fix orchestration, a deterministic contract, retrieval, generated-answer quality, security controls, or the test itself.

The objective is not to produce another impressive evaluation dashboard.

The objective is to make a release decision defensible.

What changes for QA and engineering teams

AI agents do not remove the need for quality engineering. They expand its scope.

The test engineer needs to understand:

  • what the business outcome is;
  • which execution paths are allowed;
  • which properties are deterministic;
  • where model judgment is appropriate;
  • which tools and APIs create side effects;
  • which trace events prove orchestration behaviour;
  • which security conditions block release;
  • what evidence must be retained for the verdict.

This is closer to systems assurance than conventional UI test automation.

The practical shift is simple:

Stop treating the response as the product under test. Treat the agent journey as the system under test.

Conclusion

A good response can be produced by a failed agent.

That is why production AI assurance cannot stop at LLM evaluation.

A trustworthy agent needs evidence across the entire execution chain: business outcome, orchestration, deterministic correctness, generated-answer quality, security, and execution integrity.

The result should not be a single opaque score. It should be a release decision that an engineer can explain from observable evidence.

That is the difference between evaluating an AI response and assuring an AI system.

Evidence over opinion.

Make the release decision defensible.

Shyena connects live agent behaviour to evidence, evaluation and release governance.

Read the evaluation model