Responsible AI and Amazon Bedrock Guardrails for AIF-C01
Bias, fairness and explainability on AWS for AIF-C01: SageMaker Clarify, Model Cards, Bedrock evaluations and every Bedrock Guardrails policy explained.
7 min readBy AI Guru AcademyFacts last checked
By AI Guru Academy
In short
Responsible AI on AWS is a set of practices backed by specific tools. Amazon SageMaker Clarify measures bias and explains predictions for traditional ML models, Amazon SageMaker Model Cards record what a model is for and how it was tested, Amazon Bedrock evaluations test foundation models, and Amazon Bedrock Guardrails filters what goes into and comes out of a generative AI application. For AIF-C01 you need to know which tool answers which question, and where each one stops.
Which responsible AI ideas does AIF-C01 expect you to know?
Domain 4 of the AIF-C01 exam guide, Guidelines for Responsible AI, is 14% of scored content. Its skills name bias, fairness, inclusivity, robustness, safety and veracity, plus dataset characteristics, the effects of bias and variance, and transparent and explainable models.
AWS's responsible AI page uses a slightly different list of dimensions (fairness, explainability, privacy and security, safety, controllability, veracity and robustness, governance and transparency), in which bias is not a dimension of its own. The useful exam skill is matching a problem to a concept and a tool. "The model is less accurate for older applicants" is a fairness problem. "We cannot tell the loan officer why the application was declined" is an explainability problem. "The chatbot invents a refund policy" is a veracity problem.
Where does bias come from, and how do bias and variance differ?
Bias can enter through the data, through training choices or through how a model is used, and AWS treats it as something to check at every stage of the ML lifecycle. The SageMaker Clarify guidance lists questions to ask along the way, including whether the training data is representative of different groups, whether there are biases in labels or features, and whether the model is deployed on a population it was not trained or evaluated on.
A common data cause is class imbalance: one group has far fewer training examples than another. AWS explains that models then fit the larger group at the expense of the smaller one, giving larger errors for it, for example a model trained mainly on one age group being less accurate for younger and older people. Rebalancing the data before training is one suggested response.
Do not confuse this social meaning of bias with the statistical one. The Machine Learning Lens pairs underfitting with high bias and overfitting with high variance. An underfit model is too simple to capture the pattern; an overfit model learns its training data too closely and does worse on new data. Remedies it mentions include more training data, regularisation or a simpler model, depending on which problem you have.
What does SageMaker Clarify do, and is it still available?
SageMaker Clarify detects bias in data and models and explains model predictions, but AWS states it is no longer open to new customers. Existing customers can continue to use it, and AWS says it does not plan to add new features. Learn what it does, because it explains the concepts the exam tests, but do not assume a new account can adopt it.
Clarify covers three jobs:
- Pre-training bias metrics run on the dataset before any model exists, so they do not depend on model output. Class imbalance is one of them.
- Post-training bias metrics use the model's predictions to find bias introduced by the algorithm or hyperparameters, or not visible earlier.
- Explainability uses feature attributions based on Shapley values (SHAP), a model-agnostic method that shows how much each input feature contributed to a prediction.
Clarify can also monitor production models for bias drift and feature attribution drift. AWS's guidance adds that fairness is a process: which bias metric matters depends on the application and may be guided by social and legal considerations.
How do SageMaker Model Cards support transparency?
Model Cards document critical details about an ML model in one place for governance and reporting. A card can record intended uses (including uses the model is not intended for), a risk rating of unknown, low, medium or high, training details and metrics, evaluation results, and considerations and recommendations.
Any edit other than an approval status change creates a new card version, giving an immutable record of changes, and cards can be exported to PDF for stakeholders.
Do not mix Model Cards up with AWS AI Service Cards. A Model Card is something you write about your own model. An AI Service Card is published by AWS about one of its services or models, and explains intended use cases, how ML is used and key considerations for responsible design and use.
How do you evaluate a foundation model for responsible AI?
Amazon Bedrock evaluations test models and knowledge bases with automatic metrics, a judge model or human reviewers. AWS lists programmatic model evaluation jobs (built-in or custom prompt datasets), jobs that use human workers such as your employees or subject-matter experts, jobs that use a second LLM as a judge that scores and explains each response, and RAG evaluations for knowledge bases, which need ground-truth answers.
Bedrock can compute metrics such as the semantic robustness of a model, and it can also evaluate models and RAG sources outside Bedrock.
Evaluation also shows trade-offs. AWS notes that over-optimising an LLM to be harmless can make it less helpful. The Machine Learning Lens makes a similar point for traditional ML: a credit-scoring model may put fairness and explainability first, while a real-time recommender may favour speed and accuracy over explainability. Document the trade-off you chose.
What can each Amazon Bedrock Guardrails policy do?
A guardrail is a set of configurable safeguards applied to user inputs and model responses (excluding reasoning content blocks). You can attach it to a model call by guardrail ID and version, or call it on its own through the ApplyGuardrail API without invoking a model.
| Policy | What it does | Typical use |
|---|---|---|
| Content filters | Detect harmful text or image content in the categories Hate, Insults, Sexual, Violence, Misconduct and Prompt Attack, with a strength per category | Block toxic replies in a public chatbot |
| Denied topics | Block topics you define in queries or responses | Stop a banking assistant giving investment advice |
| Word filters | Block custom words or phrases with case-insensitive whole-word matching | Profanity, competitor names |
| Sensitive information filters | Block or mask PII using probabilistic detection, plus custom regular expressions | Mask account numbers in call summaries |
| Contextual grounding checks | Score whether a response is grounded in a supplied source and relevant to the query | Catch unsupported answers in RAG |
| Automated Reasoning checks | Validate responses against logical rules built from a source document you upload | Check answers against a written policy |
A few details separate a strong answer from a guess:
- Prompt attacks include jailbreaks and prompt injection; prompt leakage detection is Standard tier only. With the
InvokeModelAPI you must wrap user input in guardrail input tags, or prompt attacks are not filtered. - Grounding thresholds run from 0 to 0.99. A higher threshold blocks more ungrounded content, at the cost of blocking more borderline answers. Grounding is checked on the output only.
- Tiers and versions. Guardrails offers Classic and Standard safeguard tiers, and tier features change. You test a working draft in the built-in test window, then create a version for production.
Where do these tools stop?
Each tool covers part of the problem, and none replaces human judgement. Sensitive information detection is probabilistic. Bias metrics tell you that a gap exists, not whether it is acceptable; that is a decision for people. AWS's Nova service card says that if a workflow produces consequential decisions, customers must evaluate the risks and put human oversight, testing and other safeguards in place.
Worked example (illustration). Larkspur Lending, a fictional lender, builds an ML model to pre-score loans and a generative AI assistant for customer questions. For the model, the team checks class imbalance, measures bias on predictions, explains decisions with feature attributions and records a high risk rating in a Model Card. For the assistant, it runs a Bedrock evaluation with human reviewers, then adds a guardrail with a denied topic for investment advice, PII masking and a grounding check. A credit officer reviews every declined application.
Key takeaways
- Social bias (unfair outcomes for a group) is different from statistical bias (underfitting).
- SageMaker Clarify measures pre- and post-training bias and explains predictions with SHAP, but it is closed to new customers.
- Model Cards document your model, with risk ratings and immutable versions; AI Service Cards are AWS's documentation of its own services.
- Bedrock Guardrails has six policy types; know what each one filters and that detection is not a guarantee.
FAQ
Is Amazon Bedrock Guardrails the same as model evaluation?
No. Evaluation tests a model or knowledge base and produces scores. Guardrails acts on live inputs and responses, blocking or masking content. Many teams use both.
Can I still use SageMaker Clarify?
AWS states that SageMaker Clarify is no longer open to new customers, while existing customers can continue to use it. The concepts it measures, such as pre-training and post-training bias and feature attribution, remain part of the responsible AI material you should understand.
What is the difference between a model card and an AI service card?
You write a SageMaker Model Card about your own model, recording intended use, risk rating, training and evaluation. AWS publishes AI Service Cards about its own services and models, describing intended use cases and responsible use considerations.
Does a contextual grounding check stop all hallucinations?
No. It scores each response for grounding and relevance against the source you supply and blocks responses below your thresholds. A threshold set too low can still let errors through, so keep human review where the stakes are high.
Sources
- AWS Certified AI Practitioner (AIF-C01) exam guide: https://docs.aws.amazon.com/aws-certification/latest/ai-practitioner-01/ai-practitioner-01.html
- Responsible AI (AWS): https://aws.amazon.com/ai/responsible-ai/
- Responsible AI, Generative AI Lens: https://docs.aws.amazon.com/wellarchitected/latest/generative-ai-lens/responsible-ai.html
- Fairness, model explainability and bias detection with SageMaker Clarify: https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-configure-processing-jobs.html
- Class Imbalance (CI) metric: https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-bias-metric-class-imbalance.html
- Pre-training bias metrics: https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-measure-data-bias.html
- Model explainability (SageMaker Clarify): https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-model-explainability.html
- MLPERF04-BP05 Perform a performance trade-off analysis (Machine Learning Lens): https://docs.aws.amazon.com/wellarchitected/latest/machine-learning-lens/mlperf04-bp05.html
- Amazon SageMaker Model Cards: https://docs.aws.amazon.com/sagemaker/latest/dg/model-cards.html
- AWS AI Service Card for Amazon Nova: https://docs.aws.amazon.com/ai/responsible-ai/nova-micro-lite-pro/overview.html
- Evaluate the performance of Amazon Bedrock resources: https://docs.aws.amazon.com/bedrock/latest/userguide/evaluation.html
- Amazon Bedrock Guardrails: https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html
- Detect prompt attacks with Amazon Bedrock Guardrails: https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-prompt-attack.html
- Contextual grounding check: https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-contextual-grounding-check.html
Last checked 2026-11-22.
AI Guru Academy is an independent training provider and is not affiliated with or endorsed by Amazon Web Services. AWS service names are trademarks of Amazon.com, Inc. or its affiliates.
Next step: see the full AIF-C01 course at /courses/aif-c01-exam-prep.