Building a reliable AI system requires more than running a test suite before deployment. The QA strategy needs to account for the behavior of the complete AI system and how that behavior changes over time.
Replayable Execution Traces
When an AI agent produces an unexpected result, knowing that it failed is only the beginning. Engineering teams need to understand why it failed.
- What prompt did it receive?
- What context was available?
- Which documents were retrieved?
- Which tools did it call?
- What intermediate decisions did the agent make?
- Which model version was running?
Without this information, reproducing an AI failure can become extremely difficult.
Replayable execution traces create a record of the system's behavior so engineers can reconstruct an interaction and investigate the failure later. This becomes particularly important for agentic systems, where a single user request may trigger multiple model calls, tool interactions, retrieval steps, and decisions.
Versioning Models, Prompts, and Agent Logic
Application code is normally version-controlled. AI systems require the same discipline to extend beyond source code.
A production AI system can change because of:
- A new model version
- A modified system prompt
- A different retrieval configuration
- A new knowledge base
- A changed agent workflow
- A new tool
- A different embedding model
- Updated safety policies
If these components are not tracked, an engineering team may know that something changed without knowing which change caused the quality regression. Versioning AI components alongside application code creates a much stronger foundation for testing, debugging, auditing, and rollback.
Evaluate Against a Quality Baseline
Uptime does not equal quality. An AI application can have 99.99% availability while producing increasingly poor answers. That is why AI QA needs metrics beyond infrastructure health.
Depending on the use case, teams may evaluate:
- Accuracy
- Relevance
- Groundedness
- Completeness
- Consistency
- Latency
- Hallucination rate
- Retrieval quality
- Safety violations
- Task completion
- Human evaluation scores
- Cost per interaction
The appropriate metrics depend on what the AI system is supposed to accomplish.
For example, a customer-support assistant might prioritize groundedness and successful resolution, while a clinical classification system may prioritize prediction accuracy, recall, precision, and safety.
Google's research on ML data validation also demonstrates why quality cannot stop at the model itself: errors in production data can undermine model performance even when the underlying algorithm is functioning correctly.
Build Safe Release and Rollback Gates
AI changes should not move directly from experimentation into production simply because the system passes a basic functional test. A stronger process introduces staged promotion:
Development → Evaluation → Staging → Controlled Release → Production
At each stage, the system can be evaluated against predefined quality criteria. If a new model or prompt performs worse than the baseline, the release should be blocked. If quality degrades after deployment, the team should have a documented rollback mechanism. This approach turns deployment into a controlled engineering decision rather than a binary switch.
NIST's AI Risk Management Framework also emphasizes processes for evaluating AI systems and making explicit go/no-go deployment decisions.
Govern AI Memory and Data
For AI systems that use retrieval, persistent memory, or external knowledge sources, QA must also account for what the system knows when it makes a decision.
A response can be technically valid but based on outdated, incorrect, or unauthorized information. Data quality therefore becomes part of system quality.
This includes validating:
- Data sources
- Document freshness
- Access permissions
- Retrieval behavior
- Data transformations
- Embeddings
- Context passed to models
- Persistent memory
- Data lineage
This is particularly important in regulated or sensitive environments, where teams may eventually need to demonstrate not only what an AI system produced but also what information influenced that result.
Enforce Guardrails at Runtime
Testing in a controlled environment is necessary, but it is not sufficient.
Production traffic introduces combinations of inputs, behaviors, integrations, and edge cases that may never appear in a pre-release test set. Runtime controls can therefore act as a second layer of defense.
Depending on the application, these may include:
- Input validation
- Output filtering
- Permission checks
- Content policies
- Tool restrictions
- Rate limits
- Human approval steps
- Sensitive-data detection
- Confidence thresholds
- Fallback mechanisms
This creates a layered approach where QA does not end when the system reaches production.