Back to Blog
Complete Guide to AWS AI/ML Governance: SageMaker, Bedrock, and CloudTrail Compliance
AWS Governance·14 min read·

Complete Guide to AWS AI/ML Governance: SageMaker, Bedrock, and CloudTrail Compliance

C

Claw GRC Team

Claw GRC Team

A comprehensive guide to AWS AI/ML governance covering SageMaker, Bedrock, and CloudTrail compliance mapped to SOC 2, NIST AI RMF, ISO 42001, and OWASP LLM Top 10.

Complete Guide to AWS AI/ML Governance: SageMaker, Bedrock, and CloudTrail Compliance

Every organization running AI workloads on AWS faces the same question from auditors, regulators, and customers: how do you govern your models? You can point to your CloudTrail logs and IAM policies, but that only covers infrastructure. Model documentation, bias detection, lineage tracking, guardrails enforcement, and automated remediation are where most teams fall short.

AWS provides a rich set of native services for AI governance. The problem is that nobody tells you how to stitch them together into a coherent compliance program. This guide does exactly that. We introduce a 10-pillar framework for AWS AI governance, walk through the key services, and map everything to the compliance frameworks your auditors care about.


Why AWS AI Governance Matters

Three forces are converging in 2026:

Regulatory pressure is accelerating. The EU AI Act is in enforcement. NIST AI RMF is being written into federal procurement requirements. State-level AI regulations are multiplying. If you run ML workloads on AWS, you need documented governance -- not just good intentions.

Auditors are asking new questions. SOC 2 auditors are no longer satisfied with CloudTrail logs and IAM screenshots. They want model documentation, training data provenance, bias testing results, and evidence that your guardrails actually work.

Customers require it. Enterprise buyers include AI governance questionnaires in their procurement process. "We run on AWS" is not an answer. "We use SageMaker Model Cards for documentation, Clarify for bias detection, and CloudTrail for audit trails, all mapped to SOC 2 CC6.1 and NIST AI RMF Map 1.5" is an answer.


The 10 Pillars of AWS AI Governance

Our framework organizes AWS AI governance into 10 categories. Each pillar maps to specific AWS services, compliance requirements, and evidence collection strategies.

Pillar Focus Area Primary AWS Services
1. Model Documentation Model cards, versioning, metadata SageMaker Model Cards, Model Registry
2. Model Lineage Training data provenance, pipeline tracking SageMaker ML Lineage Tracking
3. Bias and Fairness Bias detection, fairness metrics SageMaker Clarify
4. Model Monitoring Drift detection, performance tracking SageMaker Model Monitor
5. LLM Guardrails Content filtering, topic denial, PII redaction Bedrock Guardrails
6. Audit Trails API logging, model invocation tracking CloudTrail, CloudTrail Lake
7. Observability Metrics, logs, traces for ML workloads CloudWatch, X-Ray
8. Access Control Least privilege, service boundaries IAM, SCPs, VPC endpoints
9. Automated Remediation Event-driven compliance enforcement EventBridge, Lambda, Config Rules
10. Data Protection Encryption, key management, data classification KMS, Macie, S3 policies

The rest of this article covers the most critical pillars in depth. For deep dives on individual pillars, see the linked spoke articles.


SageMaker Model Cards: Documentation as Compliance Evidence

SageMaker Model Cards provide a structured format for documenting your ML models. For compliance, they serve as the single source of truth that auditors can review.

A Model Card captures:

  • Model overview (name, version, description, intended use)
  • Training details (datasets, algorithm, hyperparameters)
  • Evaluation results (metrics, bias analysis, performance by demographic group)
  • Additional information (ethical considerations, caveats, recommendations)

Creating a Model Card Programmatically

import boto3
import json

sagemaker = boto3.client("sagemaker")

model_card_content = {
    "model_overview": {
        "model_description": "Customer churn prediction model for enterprise accounts",
        "model_id": "churn-predictor-v3",
        "model_creator": "ML Platform Team",
        "problem_type": "Binary Classification",
        "algorithm_type": "XGBoost",
        "model_artifact": ["s3://ml-artifacts/churn-v3/model.tar.gz"],
    },
    "intended_uses": {
        "purpose_of_model": "Predict 90-day churn probability for enterprise accounts",
        "intended_users": ["Customer Success team", "Revenue Operations"],
        "explanations_for_risk_rating": "Medium risk - influences retention outreach but does not make autonomous decisions",
        "risk_rating": "Medium",
    },
    "training_details": {
        "training_observations": "Trained on 24 months of account activity data (Jan 2024 - Dec 2025)",
        "training_job_details": {
            "training_arn": "arn:aws:sagemaker:us-east-1:123456789:training-job/churn-v3",
        },
    },
    "evaluation_details": [
        {
            "name": "Overall Performance",
            "metric_groups": [
                {
                    "name": "binary_classification_metrics",
                    "metric_data": [
                        {"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},
                    ],
                }
            ],
        }
    ],
}

response = sagemaker.create_model_card(
    ModelCardName="churn-predictor-v3-card",
    Content=json.dumps(model_card_content),
    ModelCardStatus="Draft",
    SecurityConfig={"KmsKeyId": "alias/ml-governance-key"},
)

print(f"Model Card ARN: {response['ModelCardArn']}")

For a deep dive on Model Cards for compliance, including field-by-field mapping to SOC 2 and EU AI Act requirements, see SageMaker Model Cards for Compliance.


SageMaker Model Monitoring: Continuous Compliance After Deployment

Model documentation is necessary but not sufficient. Models degrade over time. Data distributions shift. Performance drifts. A model that was fair at deployment can become biased six months later.

SageMaker Model Monitor provides four types of monitoring:

  1. Data Quality Monitoring -- detects schema violations and statistical drift in input data
  2. Model Quality Monitoring -- tracks prediction accuracy against ground truth
  3. Bias Drift Monitoring -- detects changes in bias metrics over time (via Clarify integration)
  4. Feature Attribution Drift -- monitors changes in feature importance

Setting Up Data Quality Monitoring

from sagemaker.model_monitor import DefaultModelMonitor, CronExpressionGenerator

monitor = DefaultModelMonitor(
    role="arn:aws:iam::123456789:role/SageMakerMonitorRole",
    instance_count=1,
    instance_type="ml.m5.xlarge",
    volume_size_in_gb=20,
    max_runtime_in_seconds=3600,
)

# Create a baseline from training data
monitor.suggest_baseline(
    baseline_dataset="s3://ml-data/churn/training/baseline.csv",
    dataset_format={"csv": {"header": True}},
    output_s3_uri="s3://ml-monitoring/churn-v3/baseline",
)

# Schedule hourly monitoring
monitor.create_monitoring_schedule(
    monitor_schedule_name="churn-v3-data-quality",
    endpoint_input="churn-predictor-v3-endpoint",
    output_s3_uri="s3://ml-monitoring/churn-v3/reports",
    schedule_cron_expression=CronExpressionGenerator.hourly(),
    statistics=monitor.baseline_statistics(),
    constraints=monitor.suggested_constraints(),
)

Compliance Tip: SOC 2 CC7.1 requires system monitoring that detects anomalies. Model Monitor's drift detection, combined with CloudWatch alarms, satisfies this requirement for ML-specific anomalies. Export monitoring reports as compliance evidence on a monthly basis at minimum.


SageMaker Clarify: Bias Detection for Compliance

Bias in ML models is a compliance risk under the EU AI Act (Article 10), NIST AI RMF (Measure 2.6), and increasingly under SOC 2 when AI systems affect customers. SageMaker Clarify provides pre-training and post-training bias detection.

Running a Clarify Bias Analysis

from sagemaker.clarify import (
    SageMakerClarifyProcessor,
    DataConfig,
    BiasConfig,
    ModelConfig,
)

clarify = SageMakerClarifyProcessor(
    role="arn:aws:iam::123456789:role/SageMakerClarifyRole",
    instance_count=1,
    instance_type="ml.m5.xlarge",
)

data_config = DataConfig(
    s3_data_input_path="s3://ml-data/churn/validation/data.csv",
    s3_output_path="s3://ml-monitoring/churn-v3/clarify",
    label="churned",
    headers=["account_size", "industry", "region", "tenure_months", "churned"],
    dataset_type="text/csv",
)

bias_config = BiasConfig(
    label_values_or_threshold=[1],
    facet_name="industry",
    facet_values_or_threshold=["Healthcare", "Finance"],
    group_name="region",
)

model_config = ModelConfig(
    model_name="churn-predictor-v3",
    instance_count=1,
    instance_type="ml.m5.xlarge",
    content_type="text/csv",
    accept_type="application/json",
)

clarify.run_bias(
    data_config=data_config,
    bias_config=bias_config,
    model_config=model_config,
    pre_training_methods="all",
    post_training_methods="all",
)

Clarify produces metrics including Demographic Parity (DPL), Disparate Impact (DI), and Conditional Demographic Disparity (CDD). These metrics become direct compliance evidence for EU AI Act Article 10 (data governance) and NIST AI RMF Measure 2.6 (bias evaluation).


Bedrock Guardrails: Governing LLM Applications

If you run LLM workloads through Amazon Bedrock, Guardrails is your primary governance tool. It provides:

  • Content filters -- block harmful, violent, sexual, or hateful content with configurable thresholds
  • Denied topics -- prevent the model from responding to specific topics
  • Word filters -- block specific words or phrases
  • Sensitive information filters -- detect and redact PII (SSN, credit card numbers, phone numbers)
  • Contextual grounding -- reduce hallucination by checking responses against source material

Creating a Guardrail via AWS CLI

aws bedrock create-guardrail \
  --name "production-grc-guardrail" \
  --description "Guardrail for GRC application LLM interactions" \
  --content-policy-config '{
    "filtersConfig": [
      {"type": "SEXUAL", "inputStrength": "HIGH", "outputStrength": "HIGH"},
      {"type": "VIOLENCE", "inputStrength": "HIGH", "outputStrength": "HIGH"},
      {"type": "HATE", "inputStrength": "HIGH", "outputStrength": "HIGH"},
      {"type": "INSULTS", "inputStrength": "HIGH", "outputStrength": "MEDIUM"},
      {"type": "MISCONDUCT", "inputStrength": "HIGH", "outputStrength": "HIGH"},
      {"type": "PROMPT_ATTACK", "inputStrength": "HIGH", "outputStrength": "NONE"}
    ]
  }' \
  --sensitive-information-policy-config '{
    "piiEntitiesConfig": [
      {"type": "US_SOCIAL_SECURITY_NUMBER", "action": "BLOCK"},
      {"type": "CREDIT_DEBIT_CARD_NUMBER", "action": "ANONYMIZE"},
      {"type": "EMAIL", "action": "ANONYMIZE"},
      {"type": "PHONE", "action": "ANONYMIZE"}
    ]
  }' \
  --blocked-messaging "I cannot assist with that request. Please contact support." \
  --tags '[{"key": "compliance", "value": "soc2-cc6.1"}]'

Compliance Tip: Bedrock Guardrails map directly to OWASP LLM Top 10 controls: prompt injection filtering (LLM01), sensitive information disclosure prevention (LLM06), and output handling (LLM02). Tag your guardrails with the compliance controls they satisfy for auditor traceability.


CloudTrail AI Audit Trails

CloudTrail is the backbone of AWS audit trails, and it captures all SageMaker and Bedrock API calls. For AI governance, you need to ensure:

  1. CloudTrail is enabled in all regions where AI workloads run
  2. Management events capture SageMaker and Bedrock control plane operations (CreateModel, CreateEndpoint, InvokeModel)
  3. Data events capture S3 access to training data and model artifacts
  4. CloudTrail Lake enables SQL-based querying of your AI audit trail

Querying AI Activity with CloudTrail Lake

aws cloudtrail-data start-query \
  --query-statement "
    SELECT
      eventTime,
      eventName,
      userIdentity.arn AS caller,
      requestParameters
    FROM <event-data-store-id>
    WHERE
      eventSource IN ('sagemaker.amazonaws.com', 'bedrock.amazonaws.com')
      AND eventTime > '2026-03-01 00:00:00'
    ORDER BY eventTime DESC
    LIMIT 100
  "

This query retrieves all SageMaker and Bedrock API calls for the past month -- exactly the kind of evidence your auditor will request.


CloudWatch ML Observability

CloudWatch provides metrics, logs, and alarms for ML workloads. Key metrics to monitor:

  • SageMaker Endpoint: Invocations, ModelLatency, OverheadLatency, Invocation4XXErrors, Invocation5XXErrors
  • Bedrock: InvocationLatency, InputTokenCount, OutputTokenCount, InvocationThrottles
  • Model Monitor: MonitoringExecutionStatus, violation counts from monitoring reports

Set CloudWatch alarms on these metrics and route them to your incident response pipeline. Alarm history becomes compliance evidence for SOC 2 CC7.1 (system monitoring) and CC7.2 (security event evaluation).


IAM for AI Services

IAM is where most teams get AI governance wrong. Common mistakes:

  • SageMaker execution roles with sagemaker:* permissions
  • Bedrock roles with access to all foundation models
  • Shared service accounts across ML pipelines
  • No boundary between training and inference environments

Least-Privilege SageMaker Execution Role

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowSpecificModelTraining",
      "Effect": "Allow",
      "Action": [
        "sagemaker:CreateTrainingJob",
        "sagemaker:DescribeTrainingJob"
      ],
      "Resource": "arn:aws:sagemaker:us-east-1:123456789:training-job/churn-*",
      "Condition": {
        "StringEquals": {
          "sagemaker:VpcSecurityGroupIds": ["sg-ml-training"],
          "aws:RequestedRegion": "us-east-1"
        }
      }
    },
    {
      "Sid": "AllowTrainingDataAccess",
      "Effect": "Allow",
      "Action": ["s3:GetObject", "s3:ListBucket"],
      "Resource": [
        "arn:aws:s3:::ml-data/churn/*",
        "arn:aws:s3:::ml-data"
      ]
    },
    {
      "Sid": "AllowModelArtifactWrite",
      "Effect": "Allow",
      "Action": ["s3:PutObject"],
      "Resource": "arn:aws:s3:::ml-artifacts/churn-*"
    },
    {
      "Sid": "DenyUnencryptedTraining",
      "Effect": "Deny",
      "Action": "sagemaker:CreateTrainingJob",
      "Resource": "*",
      "Condition": {
        "Null": {
          "sagemaker:VolumeKmsKeyId": "true"
        }
      }
    }
  ]
}

Key Takeaway: Every SageMaker role should be scoped to specific resource name prefixes, require VPC isolation, and deny unencrypted operations. This satisfies SOC 2 CC6.1 (logical access), CC6.3 (role-based access), and NIST 800-53 AC-6 (least privilege).

For a comprehensive guide to IAM, SCPs, and network controls for AI workloads, see AWS Cloud Security for AI Compliance.


Automated Remediation with EventBridge

Manual remediation does not scale. EventBridge lets you build event-driven compliance enforcement that reacts to governance violations in real time.

Example: automatically disable a SageMaker endpoint if Model Monitor detects significant data drift.

# CloudFormation snippet: EventBridge rule for Model Monitor violations
AWSTemplateFormatVersion: "2010-09-09"
Resources:
  ModelDriftRemediationRule:
    Type: AWS::Events::Rule
    Properties:
      Name: sagemaker-model-drift-remediation
      Description: Auto-remediate when Model Monitor detects drift
      EventPattern:
        source:
          - aws.sagemaker
        detail-type:
          - SageMaker Model Monitor Alert
        detail:
          MonitoringScheduleName:
            - prefix: "churn-v3"
          Status:
            - Failed
      State: ENABLED
      Targets:
        - Arn: !GetAtt DriftRemediationFunction.Arn
          Id: DriftRemediationTarget

  DriftRemediationFunction:
    Type: AWS::Lambda::Function
    Properties:
      FunctionName: model-drift-remediation
      Runtime: python3.13
      Handler: index.handler
      Role: !GetAtt RemediationRole.Arn
      Code:
        ZipFile: |
          import boto3
          import json

          def handler(event, context):
              sagemaker = boto3.client('sagemaker')
              sns = boto3.client('sns')

              schedule_name = event['detail']['MonitoringScheduleName']
              endpoint_name = schedule_name.replace('-data-quality', '')

              # Scale endpoint to zero (effectively disable)
              sagemaker.update_endpoint_weights_and_capacities(
                  EndpointName=endpoint_name,
                  DesiredWeightsAndCapacities=[{
                      'VariantName': 'AllTraffic',
                      'DesiredInstanceCount': 0
                  }]
              )

              # Notify the team
              sns.publish(
                  TopicArn='arn:aws:sns:us-east-1:123456789:ml-governance-alerts',
                  Subject=f'Model Drift Detected: {endpoint_name}',
                  Message=json.dumps({
                      'action': 'endpoint_scaled_to_zero',
                      'endpoint': endpoint_name,
                      'reason': 'Model Monitor detected data quality violation',
                      'next_steps': 'Review drift report and retrain model'
                  })
              )

              return {'statusCode': 200, 'action': 'remediated'}

Compliance Mapping Table

This table maps AWS AI services to the compliance framework requirements they satisfy. Use it to build your controls matrix and identify gaps.

AWS Service / Feature SOC 2 NIST AI RMF ISO 42001 OWASP LLM Top 10 Evidence Type
SageMaker Model Cards CC4.1 (monitoring) Map 1.5 (risk tolerance), Govern 1.1 (documentation) 8.4 (AI system documentation) -- Model documentation export
SageMaker ML Lineage CC8.1 (change mgmt) MS.2.1 (test set integrity) 8.6 (data for AI) LLM03 (data poisoning) Lineage graph export
SageMaker Clarify CC4.1, CC7.1 Measure 2.6 (bias evaluation) 9.2 (performance evaluation) -- Bias analysis report
SageMaker Model Monitor CC7.1 (monitoring) Manage 2.2 (sustain value) 9.3 (monitoring) -- Monitoring execution reports
Bedrock Guardrails CC6.1 (access control) Govern 6.1 (third-party AI) 8.5 (AI system controls) LLM01 (prompt injection), LLM06 (info disclosure) Guardrail configuration + blocked request logs
CloudTrail CC7.2 (event evaluation) Govern 1.1 (transparency) A.12.4 (logging) LLM08 (excessive agency) CloudTrail event history
CloudWatch CC7.1 (monitoring) Manage 2.4 (monitoring) 9.3 (monitoring) LLM04 (model DoS) Alarm history, dashboards
IAM (roles, policies) CC6.1, CC6.3 Govern 1.1 (policy) A.9.1 (access control) LLM07 (insecure plugin), LLM08 (excessive agency) IAM policy documents
SCPs CC6.1 (org-level controls) Govern 5.1 (risk policies) A.5 (organizational controls) -- SCP policy documents
EventBridge + Lambda CC7.2 (incident response) Manage 3.1 (risk response) 10.1 (improvement) -- Remediation execution logs
KMS CC6.7 (encryption) -- A.10.1 (cryptography) LLM06 (info disclosure) Key policy documents
Macie CC6.7, CC6.1 Map 3.1 (risk mapping) 8.6 (data for AI) LLM06 (info disclosure) Data classification reports

Key Takeaway: No single AWS service covers all compliance requirements. Governance requires stitching together Model Cards (documentation), Lineage (provenance), Clarify (fairness), Model Monitor (ongoing), CloudTrail (audit), IAM (access), and EventBridge (remediation). The table above is your roadmap.


Using Claw GRC for AWS AI Compliance

Claw GRC integrates with your AWS environment to automate evidence collection for AI governance:

Automated evidence collection:

  • CloudTrail events for SageMaker and Bedrock API calls (daily)
  • IAM policy snapshots for ML roles (daily)
  • Model Card exports from SageMaker (on change)
  • Model Monitor execution reports (per schedule)
  • Clarify bias analysis reports (per execution)
  • Guardrail configuration and blocked request logs (daily)

Pre-built compliance mappings:

  • SOC 2 Trust Services Criteria mapped to AWS AI controls
  • NIST AI RMF subcategories mapped to SageMaker and Bedrock features
  • ISO 42001 clauses mapped to AWS governance services
  • OWASP LLM Top 10 risks mapped to Bedrock Guardrails and IAM controls

Compliance score:

  • Real-time AWS AI governance score across all mapped frameworks
  • Gap identification with remediation guidance
  • Audit-ready evidence packages for each framework

What Comes Next

This guide is the first in our AWS AI Governance series. The remaining articles dive deep into each pillar:

Each article includes hands-on code examples, compliance mapping tables, and evidence collection strategies you can implement today.


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 →