Lesson 3 of 3 Responsible AI in Practice

Turning Responsible AI Policies into Enforced Controls

This lesson shows how responsible AI policies written in natural language are turned into enforced controls, documentation and automated checks.

Learning outcomes

After completing this lesson, you will be able to:

  • Map policy requirements to guardrail policies.
  • Document limitations with model cards.
  • Check compliance automatically with Lambda.

Mapping policy to guardrails

Each policy requirement maps to a control. "Do not provide medical diagnoses" becomes a denied topic with a definition and sample phrases. "No offensive language" becomes content filters and word filters. "Never disclose customer account numbers" becomes a sensitive information filter with a regex. "Answers must be supported by our documents" becomes a contextual grounding check, and "eligibility statements must follow the benefits policy" can become an Automated Reasoning policy. The guardrail is versioned, tested with examples of allowed and disallowed content, and promoted like code, and IAM can require its use.

The following diagram maps each policy requirement to its control.

Mapping policy requirements to controls. No medical diagnoses becomes a denied topic, no offensive language becomes content and word filters, never disclosing account numbers becomes a sensitive information filter with a regex, answers supported by documents becomes a contextual grounding check, and eligibility rules can become an Automated Reasoning policy.
Requirements that a guardrail cannot express are checked in code.
Match the pairs

Policy to control

Exam skills 3.4.3 · 3.1.1

Match each policy statement with the control that enforces it.

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

Documenting limitations with model cards

Users and operators can only use an AI system responsibly if they know its limits. Model cards document them for both the foundation model and the application built on it: known failure modes; languages and domains where quality is lower; intended uses and prohibited uses; evaluation results, including fairness and safety tests; and the human oversight the system requires.

Model cards inform product teams deciding where the system may be used, support staff handling complaints and auditors assessing compliance. Amazon SageMaker AI provides a model card feature for recording this information alongside registered models. A model card is reviewed whenever the model, prompts or guardrails change, because a change to any of them can change the system's limitations.

Automated compliance checks with Lambda

Some policies are best checked by code. Lambda functions can verify each response for required disclaimers ("This is not financial advice"), prohibited claims or promises, correct formatting of regulated information, and links only to approved domains, fixing or blocking non-compliant responses. Scheduled Lambda checks verify configuration compliance: every production agent and application uses an approved guardrail version, invocation logging is enabled, logs have the required retention, and knowledge bases use KMS encryption. Violations are reported to owners and governance dashboards. The following table summarises the mapping.

Policy statementControl
Do not discuss a prohibited subjectGuardrail denied topic
No offensive or harmful languageContent and word filters
Protect personal and account dataSensitive information filters (mask or block)
Answers must be supported by sourcesContextual grounding check
Statements must follow formal policy rulesAutomated Reasoning checks
Required disclaimers and approved linksLambda post-processing checks
Documented limitations and intended useModel cards
Fix the problem

Compliance gaps

Exam skills 3.4.3

Choose the control that closes each compliance gap.

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

An insurance chatbot policy

Compliance issues a policy for a customer chatbot: no advice on whether to file a claim, always include a disclaimer on coverage answers, mask policy numbers and answer only from policy documents. Auditors want evidence that the policy is enforced.

The team configures a guardrail with a denied topic, a regex-based sensitive information filter and a grounding check; a Lambda post-processor adds or verifies the disclaimer; a scheduled Lambda check confirms every environment uses the approved guardrail version; and the model card documents the controls and test results.

Check yourself

How can the use of a guardrail be required for every model call?

Show answer

Through IAM, with the bedrock:GuardrailIdentifier condition key.

Exam Tips

Remember for the exam

  • Map each policy statement to a guardrail policy or automated check.
  • Version and test guardrails like code; require them through IAM.
  • Document limitations and intended use in model cards.
  • Lambda checks verify disclaimers and configuration compliance.