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.

Working with model cards
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.
Decision logs
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.
| Component | Purpose | AWS implementation |
|---|---|---|
| Model card | Intended use, risk, evaluation, limitations | SageMaker AI model cards (API-driven) |
| Decision log | Per-decision audit evidence | Structured logs in CloudWatch Logs or S3 |
| Data lineage | Where data came from and how it changed | Glue Data Catalog and jobs; SageMaker lineage |
| Source attribution | Which documents informed an answer | Metadata tags and citations |
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.
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.