ladderlore
Request a guide
  • Type a service name, like S3 or IAM.

Operating, Monitoring, and Securing ML and AI Solutions

Review sheet

04

Operating, Monitoring, and Securing ML and AI Solutions

The main points of this domain on a few screens, to reread before the exam.

4.1Drift and data checks

  • Model Monitor: data capture, baseline, schedule, report, alarm. Closed to new customers since July 30, 2026, with Clarify.
  • Four monitors: data quality, model quality, bias drift, feature attribution drift.
  • Data quality needs inputs only. Model quality also needs ground truth labels.
  • Schedule runs a Processing job every hour to every 24 hours. Report: constraint_violations.json in S3.
  • Model Monitor: tabular data and single-model endpoints only.
  • Covariate shift: inputs change. Label shift: answer rates change. Concept drift: the input-to-answer link changes.
  • Concept drift shows only through falling quality once labels arrive.

4.1Drift and data checks

  • Text and images: compare embeddings against the training baseline.
  • Continuous

    KS test
  • Categorical

    Chi-square
  • Binned shares

    PSI: over 0.25 is a large shift
  • Any distribution

    JS divergence
  • Text and images

    Embedding distance
Pick the drift test by feature type.

4.1Generative AI, agents and workflows

  • Bedrock metrics in AWS/Bedrock need no setup: invocations, latency, errors, throttles, token counts.
  • Throttled calls are not counted in Invocations. Alarm on InvocationThrottles.
  • Invocation logging is off by default. Targets: S3, CloudWatch Logs or both. Bodies over 100 KB go to S3.
  • FM quality: sample live traffic, score with a judge, publish a metric, alarm. AgentCore Evaluations does this for agents.
  • Stop reason max_tokens means a truncated answer.
  • Agent traces: AgentCore Observability to CloudWatch. Enable Transaction Search once. Spans and logs need enabling.
  • Loop: the same steps repeat while tokens climb. Cap steps and session time.

4.1Generative AI, agents and workflows

  • Step Functions, Pipelines and Glue failures go to EventBridge, then SNS or Lambda. Endpoint 5XX: alarm on it.
  • DevOps Guru has been closed to new customers since October 29, 2026.

4.2Instances, capacity and metrics

  • CPU (C, M) for tabular and light models. R for large in-memory data. Graviton needs an Arm build.
  • GPU (G, P) for deep nets and LLMs. Weights must fit in GPU memory: 7B parameters at 16-bit need about 14 GB.
  • Inferentia and Trainium: compile with the Neuron SDK first.
  • Inference Recommender: Default job within 45 minutes. Advanced job about 2 hours with your traffic and targets.
  • It reports cost per hour, cost per inference, latency, and a starting instance count.
  • Many idle models: multi-model endpoint. Rare or spiky traffic: serverless endpoint.

4.2Instances, capacity and metrics

  • SageMaker quotas are per instance type, Region and use. Quota error: raise it. Capacity error: change type, zone or Region, or reserve.
  • Bedrock RPM and TPM both apply. The max tokens value counts toward throttling. 429: backoff, cross-Region profile, quota.
  • ModelLatency is in microseconds, inside the container. OverheadLatency is SageMaker time. GPU metrics: /aws/sagemaker/Endpoints.
  • Tabular, light models

    C or M (CPU)
  • Large in-memory data

    R
  • Vision and mid-size LLMs

    G (GPU)
  • Very large LLMs

    P (GPU)
  • Supported models, low cost

    Inf or Trn
Instance family by workload.

4.2Cost and purchasing

  • Tag resources, then activate the tags in Billing. Not retroactive. Allow up to 24 hours.
  • Budgets alert and can act. Cost Explorer groups by tag. Trusted Advisor flags idle resources.
  • Bedrock cost: application inference profile per app, IAM principal per user, request metadata plus logs per call.
  • SageMaker AI Savings Plans: up to 64 percent, 1 or 3 years, across families and Regions.
  • Managed Spot training: up to 90 percent off. Needs checkpoints in S3. MaxWaitTimeInSeconds above MaxRuntimeInSeconds.
  • A reservation guarantees capacity. A Savings Plan lowers price.
  • Provisioned Throughput bills by the hour: it wins for steady, high traffic. On-demand suits spiky traffic.

4.2Cost and purchasing

  • Cut FM cost: prompt caching, prompt routing, batch (about 50 percent lower for select models), max tokens, answer cache.
  • Smaller or distilled models and fewer, reranked RAG chunks also cut tokens.
  • Steady endpoints and jobs

    SageMaker AI Savings Plan
  • Restartable training

    Managed Spot
  • Unknown or short use

    On-Demand
  • Guaranteed GPUs for a period

    Capacity reservation
Purchasing option by how steady and interruptible the work is.

4.3Roles, access and credentials

  • Execution role: SageMaker assumes it. Trust policy names sagemaker.amazonaws.com.
  • The caller needs iam:PassRole on that role, with iam:PassedToService. One role per persona.
  • Condition keys can force VPC, network isolation and KMS settings on jobs.
  • Least privilege: S3 prefixes per stage, KMS key policy or grant, split register and approve, ABAC tags, Lake Formation columns.
  • bedrock:InvokeModel covers Converse. Model ARNs have no account. A cross-Region profile needs the profile and each model.
  • No Model access page: block models with an IAM or SCP deny. Force a guardrail with bedrock:GuardrailIdentifier, or an Organizations policy.

4.3Roles, access and credentials

  • Role Manager is closed to new customers since July 30, 2026.
  • Production: IAM role. Short-term API key: up to 12 hours. Long-term key: exploration only.
  • Limit keys with iam:CreateServiceSpecificCredential and bedrock:CallWithBearerToken. Store secrets in Secrets Manager.
Runs on AWS compute?
IAM role
Quick test or tool?
Short-term key
Long-term key with expiry
yesnopreferredlast resort
Which credential for Bedrock.

4.3Network, audit and troubleshooting

  • Private subnets. S3 gateway endpoint. Interface endpoints for ECR, Logs and Bedrock. NAT only for the internet.
  • Studio VPC-only mode: no internet. Jobs from Studio need their own VPC settings.
  • Network isolation blocks all network calls from the container.
  • Encrypt: training volume key, output key, endpoint config key, inter-container traffic. Enforce TLS.
  • SageMaker control-plane calls and Bedrock InvokeModel and Converse are CloudTrail management events.
  • Agent calls, Retrieve and ApplyGuardrail are data events: off by default.
  • CloudTrail has no prompt text. Use model invocation logging, and protect those logs.

4.3Network, audit and troubleshooting

  • Config rules check KMS and internet settings. Macie finds personal data in S3. Model Cards and lineage are evidence.
  • Timeouts mean network. Denials mean permissions. Tools: CloudTrail message, policy simulator, Access Analyzer, Flow Logs.
  • Denied on CreateTrainingJob

    Missing PassRole
  • Denied reading encrypted data

    KMS key policy
  • Image pull times out

    No ECR or S3 endpoint
  • Bedrock call times out

    No interface endpoint
  • Job cannot call any API

    Network isolation on
First suspect for each symptom.

4.3Safeguards and risks

  • Content filters: six categories, strength none, low, medium or high. Prompt Attack checks prompts only.
  • Denied topics: a subject you define. Word filters: exact words. PII filter: block or mask, set per direction.
  • Contextual grounding: grounding and relevance thresholds from 0 to 0.99, checked on responses.
  • ApplyGuardrail works with any model, or on text alone.
  • Streaming: synchronous is safer. Asynchronous is faster, and cannot mask PII.
  • Edit the working draft, then pin applications to a numbered version.
  • Risks: poisoning, model theft, inversion, adversarial inputs, prompt injection, supply chain, excessive agency.

4.3Safeguards and risks

  • Inspector scans ECR images and Lambda. CodeArtifact controls packages. Gate deploys on Critical and High findings.
  • CodeGuru Reviewer: no new associations since November 7, 2025. CodeGuru Security ended November 20, 2025.
  • Content filters

    Block harm and prompt attacks
  • Denied topics

    Keep off a subject
  • Sensitive information

    Block or mask PII
  • Contextual grounding

    Catch answers not in the source
  • Automated Reasoning

    Check answers against logic rules
Guardrail policy for each need.

Exam traps

  • “Throttled Bedrock calls missing from the Invocations metric” → alarm on InvocationThrottles, not Invocations
  • “Monitor drift on a multi-model endpoint” → a custom check, not Model Monitor
  • “Inputs changed, no labels yet” → covariate shift and a feature test, not model quality
  • “Same inputs, customers behave differently” → concept drift, seen through falling quality
  • “Bedrock cost per application” → application inference profile with activated tags, not a budget alone
  • “Tags applied but missing in Cost Explorer” → activate them as cost allocation tags

Exam traps

  • “Restartable training, cut cost by up to 90 percent” → managed Spot with checkpoints, not a Savings Plan
  • “Guarantee GPUs for a fixed week” → a capacity reservation, not a Savings Plan
  • “Not authorized to perform iam:PassRole” → add PassRole for the caller, not a new trust policy
  • “S3 read denied though the bucket policy allows it” → KMS key policy, not S3
  • “Private-subnet job times out pulling the image” → ECR and S3 VPC endpoints, not a security group fix
  • “Production Lambda calls Bedrock” → IAM role, not a long-term API key

Exam traps

  • “Who invoked the model, and what did they send?” → CloudTrail for who, invocation logs for what
  • “Block unapproved models in every account” → an SCP deny on InvokeModel, not a model access page