Profile Applicability:
- Level 1
Description:
Amazon Bedrock is a fully managed service that allows users to easily build and scale AI applications using pre-trained models. Enabling model invocation logging for Amazon Bedrock ensures that all invocations made to the models are logged and can be reviewed for debugging, auditing, or compliance purposes.
Model invocation logs capture information about each request, such as inputs, outputs, execution time, and any errors that may have occurred. This SOP ensures that model invocation logging is enabled in Amazon Bedrock to allow monitoring and troubleshooting of AI model usage.
Rationale:
Security: Logging model invocations provides an audit trail for all interactions with AI models, helping detect unauthorized access, errors, or malicious activities.
Compliance: Many regulatory frameworks (e.g., SOC 2, HIPAA) require logging of all system interactions for accountability and traceability of sensitive data.
Troubleshooting and Monitoring: Logging model invocations allows for easier debugging and performance monitoring. It helps detect issues related to model performance, errors, or unexpected outputs.
Impact:
Pros:
Improved Security: Logging model invocations provides a clear record of all actions, improving accountability and helping detect unauthorized usage or security incidents.
Auditing and Compliance: Logs provide a valuable audit trail to meet security and compliance requirements for AI systems.
Troubleshooting: Logs provide insights into the model's behavior and performance, enabling easier identification and resolution of issues.
Cons:
Storage Overhead: Logging every invocation may lead to increased storage costs, especially if the volume of requests is high.
Performance Impact: Depending on how logging is implemented, it may slightly impact the performance of model invocations, especially if extensive logging data is captured for each request.
Default Value:
By default, Amazon Bedrock does not enable logging of model invocations. The logging must be manually configured by the user.
Pre-requisite:
AWS IAM Permissions:
bedrock:UpdateModelInvokeLogging
bedrock:DescribeModel
cloudwatch:PutLogEvents
cloudwatch:CreateLogStream
AWS CLI installed and configured.
Amazon CloudWatch logs enabled for logging model invocations.
Test Plan:
Using AWS Console:
Sign in to the AWS Management Console.
Navigate to Amazon Bedrock under AI/ML Services.
Select the Model for which you want to enable invocation logging.
In the Model Details section, locate the Logging Settings.
Check if Model Invocation Logging is enabled:
If disabled, enable the logging by selecting Enable Logging.
Configure the destination as Amazon CloudWatch for storing logs.
Click Save Changes to apply the configuration.
Using AWS CLI:
To check if model invocation logging is enabled, run:
aws bedrock describe-model --model-name <model-name>
Check the ModelInvokeLogging field in the output. If it is set to false, you need to enable it.
To enable model invocation logging, run the following CLI command:
aws bedrock update-model-invocation-logging --model-name <model-name> --logging-enabled true --log-destination <cloudwatch-log-group-name>
Verify that the logging is enabled by describing the model again:
aws bedrock describe-model --model-name <model-name>
Implementation Steps:
Using AWS Console:
Log in to the AWS Management Console and navigate to Amazon Bedrock.
In the Bedrock Dashboard, go to Models and select the model for which you want to enable invocation logging.
In the Model Details section, find the Logging Settings.
Enable Model Invocation Logging by selecting Enable Logging.
Specify the CloudWatch Log Group to store the logs.
Click Save Changes to apply the settings.
Using AWS CLI:
To enable model invocation logging, run:
aws bedrock update-model-invocation-logging --model-name <model-name> --logging-enabled true --log-destination <cloudwatch-log-group-name>
Verify that the logging is successfully enabled by running:
aws bedrock describe-model --model-name <model-name>
Backout Plan:
Using AWS Console:
If enabling model invocation logging causes issues, sign in to the AWS Management Console.
Navigate to Amazon Bedrock and go to Model Settings or Logging.Disable model invocation logging or revert to a different log destination.
Save the changes and verify that logging is disabled.
Using AWS CLI:
To disable model invocation logging, run the following command:
aws bedrock put-model-invocation-logging --model-id <MODEL_ID> --log-destination ""
Verify that model invocation logging has been disabled:
aws bedrock describe-model-invocation-logging --region <REGION>