Back to Blog
SageMaker Model Cards for Compliance: Documenting ML Models for SOC 2 and EU AI Act
AWS Governance·11 min read·

SageMaker Model Cards for Compliance: Documenting ML Models for SOC 2 and EU AI Act

C

Claw GRC Team

Claw GRC Team

How to use SageMaker Model Cards to document ML models for SOC 2, EU AI Act, and NIST AI RMF compliance with boto3 examples and field-by-field mapping.

SageMaker Model Cards for Compliance: Documenting ML Models for SOC 2 and EU AI Act

When an auditor asks "show me your model documentation," the worst answer is a Confluence page last updated eight months ago. Model Cards solve this by providing a structured, versioned, API-accessible format for documenting ML models directly within SageMaker.

For compliance, Model Cards are not optional nice-to-haves. They are the primary evidence artifact for SOC 2 CC4.1 (monitoring activities), EU AI Act Article 11 (technical documentation), and NIST AI RMF Map 1.5 (risk tolerance application). This article shows you how to create, structure, and automate Model Cards so they satisfy all three frameworks.

For the broader AWS AI governance framework that Model Cards fit into, see the Complete Guide to AWS AI/ML Governance.


What Are SageMaker Model Cards

A SageMaker Model Card is a JSON document stored within the SageMaker service that describes an ML model. It is versioned automatically -- every update creates a new version, and previous versions are retained. Model Cards can be exported as PDF for auditor review.

Model Cards are organized into four sections:

  1. Model Overview -- name, description, version, creator, problem type, algorithm
  2. Intended Uses -- purpose, intended users, out-of-scope uses, risk rating
  3. Training Details -- training data description, training job references, preprocessing steps
  4. Evaluation Details -- performance metrics, bias metrics, evaluation datasets

Each section maps to specific compliance requirements, which we cover below.

Model Card Lifecycle

Draft → PendingReview → Approved → Active → Archived
  • Draft: Initial creation, fields being populated
  • PendingReview: All required fields complete, awaiting compliance/governance review
  • Approved: Reviewed and approved by governance team
  • Active: Model is in production, Card is the authoritative documentation
  • Archived: Model decommissioned, Card retained for audit history

Compliance Tip: The status transition from PendingReview to Approved is itself compliance evidence. It proves that a governance review occurred before the model entered production. Require this workflow in your ML deployment pipeline.


Model Card Schema and Required Fields

Not all Model Card fields carry equal compliance weight. The table below identifies which fields are required by each framework.

Model Card Field SOC 2 EU AI Act NIST AI RMF Required?
model_description CC4.1 Art. 11(1)(a) Map 1.1 Yes
model_creator CC6.3 Art. 11(1)(a) Govern 2.1 Yes
problem_type -- Art. 11(1)(b) Map 1.1 Yes
algorithm_type -- Art. 11(1)(b) Map 1.1 Yes
purpose_of_model CC4.1 Art. 11(1)(a) Map 1.5 Yes
intended_users -- Art. 9(4) Map 1.1 Yes
risk_rating CC9.1 Art. 6 Map 4.1 Yes
training_observations -- Art. 10(2) MS.2.1 Yes
training_job_details CC8.1 Art. 11(1)(b) Map 1.5 Yes
evaluation metrics CC4.1 Art. 11(1)(c) Measure 2.2 Yes
bias metrics -- Art. 10(2)(f) Measure 2.6 For high-risk
out_of_scope_uses -- Art. 13(3)(b) Map 1.5 Yes
ethical_considerations -- Art. 9(1) Govern 3.1 Recommended

Creating Model Cards Programmatically

Manual Model Card creation does not scale and introduces inconsistency. The examples below show how to create and update Model Cards using boto3, suitable for integration into your ML pipeline.

Creating a Complete Model Card

import boto3
import json
from datetime import datetime

sagemaker = boto3.client("sagemaker")


def create_compliance_model_card(
    model_name: str,
    model_description: str,
    creator: str,
    problem_type: str,
    algorithm: str,
    purpose: str,
    intended_users: list[str],
    risk_rating: str,
    training_data_description: str,
    training_job_arn: str,
    out_of_scope_uses: str,
    evaluation_metrics: list[dict],
    bias_metrics: list[dict] | None = None,
    ethical_considerations: str = "",
) -> str:
    """Create a SageMaker Model Card with all compliance-required fields."""

    content = {
        "model_overview": {
            "model_description": model_description,
            "model_id": model_name,
            "model_creator": creator,
            "problem_type": problem_type,
            "algorithm_type": algorithm,
        },
        "intended_uses": {
            "purpose_of_model": purpose,
            "intended_users": ", ".join(intended_users),
            "explanations_for_risk_rating": (
                f"Risk rated as {risk_rating} based on data sensitivity, "
                f"decision impact, and autonomy level assessment."
            ),
            "risk_rating": risk_rating,
            "factors_affecting_model_efficiency": out_of_scope_uses,
        },
        "training_details": {
            "training_observations": training_data_description,
            "training_job_details": {
                "training_arn": training_job_arn,
            },
        },
        "evaluation_details": [
            {
                "name": "Performance Evaluation",
                "evaluation_observation": (
                    f"Evaluation completed on {datetime.now().strftime('%Y-%m-%d')}. "
                    f"See metric groups for detailed results."
                ),
                "metric_groups": [
                    {
                        "name": "performance_metrics",
                        "metric_data": evaluation_metrics,
                    }
                ],
            }
        ],
        "additional_information": {
            "ethical_considerations": ethical_considerations,
            "custom_details": {
                "compliance_metadata": {
                    "frameworks": ["SOC 2", "NIST AI RMF", "EU AI Act"],
                    "last_review_date": datetime.now().strftime("%Y-%m-%d"),
                    "next_review_date": "",
                    "reviewer": "",
                    "data_classification": "",
                },
            },
        },
    }

    # Add bias metrics if provided
    if bias_metrics:
        content["evaluation_details"].append({
            "name": "Bias Evaluation",
            "evaluation_observation": (
                "Bias analysis performed using SageMaker Clarify. "
                "See metric groups for demographic parity and disparate impact."
            ),
            "metric_groups": [
                {
                    "name": "bias_metrics",
                    "metric_data": bias_metrics,
                }
            ],
        })

    response = sagemaker.create_model_card(
        ModelCardName=f"{model_name}-card",
        Content=json.dumps(content),
        ModelCardStatus="Draft",
        SecurityConfig={"KmsKeyId": "alias/ml-governance-key"},
        Tags=[
            {"Key": "compliance-framework", "Value": "soc2,nist-ai-rmf,eu-ai-act"},
            {"Key": "risk-rating", "Value": risk_rating},
            {"Key": "model-name", "Value": model_name},
        ],
    )

    return response["ModelCardArn"]


# Example usage
card_arn = create_compliance_model_card(
    model_name="churn-predictor-v3",
    model_description=(
        "XGBoost binary classifier predicting 90-day churn probability "
        "for enterprise SaaS accounts based on usage patterns, support "
        "ticket history, and contract metadata."
    ),
    creator="ML Platform Team",
    problem_type="Binary Classification",
    algorithm="XGBoost",
    purpose=(
        "Enable Customer Success team to prioritize retention outreach "
        "for accounts with high churn risk. Model output is a probability "
        "score used to rank accounts; it does not trigger automated actions."
    ),
    intended_users=["Customer Success Managers", "Revenue Operations"],
    risk_rating="Medium",
    training_data_description=(
        "24 months of account activity data (Jan 2024 - Dec 2025). "
        "1,247 enterprise accounts. Features include monthly active users, "
        "support tickets filed, NPS scores, contract value, and tenure. "
        "PII removed during preprocessing. Data sourced from production "
        "analytics database with read-only access."
    ),
    training_job_arn="arn:aws:sagemaker:us-east-1:123456789:training-job/churn-v3-20260315",
    out_of_scope_uses=(
        "This model should NOT be used for: (1) automated contract "
        "termination decisions, (2) pricing adjustments, (3) credit "
        "decisions, (4) any use case involving individual consumer data."
    ),
    evaluation_metrics=[
        {"name": "accuracy", "type": "number", "value": 0.94},
        {"name": "auc_roc", "type": "number", "value": 0.91},
        {"name": "precision", "type": "number", "value": 0.87},
        {"name": "recall", "type": "number", "value": 0.83},
        {"name": "f1_score", "type": "number", "value": 0.85},
    ],
    bias_metrics=[
        {"name": "demographic_parity_difference", "type": "number", "value": 0.03},
        {"name": "disparate_impact_ratio", "type": "number", "value": 0.97},
    ],
    ethical_considerations=(
        "Model predictions may correlate with industry sector, which could "
        "indirectly reflect organizational size or geography. Predictions "
        "should not be used as sole basis for account treatment decisions."
    ),
)

print(f"Model Card created: {card_arn}")

Updating a Model Card After Retraining

When you retrain a model, the Model Card must be updated. SageMaker automatically versions the Card on each update.

def update_model_card_after_retrain(
    card_name: str,
    new_training_job_arn: str,
    new_training_description: str,
    new_metrics: list[dict],
    new_bias_metrics: list[dict] | None = None,
) -> int:
    """Update Model Card with new training and evaluation data."""

    # Retrieve current content
    current = sagemaker.describe_model_card(ModelCardName=card_name)
    content = json.loads(current["Content"])

    # Update training details
    content["training_details"]["training_observations"] = new_training_description
    content["training_details"]["training_job_details"]["training_arn"] = (
        new_training_job_arn
    )

    # Update evaluation metrics
    content["evaluation_details"][0]["metric_groups"][0]["metric_data"] = new_metrics
    content["evaluation_details"][0]["evaluation_observation"] = (
        f"Re-evaluation completed on {datetime.now().strftime('%Y-%m-%d')} "
        f"after model retrain."
    )

    # Update bias metrics if provided
    if new_bias_metrics and len(content["evaluation_details"]) > 1:
        content["evaluation_details"][1]["metric_groups"][0]["metric_data"] = (
            new_bias_metrics
        )

    # Update compliance metadata
    if "additional_information" in content:
        compliance = content["additional_information"].get("custom_details", {}).get(
            "compliance_metadata", {}
        )
        compliance["last_review_date"] = datetime.now().strftime("%Y-%m-%d")

    # Set status back to Draft for re-review
    sagemaker.update_model_card(
        ModelCardName=card_name,
        Content=json.dumps(content),
        ModelCardStatus="Draft",
    )

    # Get the new version number
    updated = sagemaker.describe_model_card(ModelCardName=card_name)
    return updated["ModelCardVersion"]

Key Takeaway: Setting the status back to Draft after a retrain forces the Model Card through the review workflow again. This creates an auditable approval trail for every model update, which satisfies SOC 2 CC8.1 (change management).


Model Cards for SOC 2 Compliance

SOC 2 does not explicitly mention ML models, but the Trust Services Criteria apply to any system that processes customer data or makes decisions affecting customers.

Mapping to SOC 2 Criteria

CC4.1 -- Monitoring Activities: The organization selects, develops, and performs ongoing and/or separate evaluations to ascertain whether the components of internal control are present and functioning.

Model Cards satisfy CC4.1 by documenting:

  • What the model does (model_description, purpose_of_model)
  • How it performs (evaluation_details with metrics)
  • How it is monitored (link to Model Monitor schedule in training_details)

CC6.1 -- Logical Access: The organization implements logical access security controls.

Model Cards contribute to CC6.1 by documenting:

  • Who created the model (model_creator)
  • Who the intended users are (intended_users)
  • What the risk rating is (risk_rating)

CC6.3 -- Role-Based Access: The organization authorizes, modifies, or removes access based on roles.

Model Cards document the intended users and their roles, which supports access control decisions for model endpoints.

CC7.1 -- System Monitoring: The organization detects and monitors for anomalies.

Evaluation metrics in Model Cards establish the performance baseline. Model Monitor detects deviations from this baseline. Together they prove that monitoring is in place and calibrated.

CC8.1 -- Change Management: The organization authorizes, designs, develops, configures, tests, approves, and implements changes.

Model Card version history proves that model changes went through a review workflow. Each version captures the training details and metrics for the updated model.

Evidence collection for SOC 2:

  • Export Model Cards as PDF quarterly
  • Export Model Card version history showing status transitions (Draft -> PendingReview -> Approved)
  • Cross-reference Model Card training_job_arn with CloudTrail logs

Model Cards for EU AI Act

The EU AI Act Article 11 requires technical documentation for high-risk AI systems. Model Cards map directly to several Article 11 requirements.

Article 11 Mapping

Article 11(1)(a) -- General description of the AI system: Covered by model_description, purpose_of_model, and problem_type.

Article 11(1)(b) -- Detailed description of elements and development process: Covered by algorithm_type, training_observations, and training_job_details.

Article 11(1)(c) -- Monitoring, functioning and control: Covered by evaluation_details (performance metrics) and link to Model Monitor configuration.

Article 9(1) -- Risk management system: Covered by risk_rating, explanations_for_risk_rating, and ethical_considerations.

Article 9(4) -- Appropriate risk management measures: Covered by intended_users and out_of_scope_uses (factors_affecting_model_efficiency).

Article 10(2) -- Data governance: Covered by training_observations (training data description) and the Clarify bias report linked in evaluation_details.

Article 10(2)(f) -- Examination of possible biases: Covered by bias_metrics in evaluation_details.

Article 13(3)(b) -- Information on foreseeable misuse: Covered by factors_affecting_model_efficiency (out_of_scope_uses).

Compliance Tip: The EU AI Act requires documentation to be "kept up-to-date" (Article 11(3)). SageMaker Model Card versioning provides an automatic audit trail, but you must update the Card whenever the model is retrained, the training data changes, or the intended use changes. Automate this by integrating Card updates into your ML pipeline.


Model Cards for NIST AI RMF

NIST AI RMF subcategories that Model Cards address:

Map 1.1 -- Context is established: model_description, purpose_of_model, intended_users.

Map 1.5 -- Organizational risk tolerance is applied: risk_rating, explanations_for_risk_rating, out_of_scope_uses.

Map 4.1 -- Risks are evaluated: risk_rating combined with bias_metrics and ethical_considerations.

Measure 2.2 -- AI system performance is evaluated: evaluation_details with performance metrics.

Measure 2.6 -- Bias is evaluated: bias_metrics from Clarify analysis.

Govern 1.1 -- Policies and practices are in place: The existence of a Model Card program with required fields and review workflow demonstrates that documentation policies are implemented effectively.

Govern 2.1 -- Roles and responsibilities are established: model_creator and intended_users document accountability.


Automating Model Card Compliance Checks

Model Cards are only useful for compliance if they are complete and current. The following script validates that all compliance-required fields are present and non-empty.

def validate_model_card_compliance(card_name: str) -> dict:
    """Validate that a Model Card has all compliance-required fields."""

    card = sagemaker.describe_model_card(ModelCardName=card_name)
    content = json.loads(card["Content"])

    findings = []

    # Check model overview
    overview = content.get("model_overview", {})
    required_overview = [
        "model_description", "model_id", "model_creator",
        "problem_type", "algorithm_type",
    ]
    for field in required_overview:
        if not overview.get(field):
            findings.append({
                "severity": "HIGH",
                "field": f"model_overview.{field}",
                "message": f"Required field '{field}' is missing or empty",
                "frameworks": ["SOC 2 CC4.1", "EU AI Act Art. 11", "NIST Map 1.1"],
            })

    # Check intended uses
    uses = content.get("intended_uses", {})
    required_uses = [
        "purpose_of_model", "intended_users", "risk_rating",
    ]
    for field in required_uses:
        if not uses.get(field):
            findings.append({
                "severity": "HIGH",
                "field": f"intended_uses.{field}",
                "message": f"Required field '{field}' is missing or empty",
                "frameworks": ["EU AI Act Art. 9", "NIST Map 1.5"],
            })

    # Check for out-of-scope uses (EU AI Act Art. 13(3)(b))
    if not uses.get("factors_affecting_model_efficiency"):
        findings.append({
            "severity": "MEDIUM",
            "field": "intended_uses.factors_affecting_model_efficiency",
            "message": "Out-of-scope uses not documented (EU AI Act Art. 13(3)(b))",
            "frameworks": ["EU AI Act Art. 13"],
        })

    # Check training details
    training = content.get("training_details", {})
    if not training.get("training_observations"):
        findings.append({
            "severity": "HIGH",
            "field": "training_details.training_observations",
            "message": "Training data description is missing",
            "frameworks": ["EU AI Act Art. 10", "NIST MS.2.1"],
        })

    # Check evaluation details
    eval_details = content.get("evaluation_details", [])
    if not eval_details:
        findings.append({
            "severity": "CRITICAL",
            "field": "evaluation_details",
            "message": "No evaluation results documented",
            "frameworks": ["SOC 2 CC4.1", "EU AI Act Art. 11(1)(c)", "NIST Measure 2.2"],
        })
    else:
        has_bias_eval = any("bias" in e.get("name", "").lower() for e in eval_details)
        if not has_bias_eval:
            risk = uses.get("risk_rating", "").lower()
            severity = "HIGH" if risk in ("high", "critical") else "MEDIUM"
            findings.append({
                "severity": severity,
                "field": "evaluation_details.bias",
                "message": "No bias evaluation documented",
                "frameworks": ["EU AI Act Art. 10(2)(f)", "NIST Measure 2.6"],
            })

    # Check Card status
    status = card["ModelCardStatus"]
    if status == "Draft":
        findings.append({
            "severity": "MEDIUM",
            "field": "ModelCardStatus",
            "message": "Model Card is still in Draft status (not reviewed/approved)",
            "frameworks": ["SOC 2 CC8.1"],
        })

    return {
        "card_name": card_name,
        "card_version": card["ModelCardVersion"],
        "status": card["ModelCardStatus"],
        "finding_count": len(findings),
        "findings": findings,
        "compliant": len([f for f in findings if f["severity"] in ("CRITICAL", "HIGH")]) == 0,
    }


# Run validation
result = validate_model_card_compliance("churn-predictor-v3-card")
print(json.dumps(result, indent=2))

Integrate this validation into your CI/CD pipeline. Block model deployments when compliance-required fields are missing. The validation output itself becomes evidence for NIST AI RMF Govern 1.1 (policies implemented effectively).


Evidence Collection Strategy

For each compliance framework, collect and store these Model Card artifacts:

Evidence Artifact Collection Method Frequency Framework
Model Card PDF export sagemaker.export_model_card_pdf() On each status change SOC 2, EU AI Act, NIST
Model Card version history sagemaker.list_model_card_versions() Quarterly SOC 2 CC8.1
Compliance validation report Custom validation script (above) On each Card update All frameworks
Status transition log CloudTrail events for UpdateModelCard Continuous SOC 2 CC8.1
Review approval records Custom workflow (Jira/Linear ticket) On each review SOC 2 CC8.1, EU AI Act Art. 11(3)
Bias evaluation report Clarify output linked in Card On each retrain EU AI Act Art. 10, NIST Measure 2.6

Claw GRC automates this evidence collection by polling your SageMaker environment for Model Card changes, running compliance validation, and storing the results as framework-mapped evidence artifacts.



Start your AWS AI governance assessment →

CG

Get started with Claw GRC

AI-native compliance automation. 1,026+ controls. MCP-native. Free workspace, no credit card.

Start Free →