AWS Security ChangesHomeSearch

AWS sagemaker documentation change

Service: sagemaker · 2026-06-28 · Documentation low

File: sagemaker/latest/dg/model-monitor-data-capture-endpoint.md

Summary

Updated SageMaker Python SDK references from model_monitor to sagemaker_core module, added SDK version-specific examples for endpoint invocation and prediction handling

Security assessment

The changes involve updated import paths and SDK version-specific implementations without any mention of security vulnerabilities, access controls, encryption, or compliance requirements. The modifications focus on API usage patterns and SDK migration guidance.

Diff

diff --git a/sagemaker/latest/dg/model-monitor-data-capture-endpoint.md b/sagemaker/latest/dg/model-monitor-data-capture-endpoint.md
index 7973a54f1..81a350bd8 100644
--- a//sagemaker/latest/dg/model-monitor-data-capture-endpoint.md
+++ b//sagemaker/latest/dg/model-monitor-data-capture-endpoint.md
@@ -17 +17 @@ To capture data for your real-time endpoint, you must deploy a model using SageM
-The steps required to turn on data capture are similar whether you use the AWS SDK for Python (Boto) or the SageMaker Python SDK. If you use the AWS SDK, define the [DataCaptureConfig](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DataCaptureConfig.html) dictionary, along with required fields, within the [CreateEndpointConfig](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateEndpointConfig.html) method to turn on data capture. If you use the SageMaker Python SDK, import the [DataCaptureConfig](https://sagemaker.readthedocs.io/en/stable/api/inference/model_monitor.html#sagemaker.model_monitor.data_capture_config.DataCaptureConfig) Class and initialize an instance from this class. Then, pass this object to the `DataCaptureConfig` parameter in the `sagemaker.model.Model.deploy()` method.
+The steps required to turn on data capture are similar whether you use the AWS SDK for Python (Boto) or the SageMaker Python SDK. If you use the AWS SDK, define the [DataCaptureConfig](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DataCaptureConfig.html) dictionary, along with required fields, within the [CreateEndpointConfig](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateEndpointConfig.html) method to turn on data capture. If you use the SageMaker Python SDK, import the [DataCaptureConfig](https://sagemaker.readthedocs.io/en/stable/api/sagemaker_core.html) Class and initialize an instance from this class. Then, pass this object to the `DataCaptureConfig` parameter in the `sagemaker.model.Model.deploy()` method.
@@ -98 +98 @@ SageMaker Python SDK
-Import the `DataCaptureConfig` Class from [sagemaker.model_monitor](https://sagemaker.readthedocs.io/en/stable/api/inference/model_monitor.html) module. Enable data capture by setting `EnableCapture` to the boolean value `True`.
+Import the `DataCaptureConfig` Class from [sagemaker.model_monitor](https://sagemaker.readthedocs.io/en/stable/api/sagemaker_core.html) module. Enable data capture by setting `EnableCapture` to the boolean value `True`.
@@ -172 +172 @@ Define a name for your endpoint. This step is optional. If you do not provide on
-Deploy your model to a real-time, HTTPS endpoint with the Model object’s built-in `deploy()` method. Provide the name of the Amazon EC2 instance type to deploy this model to in the `instance_type` field along with the initial number of instances to run the endpoint on for the `initial_instance_count` field:
+Deploy your model to a real-time, HTTPS endpoint with the Model object's built-in `deploy()` method. Provide the name of the Amazon EC2 instance type to deploy this model to in the `instance_type` field along with the initial number of instances to run the endpoint on for the `initial_instance_count` field:
@@ -193 +193,16 @@ Deploy your model to a real-time, HTTPS endpoint with the Model object’s built
-Create a predictor object from the SageMaker Python SDK [Predictor](https://sagemaker.readthedocs.io/en/stable/api/inference/predictors.html) Class. You will use the object returned by the `Predictor` Class to invoke your endpoint in a future step. Provide the name of your endpoint (defined earlier as `endpoint_name`), along with serializer and deserializer objects for the serializer and deserializer, respectively. For information about serializer types, see the [Serializers](https://sagemaker.readthedocs.io/en/stable/api/inference/serializers.html) Class in the [SageMaker AI Python SDK](https://sagemaker.readthedocs.io/en/stable/index.html).
+Create an `Endpoint` object from the SageMaker Python SDK. You will use the `Endpoint` object to invoke your endpoint in a future step. Provide the name of your endpoint (defined earlier as `endpoint_name`).
+
+SageMaker Python SDK v3
+    
+    
+    
+    from sagemaker.core.resources import Endpoint
+    
+    endpoint = Endpoint(endpoint_name=endpoint_name)
+    
+    # Example
+    #from sagemaker.core.resources import Endpoint
+    #endpoint = Endpoint(endpoint_name=endpoint_name)
+
+SageMaker Python SDK v2 (Legacy)
+    
@@ -215 +230 @@ In the proceeding code example scenario we invoke the endpoint with sample valid
-The first few lines of the with statement first opens the validation set CSV file, then splits each row within the file by the comma character `","`, and then stores the two returned objects into a label and input_cols variables. For each row, the input (`input_cols`) is passed to the predictor variable's (`predictor`) objects built-in method `Predictor.predict()`.
+The first few lines of the with statement first opens the validation set CSV file, then splits each row within the file by the comma character `","`, and then stores the two returned objects into a label and input_cols variables. For each row, the input (`input_cols`) is passed to the endpoint variable's (`endpoint`) built-in method `invoke()`.
@@ -218,0 +234,32 @@ Suppose the model returns a probability. Probabilities range between integer val
+SageMaker Python SDK v3
+    
+    
+    
+    from time import sleep
+    
+    validate_dataset = "validation_with_predictions.csv"
+    
+    # Cut off threshold of 80%
+    cutoff = 0.8
+    
+    limit = 200  # Need at least 200 samples to compute standard deviations
+    i = 0
+    with open(f"test_data/{validate_dataset}", "w") as validation_file:
+        validation_file.write("probability,prediction,label\n")  # CSV header
+        with open("test_data/validation.csv", "r") as f:
+            for row in f:
+                (label, input_cols) = row.split(",", 1)
+                probability = float(endpoint.invoke(input_cols))
+                prediction = "1" if probability > cutoff else "0"
+                baseline_file.write(f"{probability},{prediction},{label}\n")
+                i += 1
+                if i > limit:
+                    break
+                print(".", end="", flush=True)
+                sleep(0.5)
+    print()
+    print("Done!")
+
+SageMaker Python SDK v2 (Legacy)
+    
+