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.
What kind of detection?
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 remediation
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.
| Signal | Detection | Typical remediation |
|---|---|---|
| Token or request burst per key | CloudWatch anomaly detection | Throttle or revoke key; notify owner |
| Rising guardrail interventions | Guardrail metrics alarm | Investigate source; block user; tighten policy |
| Quality or behaviour drift | Judge scores and output statistics | Roll back prompt or model; re-evaluate |
| Bias drift | Outcome rates by group over time | Review prompts and data; escalate to governance |
| Policy violations in sampled outputs | LLM judge or rules | Update guardrail; add test cases |
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.
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.