Lesson 1 of 4 AI Governance and Compliance

Documenting AI Systems for Compliance

This lesson covers the documentation and logging that a compliance framework for FM deployments needs, as regulators, auditors and customers expect organisations to document how their AI systems work and are evaluated.

Learning outcomes

After completing this lesson, you will be able to:

  • Document models with SageMaker AI model cards.
  • Keep decision logs for consequential outputs.
  • Record lineage and source attribution.

SageMaker AI model cards

Amazon SageMaker AI model cards document a model in a structured, versioned record: an overview, intended uses and out-of-scope uses, a risk rating, business details and owners, training details, evaluation results, ethical considerations, caveats and recommendations. Cards have a status (draft, pending review, approved, archived), can be linked to model versions in the Model Registry and can be exported as PDF for auditors. Because they can be created and updated programmatically through the API, pipelines can write evaluation results into the card each time a model or configuration changes. For FMs consumed through Bedrock, a card documents the application's use of the model, its limitations from the provider's documentation and the organisation's own evaluations.

The following diagram matches each request in a regulator's AI audit to its evidence.

Evidence for a regulator's AI audit. A SageMaker AI model card documents the assistant's purpose and limits, the release pipeline adds evaluation results to it as evidence of testing, and decision logs in CloudWatch Logs with the prompt version, sources and output allow any explanation to be reconstructed.
The release pipeline keeps the model card current.
True or false

Working with model cards

Exam skills 3.3.1 · 3.4.3

Check three claims about how SageMaker AI model cards are created and used.

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

Decision logs

When an AI system's output affects a person, such as a decision on a claim or an application, regulators and auditors may ask why the system produced it. A decision log records, for each consequential output, the information needed to explain and audit it: the request ID, time and user or system; the input, redacted as required; the prompt version, model ID and parameters; the retrieved sources; the tools called and their results; the guardrail actions; and the final output.

Writing these records as structured JSON to CloudWatch Logs, with a retention setting and AWS KMS encryption, or to Amazon S3 makes them searchable with CloudWatch Logs Insights or Amazon Athena. Model invocation logging provides the raw exchange with the model, while application decision logs add the business context that the model never sees, such as which customer and case the output concerned.

True or false

Decision logs

Exam skills 3.3.1 · 3.3.2

Check three claims about decision logs for consequential AI outputs.

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

Lineage and source attribution

Compliance often requires knowing which data shaped a model or an answer. AWS Glue crawlers and ETL jobs register datasets and record transformations in the Data Catalog, and lineage from Glue jobs can be visualised in the catalogue of Amazon SageMaker Unified Studio. SageMaker AI lineage tracking links training data, jobs and model versions. Metadata tagging on every document and chunk, such as source system, owner, licence and version, provides systematic data source attribution for RAG answers. The following table summarises the components.

ComponentPurposeAWS implementation
Model cardIntended use, risk, evaluation, limitationsSageMaker AI model cards (API-driven)
Decision logPer-decision audit evidenceStructured logs in CloudWatch Logs or S3
Data lineageWhere data came from and how it changedGlue Data Catalog and jobs; SageMaker lineage
Source attributionWhich documents informed an answerMetadata tags and citations
Worked example

Preparing for an AI audit

A lender uses an FM-based assistant to draft explanations of credit decisions. A regulator asks for documentation of the system's purpose and limits, evidence of testing, and the ability to reconstruct any explanation sent to a customer.

A model card updated by the release pipeline with evaluation results documents purpose, limits and testing; decision logs in CloudWatch Logs with prompt version, sources and output allow reconstruction; and source documents carry metadata for attribution.

Check yourself

What does a model card document?

Show answer

Intended use, risk rating, evaluation results and limitations of a model.

Exam Tips

Remember for the exam

  • Model cards document intended use, risk, evaluation and limitations; update them programmatically.
  • Decision logs capture prompt version, model, sources, tools, guardrail actions and output.
  • Lineage: Glue Data Catalog and jobs; attribution: document metadata and citations.