CLOUD CONCEPT

Quality Gates

Quality gates are explicit pass-or-fail checkpoints that use evidence to determine whether a change can advance through a delivery workflow.

Cloud Concepts Hub →

What is Quality Gates

A quality gate turns testing, evaluation, and operational requirements into enforceable promotion criteria. In cloud delivery, gates prevent unacceptable application, infrastructure, or generative AI changes from reaching broader environments while providing an auditable explanation for each release decision.

A quality gate evaluates evidence against predefined acceptance criteria before allowing a workflow to proceed. The evidence might include test results, vulnerability findings, performance measurements, foundation model evaluations, or production health metrics. Running tests alone does not create a gate: the workflow must interpret the results and block promotion, request review, or initiate a defined recovery action when requirements are not met.

Place gates where they provide useful feedback at an appropriate cost. Before merging code or during an initial build, run fast unit tests, static analysis, dependency checks, and infrastructure template validation. After deploying to an isolated test environment, run integration and contract tests against real service interfaces, including authentication and authorization behavior. Reserve broader end-to-end, load, resilience, and dynamic security tests for suitable staging environments or scheduled workflows because these tests generally require more time and resources. Critical release requirements must still be satisfied before production promotion; scheduling a test separately does not make its result optional.

For example, an API pipeline might reject a build when unit tests fail or a prohibited critical vulnerability is found. After staging deployment, another gate could require checkout integration tests to pass and measured request latency to remain within an agreed budget under representative load. A production canary can then expose a small traffic share while operational metrics are observed. Failed health criteria should stop further rollout and, where supported and configured, trigger rollback. A deployment completing successfully is not evidence that application behavior is correct.

For generative AI applications, treat changes to the foundation model, prompt templates, retrieval configuration, knowledge corpus, guardrails, and inference parameters as potential behavioral changes. Evaluate candidates against versioned datasets containing representative tasks, difficult cases, known failures, and adversarial inputs. Gate on task-relevant measures such as answer correctness, groundedness, retrieval relevance, unsafe response rates, sensitive-data disclosure, latency, and cost. For example, a support assistant might require minimum grounded-answer performance, no observed disclosure in a designated privacy test suite, and no material regression on critical customer workflows. Passing a finite test suite does not prove that disclosure can never occur.

Model outputs are often nondeterministic, so exact string matching is usually unsuitable for open-ended answers. Combine deterministic checks for schemas and tool arguments with semantic evaluation, rubric-based assessment, and targeted human review. Repeated trials and uncertainty estimates help distinguish meaningful regressions from sampling variation. Model-based judges should be calibrated against human judgments and checked for bias and inconsistency. Do not let a strong average score hide failures in safety-critical categories or important user segments.

Continuous evaluation extends gates beyond the initial release. Run regression suites on proposed changes and periodically evaluate deployed behavior using appropriately protected production samples. Keep an untouched holdout set for unbiased comparisons, and add newly discovered failures to a maintained regression set. Production monitoring can identify distribution shifts or emerging problems and trigger investigation, reevaluation, or rollback; it does not replace predeployment validation.

Define thresholds, evidence freshness, missing-result handling, and exception procedures explicitly. A report that exists but is stale, incomplete, or associated with another artifact should not satisfy the gate. Record the exact artifact, environment, dataset, evaluator, and policy versions so decisions can be reproduced. Promote the same immutable application artifact between environments rather than rebuilding untested binaries.

Strict gates reduce release risk but can increase delivery time, compute cost, and false rejections. Use risk-based test selection, parallel execution, and controlled isolation of flaky tests without silently bypassing essential coverage. Human approval can complement automated evidence for high-impact changes, but approval alone is not proof of quality. Exceptions should be authorized, time-limited, and auditable rather than becoming permanent bypasses.

Key aspects of Quality Gates

Effective quality gates combine measurable standards, appropriately staged tests, trustworthy evidence, and enforceable promotion or recovery decisions.

Enforceable acceptance criteria

Translate requirements into explicit thresholds and blocking conditions. Define what happens when evidence fails, is missing, or is too old rather than treating report generation as successful validation.

Stage-appropriate testing

Run fast, deterministic checks early and use deployed environments for integration, end-to-end, security, and performance testing. Match test scope and execution cost to the risk at each promotion boundary.

Systematic GenAI regression evaluation

Evaluate model, prompt, retrieval, and configuration changes against versioned representative and adversarial datasets. Compare both absolute standards and regressions against an approved baseline, including results for critical categories.

Reliable evaluation evidence

Account for stochastic outputs, evaluator limitations, and flaky tests. Use repeated measurements, calibrated rubrics, and targeted human review where automated scores alone are insufficient.

Progressive deployment safeguards

Observe canary or blue/green deployments before expanding exposure. Connect failed operational criteria to rollout termination and configured rollback rather than relying only on deployment completion.

Traceability and controlled exceptions

Associate decisions with immutable artifacts and versioned tests, datasets, evaluators, and policies. Require explicit authorization and expiration for overrides so release evidence remains auditable.

Cloud services for Quality Gates

AWS CodePipeline establishes promotion boundaries, while AWS CodeBuild executes tests and converts acceptance-policy violations into failed actions. Amazon Bedrock evaluations can provide GenAI quality evidence; custom automation or AWS Step Functions can wait for evaluation completion, assess thresholds, and return a gate decision. During deployment, AWS CodeDeploy can use validation hooks and Amazon CloudWatch alarms to stop unhealthy rollouts and initiate configured rollback. These services provide execution and orchestration mechanisms, but engineers must define the acceptance policy, preserve evidence, and ensure failures actually prevent promotion. Reports and dashboards without an enforced decision path are observability, not quality gates.

AWS CodePipeline image AWS CodePipeline

Coordinates delivery stages and prevents downstream promotion when required actions fail. Stage conditions, test actions, and manual approval actions can implement different gate policies, while external evaluation results require an integration that translates them into an enforceable decision.

Open AWS CodePipeline →
AWS CodeBuild image AWS CodeBuild

Runs unit tests, integration tests, security tools, and custom evaluation scripts in managed build environments. A gate implementation must propagate failing tests or unacceptable scores into build failure; publishing a test report alone does not enforce acceptance criteria.

Open AWS CodeBuild →
Amazon Bedrock

Provides model evaluation capabilities that can supply evidence for foundation model and generative AI application quality decisions. Pipeline automation must retrieve evaluation results, compare them with project-specific thresholds, and explicitly block promotion when requirements are not met.

Open Amazon Bedrock →
AWS CodeDeploy image AWS CodeDeploy

Supports deployment validation hooks and alarm-based deployment controls for supported compute platforms and deployment configurations. Configured automatic rollback can recover from deployment failures or alarm conditions, providing a gate during rollout rather than only before deployment.

Open AWS CodeDeploy →
Amazon CloudWatch image Amazon CloudWatch

Supplies metrics, logs, and alarms for operational acceptance criteria such as error rates and latency. Custom metrics can also represent application or GenAI evaluation outcomes, but a deployment or workflow integration must act on those signals.

Open Amazon CloudWatch →
AWS Step Functions image AWS Step Functions

Orchestrates custom evaluation workflows that invoke services, wait for asynchronous jobs, compare results, and branch into pass or fail paths. It is useful when a gate requires multiple evaluations, retries, or an explicit review workflow beyond a single build action.

Open AWS Step Functions →