Lesson 4 of 4 AI Governance and Compliance

Monitoring Governance Continuously

This lesson covers detection, alerting, remediation and audit-ready logging that catch controls failing after launch as misuse patterns, data and behaviour drift and configurations change.

Learning outcomes

After completing this lesson, you will be able to:

  • Detect misuse and drift automatically.
  • Trigger alerting and remediation workflows.
  • Keep audit-ready logs without creating privacy risk.

Automated detection

Misuse detection watches for unusual usage: spikes in requests or tokens per user or API key, high rates of guardrail interventions from one source, repeated prompt attack detections, or access outside business patterns. Drift detection tracks changes in the distribution of inputs (new topics, languages) and outputs (length, refusal rate, sentiment, judge quality scores). Policy violation detection samples responses and checks them with an LLM judge or rules for violations that guardrails did not block. Guardrail intervention metrics, token metrics and custom metrics in CloudWatch, with anomaly detection alarms, make these signals actionable.

Bias drift monitoring compares outcomes across groups over time, for example approval recommendation rates by region or gender proxy in sampled decisions; SageMaker Model Monitor with SageMaker Clarify monitors bias drift for models hosted on SageMaker AI endpoints.

Sort into groups

What kind of detection?

Exam skills 3.3.4

Classify each monitoring signal.

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

Alerting and remediation workflows

Monitoring is only useful if detected problems are acted on quickly. Amazon CloudWatch alarms and Amazon EventBridge rules trigger automated remediation in AWS Lambda or AWS Step Functions. Depending on the problem, the remediation can revoke or throttle an abusive API key, block a user, switch to a stricter guardrail version, roll back a prompt or model version, disable a tool an agent is misusing, or open an incident ticket and page the owner through Amazon SNS.

Automated actions are chosen for problems with clear, low-risk responses; actions with larger consequences, such as taking an application offline, usually notify a person who decides. Every remediation action is itself logged, so auditors can see what was detected, what was done and when.

The following diagram shows the detection and remediation path.

Automated response to misuse at night. Alarms on anomalous requests per API key and on guardrail interventions trigger an EventBridge rule, and a Lambda function reduces the key's usage plan to a minimal rate, notifies the security team through SNS and records the action.
The remediation runs without waiting for a person.
Scenario questions

Automated remediation

Exam skills 3.3.4

Choose the remediation for each detected problem.

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

Audit-ready logging controls

Audits require evidence of what an AI system produced, but logs that store every prompt and response in full become a privacy risk of their own. Response logging keeps that evidence, while token-level redaction removes sensitive values, such as personal information and secrets, before logs are written, so the logs remain useful for audit and debugging without exposing data.

AI output policy filters enforce rules on every response, such as removing prohibited claims or adding required disclosures, and record each action they take, which shows auditors that the policy was applied consistently. Logs are encrypted with AWS KMS, access to them is restricted to authorised roles, and they are retained for the period regulations require. The following table summarises the monitoring loop.

SignalDetectionTypical remediation
Token or request burst per keyCloudWatch anomaly detectionThrottle or revoke key; notify owner
Rising guardrail interventionsGuardrail metrics alarmInvestigate source; block user; tighten policy
Quality or behaviour driftJudge scores and output statisticsRoll back prompt or model; re-evaluate
Bias driftOutcome rates by group over timeReview prompts and data; escalate to governance
Policy violations in sampled outputsLLM judge or rulesUpdate guardrail; add test cases
Worked example

Misuse at night

An API key for a partner integration starts sending thousands of requests per hour at night, many blocked by the prompt attack filter.

A CloudWatch anomaly detection alarm on requests per key and an alarm on guardrail interventions trigger an EventBridge rule; a Lambda function sets the key's usage plan to a minimal rate, notifies the security team through SNS and records the action. Logs with redacted content provide evidence for the investigation.

Check yourself

What should happen to sensitive tokens before responses are logged?

Show answer

They should be redacted, so logs do not become a new store of sensitive data.

Exam Tips

Remember for the exam

  • Monitor misuse, drift, bias and policy violations continuously.
  • Alarms and EventBridge rules trigger automated remediation in Lambda or Step Functions.
  • Redact sensitive tokens before logging responses.
  • Log remediation actions as audit evidence.