AI Security Maturity Model·AWS v1.0.0

Drag to explore · pinch to zoom

Foundational Logging and MonitoringDefense-in-depth layer: AI Application Capability 1 · Model inferenceUse case: AI that answers 👤 CustomerAWS Shared Responsibility Model: who implements and operates this control. Customer = you own it; AWS = AWS operates it and you inherit it; Shared = both have obligations.

c1.4 Log every model invocation with CloudTrail and CloudWatch

Capture who invoked which model, when, and with what configuration, so inference activity is auditable and anomalies are detectable.

Foundational
Enhanced
Advanced
Effort: Low Impact: Medium GenAI scopesFrom the AWS Generative AI Security Scoping Matrix.: 3 · Pre-trained models

Implementation guidance

How to implement on AWS

Enable CloudTrail for Amazon Bedrock API calls and turn on Bedrock model invocation logging to CloudWatch/S3. Track invocation rate, latency, token usage, and error rate with CloudWatch metrics, and alarm on deviations from baseline.

Make inference activity auditable

Two different logs answer two different questions:

  • AWS CloudTrail records the control-plane and API activity — who called which Bedrock operation, from where, and when. This is on by default for management events and is your audit trail of who did what.
  • Model invocation logging captures the data plane — the actual prompts, completions, and invocation metadata for calls made through the bedrock-runtime endpoint. This is off by default and you must enable it explicitly.

Together they let you reconstruct both the administrative actions and the inference itself.

Turn on model invocation logging

Enable invocation logging and send it to CloudWatch Logs (and/or S3). CloudWatch is convenient for metric filters and alarms; S3 is better for cheap long-term retention. The delivery role must let Bedrock write to the destination:

aws bedrock put-model-invocation-logging-configuration \
  --logging-config '{
    "cloudWatchConfig": {
      "logGroupName": "/aws/bedrock/model-invocations",
      "roleArn": "arn:aws:iam::111122223333:role/BedrockInvocationLoggingRole"
    },
    "textDataDeliveryEnabled": true,
    "imageDataDeliveryEnabled": false,
    "embeddingDataDeliveryEnabled": true
  }'
Note: invocation logging only captures calls through the bedrock-runtime endpoint (InvokeModel, Converse, and the OpenAI-compatible APIs on that endpoint). Calls through other endpoints are not captured.

Alarm on the signals that matter

Once logs land in CloudWatch, add metric filters and alarms for things worth waking up for — a spike in guardrail interventions, throttling errors, or an unusual jump in invocation volume from one principal. Prompts and completions can contain sensitive data, so encrypt the destination with your customer managed key (see the KMS control) and scope who can read the log group or bucket.

Keep an eye on cost

  • CloudWatch Logs bills for ingestion and storage; prompts/completions can be large, so route high-volume workloads to S3 and keep CloudWatch for a shorter alerting window.
  • Set an S3 lifecycle rule to expire or archive old invocation logs.

Acceptance criteria

CloudTrail records Bedrock API calls; invocation logs are delivered; CloudWatch alarms exist for anomalous invocation patterns.

Practical implementation

How this control is implemented in each reference architecture:

CloudTrail and Bedrock invocation logs from the Generative AI account flow to the central Log archive account, where they are immutable and monitored.

  1. Enable organization CloudTrail capturing Bedrock management and data events, and turn on Bedrock model-invocation logging in the Generative AI account.
    Generative AI account CloudTrail Amazon Bedrock
  2. Deliver those logs to the central WORM (Object Lock) bucket in the Log archive account so inference activity is tamper-resistant and centrally retained.
    Generative AI account → Log archive Amazon S3 CloudTrail
  3. Publish invocation rate, latency, token usage, and error-rate metrics to CloudWatch and alarm on deviations from baseline.
    Generative AI account CloudWatch

How to validate: CloudTrail shows Bedrock calls; invocation logs land in the Log archive bucket under Object Lock; a simulated invocation spike triggers a CloudWatch alarm.

Avoid: Logging only into the same account that runs the workload. An attacker who reaches that account can tamper with the evidence; ship logs to a separate Log archive account.

Generative AI OU (multi-account) →

CloudTrail and invocation logs stay in-account but are exported to an access-controlled, Object-Lock bucket you can later centralize when you graduate.

  1. Enable CloudTrail for Bedrock API calls and turn on Bedrock model-invocation logging to CloudWatch and S3.
    In-account logging CloudTrail Amazon Bedrock CloudWatch
  2. Send logs to a dedicated S3 bucket with Object Lock and a restrictive bucket policy, separate from application data, so they resist tampering even within one account.
    In-account logging Amazon S3
  3. Create CloudWatch metrics and alarms for invocation rate, token usage, and error rate to catch abuse or runaway cost.
    In-account logging CloudWatch

How to validate: CloudTrail records Bedrock calls; invocation logs are delivered to the Object-Lock bucket; an abnormal invocation pattern raises an alarm.

Avoid: Writing logs to a bucket the application role can delete or overwrite. Isolate the log bucket with its own policy and Object Lock so runtime credentials cannot erase the trail.

Single account (entry point) →

Threats addressed

  • Undetected abuse or data access when invocations are not logged.
  • No audit trail to reconstruct an incident.

AWS services

AWS CloudTrail Amazon CloudWatch Amazon Bedrock

Pricing

Bedrock does not charge for enabling invocation logging itself; you pay the standard CloudWatch Logs and/or S3 charges for the data delivered and stored. CloudTrail management events are free; data events (if enabled) are billed per event. See Monitor model invocation using CloudWatch Logs and Amazon S3.

Framework mappings

OWASP GenAI/LLM Top 10 (2026)

  • LLM02 Sensitive Information Disclosure

NIST AI Risk Management Framework (AI 100-1)

  • MEASURE.3 Mechanisms for tracking AI risks are in place
  • MANAGE.4 Risk treatments, monitoring and response are documented and applied

AWS Well-Architected Generative AI Lens (Security)

  • GENSEC01-BP04 Implement access monitoring to generative AI services and foundation models
  • GENSEC03-BP01 Implement control plane and data access monitoring

Learning resources

References

  • AWS SRA for AI — Capability 1, Defense in depth