AI Safety, Security, and Governance · Topic 6 of 7
Compliance, Traceability and AI Governance
Build FM compliance with SageMaker model cards, Glue Data Catalog lineage, source metadata tags, CloudTrail and decision logs, and policy guardrails.
- 5 min
- SageMaker Model Cards document intended use, risk, evaluations and limitations, and can be created programmatically.
- Glue Data Catalog registers sources; Amazon DataZone captures lineage from Glue tables and jobs.
- Metadata on knowledge base documents enables filtering and source attribution in answers.
What it is
Compliance means you can prove how an AI system behaves: which model it uses, what data shaped it, who approved it, what it decided and why. Governance is the organizational process that makes those proofs routine instead of a scramble before an audit.
On AWS the evidence comes from four sources: model documentation (Amazon SageMaker Model Cards), data lineage (AWS Glue Data Catalog and the catalog tools around it), source attribution metadata on every answer, and logs (AWS CloudTrail and Amazon CloudWatch Logs).
How it works
Programmatic model cards
Amazon SageMaker Model Cards document a model in a structured, versioned record: intended uses, risk rating, training details, evaluation results and limitations. You create and update them with the CreateModelCard and UpdateModelCard APIs, so a pipeline can write them automatically after every training or evaluation run.
- Record known limitations, such as weak performance on a language or a topic the model must not advise on.
- Move the card through approval states so only reviewed models reach production.
- Export the card for auditors instead of writing a separate document by hand.
For FMs you consume through Amazon Bedrock, the provider documents the base model; your card documents your use of it: the prompt templates, guardrail version, knowledge base and evaluation results.
Data lineage and source tracking
AWS Glue Data Catalog is the central registry of data sources. Crawlers and jobs register tables with their location and schema, so every data set a model or knowledge base uses has one catalog entry.
- Lineage: Amazon DataZone (the catalog behind Amazon SageMaker Catalog) can capture lineage automatically for AWS Glue tables and from AWS Glue Spark jobs, using OpenLineage-compatible events. That shows which raw sources produced a training or knowledge base data set.
- Metadata tagging: tag sources and documents with owner, classification, version and license. In Bedrock Knowledge Bases, a metadata file next to each S3 document carries these attributes into the index.
- Source attribution in answers: return the document ID, version and citation with each response, from
RetrieveAndGeneratecitations or your own retrieval metadata.
| Question an auditor asks | Where the answer lives |
|---|---|
| Which documents produced this answer? | Citations and source metadata in the decision log |
| Where did that data set come from? | Glue Data Catalog entry and lineage graph |
| Who changed the guardrail or model? | AWS CloudTrail management events |
| What did the model actually say? | Model invocation logs or application decision logs in CloudWatch Logs |
| What are this model's limits? | SageMaker model card |
Decision logs and audit logging
- AWS CloudTrail records API activity: who created, updated or deleted models, guardrails, agents and knowledge bases, and who invoked them.
- CloudWatch Logs holds decision logs: the request ID, user, prompt template version, model ID, guardrail result, retrieved sources and final response. Use structured JSON so you can query with Logs Insights.
- Set log retention to match the regulation, and protect PII in logs with data protection policies.
CloudTrail answers "who did what to which resource". Only application or invocation logs answer "what did the model say and why". Exam scenarios about explaining a past decision need both.
Organizational governance
Governance turns principles into repeatable controls across every team.
- Policy: an AI use policy aligned with regulations and with responsible AI dimensions such as fairness, explainability, privacy and security, safety, controllability, veracity and robustness, governance and transparency.
- Guardrails as policy: translate each written rule into a guardrail setting: denied topics for forbidden advice, content filters for harmful content, sensitive information filters for data rules, and Automated Reasoning checks for rules that must hold logically.
- Enforcement: IAM and service control policies restrict approved models and Regions, and the
bedrock:GuardrailIdentifiercondition forces the approved guardrail. - Automated compliance checks: Lambda functions or AWS Config rules check that resources meet policy, such as invocation logging enabled or every model having an approved card, and raise findings when they do not.
- Evidence: AWS Audit Manager collects evidence against frameworks, including one for generative AI best practices.
- Review: a cross-functional board approves new use cases, and changes go through the same release pipeline with evaluations as gates.
Common mistakes
Writing documentation by hand after launch. It drifts from reality. Generate model cards and lineage from the pipeline so they update with every change.
Treating CloudTrail as the decision log. CloudTrail does not store prompt or response content. Add structured decision logs.
Guardrails that do not map to policy. A generic guardrail cannot prove compliance with a specific rule. Keep a mapping from each policy clause to the guardrail setting that enforces it.
Untagged knowledge base documents. Without source and version metadata, you cannot tell which version of a policy an answer was based on.
What to remember for the exam
- SageMaker Model Cards document intended use, risk, evaluations and limitations, and can be created programmatically.
- Glue Data Catalog registers sources; Amazon DataZone captures lineage from Glue tables and jobs.
- Metadata on knowledge base documents enables filtering and source attribution in answers.
- CloudTrail logs API activity; CloudWatch Logs holds decision logs with prompts, sources and results.
- Map each written policy rule to a guardrail policy, and enforce the guardrail with IAM conditions.
- Lambda or AWS Config rules automate compliance checks; Audit Manager collects audit evidence.
Check yourself
A regulator asks which document version supported a loan answer given last month. What must the system have logged?
A decision log with the retrieved source IDs and versions from the knowledge base citations, stored in CloudWatch Logs with suitable retention.
How do you keep model documentation current without manual work?
Create and update SageMaker model cards from the training and evaluation pipeline with the model card APIs.
A policy says the assistant must never give tax advice. How is that enforced and proven?
Add a denied topic for tax advice to the guardrail, require that guardrail with an IAM condition, and record the mapping from policy to guardrail setting.
Topic 6 of 7 in AI Safety, Security, and Governance
Test yourself on AI Safety, Security, and Governance
The full AWS AIP-C01 question bank has 827 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by AWS. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.