Lesson 2 of 3 Quality Assurance and Deployment Validation

Validating Foundation Model Updates During Rollout

This lesson covers the techniques that check the deployed system during and after rollout of an FM update and roll back automatically when checks fail.

Learning outcomes

After completing this lesson, you will be able to:

  • Exercise the deployed application with synthetic user workflows.
  • Validate AI-specific output behaviour against the previous version.
  • Roll back automatically on failed checks.

Synthetic user workflows

Synthetic user workflows exercise the deployed application end to end the way users do. Amazon CloudWatch Synthetics canaries run scripts on a schedule (for example every five minutes) that call the API or drive the web interface: ask known questions, complete a multi-turn task, call an agent action in a sandbox. They check that responses arrive within latency targets, have the right structure, contain expected facts and cite sources. Canaries run continuously, and immediately after deployments, publishing success metrics that alarms watch.

# Fragment of a Synthetics canary step (Python)
resp = requests.post(API_URL, json={"question": "What is the return window for electronics?"}, timeout=20)
body = resp.json()
assert resp.status_code == 200
assert "30 days" in body["answer"]                 # expected fact
assert body.get("citations"), "answer must cite a source"
True or false

Synthetic workflows

Exam skills 5.1.9

Check three claims about validating deployments with synthetic user workflows.

Log in to try this activity Interactive activities are free with an account.

AI-specific output validation

Beyond availability, validation compares the new version's behaviour with the previous one on a fixed prompt set. Hallucination rate on the golden dataset must not rise. Semantic drift is measured as the embedding similarity between old and new answers to the same prompts; large drops flag prompts whose meaning changed, which reviewers inspect. Response consistency checks that repeated runs agree and that structured outputs keep their schema. Refusal rate, response length and guardrail intervention rate are compared too.

Match the pairs

Validating a new version

Exam skills 5.1.9

Match each validation check with what it detects in a new model or prompt version.

Log in to try this activity Interactive activities are free with an account.

Automated rollback

Validation results are useful only if they control the rollout. During a canary or linear deployment, Amazon CloudWatch alarms on canary success, error rates, latency and quality metrics trigger an automatic rollback when the new version performs worse than the old one, without waiting for someone to notice.

Each kind of component has its own rollback mechanism. AWS CodeDeploy rolls back Lambda functions and ECS services; SageMaker AI deployment guardrails roll back endpoints; AWS AppConfig rolls back configuration, such as routing rules; and Bedrock agents, flows and prompt references are reverted by pointing their aliases back to the previous version. The following table summarises deployment validation.

CheckTechniqueTooling
End-to-end availability and correctnessScripted user journeysCloudWatch Synthetics canaries
Hallucination rateGolden dataset with judgesEvaluation workflow
Semantic driftEmbedding similarity old versus newCustom validation job
Consistency and schemaRepeated runs; schema validationCustom validation job
Automatic rollbackAlarms during gradual rolloutCodeDeploy, AppConfig, aliases, SageMaker guardrails

The following diagram shows a prompt update deployment rolling itself back when a canary test fails.

Automatic rollback of a prompt update. The new prompt version deployed through AppConfig with a linear strategy; ten minutes in, the Synthetics canary for the returns question failed because answers no longer mentioned the 30-day window. The canary alarm attached to the deployment rolled it back to the previous version.
No one had to notice the failure for the rollback to happen.
Worked example

A prompt update in production

A new prompt version is deployed through AppConfig with a linear deployment strategy. Ten minutes in, the Synthetics canary for the returns question starts failing because answers no longer mention the 30-day window.

The canary success metric alarm is attached to the AppConfig deployment, which rolls back automatically to the previous prompt version; the semantic drift report shows which other prompts changed meaning.

Check yourself

Which service runs synthetic user workflows with content checks?

Show answer

CloudWatch Synthetics canaries.

Exam Tips

Remember for the exam

  • Synthetic user workflows: CloudWatch Synthetics canaries with content checks.
  • Validate hallucination rate, semantic drift and consistency against the previous version.
  • Attach alarms to rollouts for automatic rollback.