Editor’s introduction
The study examines how enterprise AI systems—built on large language models, retrieval pipelines, and autonomous agents—differ from traditional software in their probabilistic and context-sensitive behavior. It argues that traditional software testing principles, which rely on deterministic outcomes, are inadequate. Instead, the research introduces a structured AI Failure Taxonomy and a revised five-layer AI Assurance Pyramid to guide evaluation-driven development. Researchers compare system behavior under domain-specific inputs and constraints, showing that evaluations define acceptable operational boundaries. A key boundary of the evidence is that the study does not assess actual failure rates or real-world deployment outcomes.
Summary
Enterprise AI systems are failing in ways that traditional quality assurance was not built to detect. Not through crashes or error codes but through confident hallucinations, silent behavioural drift and coordination failures that produce wrong answers visually indistinguishable from correct ones. The teams most exposed are those that adopted AI capabilities quickly and evaluated them the same way they evaluate conventional software: with test suites, pass/fail gates and release-time validation. This approach is insufficient. It is not a resourcing problem. It is a structural mismatch between the assurance model and the system it is trying to verify.
The core problem. AI systems are probabilistic infrastructure. Their behaviour is not defined by code alone it is shaped by model training, prompt design, retrieval quality and the interactions between components. The same input can produce different outputs on different runs. A model update by a cloud provider can silently change behaviour across every prompt in the application. These properties make traditional verification impossible and make continuous evaluation mandatory.
What this paper provides. A comprehensive AI assurance strategy built on three foundations: a philosophy of testing as continuous risk reduction (not correctness verification); a structured taxonomy of AI-native failure modes that makes test coverage systematic rather than intuitive; and a five-layer AI Assurance Pyramid that maps failure classes to the evaluation mechanisms designed to catch them.
AI Agents
AI Agents extend LLMs with the ability to take action. An agent receives a goal, breaks it into steps, invokes tools APIs, databases, search engines, code interpreters and iterates until the goal is satisfied. This introduces multi-step reasoning chains, external dependencies and stateful execution all of which are independently capable of failure.
A critical nuance: an agent can produce a correct final answer via an incorrect reasoning path. This is a false positive and a production risk. Testing a single output tells the answer was right; only trajectory testing tells why it was right and whether it will be right again.
Analogy: The consultant who can also act making calls, gathering data, booking things on your behalf. Now correctness depends not just on what they know, but what they do. A travel agent who books the right hotel at the wrong location has passed the output test but failed the task.
Why Enterprises Build Their Own AI: The RAG Paradigm
Public AI tools like ChatGPT are trained on publicly available data. An enterprise’s competitive advantage often lives in its proprietary data, decades of domain expertise, internal research, regulatory knowledge, customer history and operational procedures. No public model has seen this data and fine-tuning alone is insufficient for systems that must reason over large, frequently updated document corpora.
The most widely adopted solution is Retrieval-Augmented Generation (RAG): an architecture that separates knowledge storage from language generation. Rather than embedding all knowledge in model weights, RAG retrieves relevant documents at query time and provides them as context to the generation model. The model reasons over what it was given, not what it memorised.
If only the final output is evaluated, it cannot be determined which component failed. A correct answer does not confirm correct retrieval. An incorrect answer may originate in retrieval, in generation or in both. This demands independent evaluation of both components: a requirement that fundamentally changes how RAG systems are tested.
Hybrid Evaluation: Deterministic First, Semantic Where Necessary
Not all evaluation dimensions require an LLM judge. The right evaluation strategy is hybrid: apply deterministic validation wherever the output can be structurally verified and reserve semantic evaluation which carries token cost and introduces its own model variance for outputs that genuinely require judgment.
Semantic evaluation applies when the output is natural language that cannot be reduced to a schema match. Use an LLM judge guided by rubrics. Each rubric should assess a single evaluation dimension intent alignment, factual correctness, completeness, safety compliance. Combining multiple dimensions in one rubric invites inconsistent scoring and makes it impossible to localise which dimension caused a failure.
Weighted scoring and mandatory gates reflect business priorities. Not all evaluation dimensions carry equal weight. In a financial services context, factual correctness and safety compliance are non-negotiable; stylistic clarity is secondary. The evaluation framework must encode this hierarchy explicitly: weighted scores for aggregate quality, mandatory gates for dimensions where failure is never acceptable regardless of aggregate score. A response that scores well on completeness but fails on factual correctness should fail the evaluation the mandatory gate surfaces this where an aggregate score would hide it.
The AI Assurance Pyramid
The testing pyramid is a well-understood heuristic in software engineering: build a wide base of fast, cheap, focused tests and narrow toward slower, more expensive, higher-level ones. The same economic logic applies to AI systems, but the layers themselves must be redefined.
The original four-layer model (unit, integration, system, end-to-end) does not map cleanly onto AI architectures. Component boundaries are probabilistic, not deterministic. A unit in an AI system is a prompt and its associated model behaviour, not a function with a fixed return type. And the highest-value failure signals often emerge from interaction patterns that span multiple components, not from individual component correctness.
A key principle: failures should be caught as low in the pyramid as possible. A failure caught at Layer 0 costs near zero and points to a precise fix. The same failure surfacing at Layer 4 is expensive to diagnose, ambiguous in root cause and potentially already in production. Designing the pyramid well means ensuring each layer has the coverage needed to catch its associated failure modes (Section 3) before they propagate upward.
What is validated
Layer 0 establishes the deterministic backbone of the system. No live model calls are made. Everything at this layer is verifiable through classical assertions: schemas either conform or they do not, API contracts either hold or they fail, prompt templates either contain their required sections or they are malformed.
Three evaluation types define this layer. Tool unit tests verify each tool’s logic, schema handling and error behaviour in isolation: no model is involved and results are binary pass or fail. Prompt structure validation treats prompts as static artifacts and confirms that required sections are present, variables are correctly injected, token bounds are respected and output format specifications are syntactically valid. A structurally malformed prompt propagates silently through every layer above it; finding it here costs nothing. API contract tests confirm that external interfaces conform to expected schemas before the system depends on them at runtime.
What is evaluated
Layer 1 is the first layer to involve live model calls. Each component of the AI pipeline is evaluated in isolation: individual prompts against their evaluation datasets, the retrieval pipeline against precision and recall metrics, tool selection logic against routing accuracy and safety classifiers against adversarial inputs.
Prompt evaluation is the primary Layer 1 activity. Each prompt in the system is run against its own golden dataset covering normal inputs, edge cases, adversarial inputs and unsafe scenarios. Pass rate and its trend across model versions or prompt updates constitute the baseline regression signal for each prompt independently. A regression in one prompt must not be hidden by aggregate pipeline scores.
Tool selection accuracy evaluates each component’s ability to identify the correct tool for a given query, independent of any agent reasoning. Evaluation scenarios at this layer provide unambiguous correct-tool cases. Routing errors here indicate a component-level prompt failure, not a multi-step reasoning failure, which makes fixes targeted and cheap.
What is evaluated
Trajectory evaluation is the central technique at this layer. A trajectory is the sequence of reasoning steps, tool invocations and state transitions an agent takes to reach an outcome. Two agents can produce identical final answers via very different trajectories: one reliable and efficient, one fragile and expensive. Evaluating only the final output misses this distinction entirely.
A critical nuance: a system can produce a correct final answer via an incorrect trajectory. This is a false positive and a production risk. It means the system was fortunate once; the underlying fragility will surface under different conditions. Layer 2 is specifically designed to catch these cases before they reach production.
Tool call accuracy is evaluated along two independent dimensions: tool selection (did the agent choose the correct tool for the step?) and parameter construction (did it pass the correct inputs to that tool?). These dimensions fail independently. An agent may correctly identify that a flight search is needed but construct the date parameters incorrectly; or it may construct valid inputs while selecting the wrong tool entirely. Both dimensions must be evaluated separately because they originate from different failure modes and require different fixes.
What is evaluated
Layer 3 is where agentic systems become genuinely complex. Different agents handle different roles: planning, retrieval, synthesis and formatting. Each handoff introduces a potential failure. Unlike microservices with explicit typed contracts, agent interactions rely on implicit, language-based context. A planning agent briefs a flight agent using natural language; if that briefing is ambiguous or incomplete, the downstream agent may proceed incorrectly without raising an error.
Agent handoff accuracy is the primary evaluation concept at this layer. It is distinct from tool call accuracy. Tool call accuracy (Layer 2) measures how correctly an agent invokes a tool: right tool, right parameters. Agent handoff accuracy measures how correctly one agent transfers task context to another agent: does the receiving agent have the right task scope, the right constraints, the right prior context from earlier in the workflow? A handoff can have perfect tool-call mechanics and still transfer an incomplete or incorrect task context.
Orchestration correctness evaluates whether the orchestrating agent routes subtasks to the right sub-agents with appropriate scope and sequencing. Orchestration failures are often invisible in individual agent tests: each sub-agent correctly handles its assigned task, but the wrong task was assigned or the sequence was incorrect.
What is evaluated
Layer 4 evaluates whether the system achieves its intended outcomes from both user and business perspectives. This is the most visible layer and the most expensive. It is also the least diagnostic: a failure at Layer 4 signals that something went wrong, not where.
The evaluation at this layer shifts from component and trajectory quality to outcome quality. Agent goal completion is the primary metric: did the agent achieve the user’s defined end-to-end objective? Not whether individual steps succeeded, but whether the user’s actual intent was fulfilled. This is evaluated against scenarios, not individual prompts and requires human-interpretable success criteria defined at the task level.
Business rule compliance evaluates whether the system’s complete outputs adhere to all applicable domain policies, business constraints and regulatory requirements. This cannot be fully assessed at lower layers because compliance often depends on the full context of the user’s request and the system’s complete response, not individual component outputs in isolation.
The Pyramid as a Diagnostic Tool
The pyramid is not only a testing strategy. It is a diagnostic instrument. When a production issue surfaces, the pyramid tells where to look. Failures originate at lower layers and propagate upward. A symptom visible at Layer 4 usually has a root cause at Layer 1 or 2. Checking bottom-up is more efficient than investigating at the level where the symptom appears.
Example. Three weeks after a routine model update, goal completion scores drop at Layer 4. Layer 3 coordination tests pass. Layer 2 flags elevated tool call accuracy failures on date-related queries: the tool is being invoked with incorrect date parameters. The updated model is interpreting relative dates differently. The fix is a targeted prompt adjustment at Layer 1. Without the pyramid running continuously, this investigation could have taken days; the layered diagnostic reduced it to hours.
RAG Evaluation: Why Standard Metrics Are Insufficient
RAG systems fail in ways that standard output quality metrics cannot distinguish. A response can be fluent, relevant-sounding and grammatically correct while being factually wrong, because the retrieval pipeline surfaced the wrong documents and the model hallucinated from insufficient context. Conversely, a response can be incomplete because retrieval missed key documents, even though the model faithfully used everything it was given.
Standard NLP metrics BLEU, ROUGE, semantic similarity measure output quality relative to a reference string. They cannot answer the question that matters in enterprise RAG: was the response grounded in the right evidence and did the model use that evidence faithfully?
This is the gap that RAG evaluation frameworks like RAGAS and DeepEval are designed to close. These frameworks have introduced various metrics that decompose RAG quality along the two independent failure axes: retrieval quality and generation faithfulness. Four specific RAG assessment metrics have gained broad industry adoption.
Tool call accuracy: designing for independent failure dimensions
Tool selection and parameter construction fail independently, which has a direct implication for evaluation dataset design. A dataset that only contains scenarios where both dimensions succeed or both fail cannot localise regressions after a model update. Evaluation scenarios must be designed so that each dimension can be checked independently: cases where the correct tool is identified but parameters are wrong and cases where valid parameters are constructed for the wrong tool. This makes root-cause analysis tractable without manual inspection of individual failures.
Model Drift: The Silent Degrader
Model drift refers to changes in model behaviour over time, even when nothing have changed. Providers periodically update hosted models safety tuning, alignment adjustments, performance improvements without always issuing changelogs. The danger is not catastrophic failure. It is slight wrongness, consistently, across a large volume of interactions.
Example: A travel assistant has been confidently recommending non-stop flights first as instructed for months. After a quiet model update, it begins occasionally ignoring that instruction. No error is thrown. User satisfaction scores start dipping and by the time the pattern is identified, it has been happening for weeks.
The only reliable defence against drift is prompt-level regression testing running continuously not just at release time. Drift is invisible to monitoring tools that only observe errors and latency. It requires evaluation-based detection: tracking quality scores over time and flagging when trends degrade beyond a defined threshold.
From QA Teams to Evaluation Engineering
Evaluation engineering in AI systems requires a different skill set: building and curating evaluation datasets, designing rubrics, maintaining judge pipelines, interpreting score trends and translating production incidents into evaluation coverage. These are not test automation tasks. They are a distinct discipline, sitting at the intersection of software engineering, data curation and behavioural science.
Organisations that treat AI evaluation as a downstream QA activity, something applied after the development team ships, will consistently under-invest in it. The evaluation infrastructure should be treated as a shared platform capability: centralised, maintained by a dedicated function and consumed by multiple AI product teams rather than rebuilt for each project.
This shift from project-level test suites to platform-level evaluation infrastructure is the organisational equivalent of the move from per-project CI scripts to a shared CI/CD platform. It is not optional for organisations running multiple AI systems in production. It is the only sustainable model at scale.
Conclusion: From Software QA to AI Assurance Engineering
The central argument of this paper is that AI systems are not harder-to-test software. They are a different kind of infrastructure, one for which the fundamental assumptions of software quality assurance do not hold and for which a new assurance model is required.
In AI systems, the same sequence cannot produce the same certainty. The model is not fully programmable. Its outputs are probabilistic. Its behaviour changes when the underlying model is updated by a third party. And the most dangerous failures (hallucination, instruction drift, trajectory collapse, emergent coordination failure) do not produce errors. They produce wrong answers that look right.
For these systems, testing is not an act of verification. It is an act of continuous risk reduction. The goal is not to certify correctness. It is to accumulate evidence that the system behaves acceptably across the distribution of inputs it will encounter, to bound the failures that remain and to detect degradation before it reaches users at scale.


