# Sagemaker Endpoint Auditor

> Audits SageMaker real-time and async endpoints for security posture and production readiness — KMS encryption-at-rest and inter-container traffic encryption, execution-role blast radius (wildcard actions, sagemaker:*, iam:PassRole), VPC configuration (internet-facing vs private), data capture and model monitoring schedule coverage, and instance count for high availability. Emits a deterministic verdict (NO_ENCRYPTION | OVERPERMISSIVE_ROLE | NO_MONITORING | PUBLIC_ENDPOINT | CONFIG_GAP | OK) per endpoint with enumerated findings and CLI remediation. Use when reviewing SageMaker endpoints before production deployment, checking endpoint encryption posture, auditing execution-role scope, validating VPC configuration, verifying model monitoring coverage, or checking instance count for high availability.

- Skill: `jhkchan/sagemaker-endpoint-auditor` (Agent Skill, multi-file: 20 files)
- Install (CLI): `npx get-skill add jhkchan/sagemaker-endpoint-auditor`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jhkchan/sagemaker-endpoint-auditor/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- License: Apache-2.0
- Author: jhkchan (https://skillmd.com/u/jhkchan)
- Updated: 2026-11-23
- Page: https://skillmd.com/skills/jhkchan/sagemaker-endpoint-auditor

---


# SageMaker Endpoint Auditor

## Mindset

**One-line takeaway:** a SageMaker endpoint is a running model exposed behind
an invocation API. Its security posture is the intersection of **three
independent resource objects** — the Model, the EndpointConfig, and the
Endpoint — and the most common audit mistake is checking only one of them.

A SageMaker real-time endpoint is not a single object. The security-relevant
fields are split across a resource chain:

- **Model** (`DescribeModel`) — holds `ExecutionRoleArn` (the IAM role the
  container assumes), `VpcConfig` (network placement), `EnableNetworkIsolation`
  (container egress control), and the container image spec.
- **EndpointConfig** (`DescribeEndpointConfig`) — holds `KmsKeyId` (encryption
  at rest), `ProductionVariants` (instance type + count), `DataCaptureConfig`
  (request/response capture for monitoring), and
  `EnableInterContainerTrafficEncryption`.
- **Endpoint** (`DescribeEndpoint`) — holds `EndpointStatus` (InService /
  Updating / Failed), `FailureReason`, and the resolved variant instance counts.
- **MonitoringSchedule** (`ListMonitoringSchedules`) — optionally attached to
  the endpoint for drift detection (data quality, model quality, bias,
  explainability).

An audit that checks only the EndpointConfig misses the execution role and VPC
placement (both live on the Model). An audit that checks only the Model misses
encryption and data capture (both live on the EndpointConfig). **Always resolve
the full chain.**

## Quick reference — verdict thresholds

| Condition | Verdict | Step |
|---|---|---|
| No `VpcConfig` on the Model (endpoint is internet-facing) | **PUBLIC_ENDPOINT** | 1 |
| `VpcConfig` present but `SecurityGroupIds` allow `0.0.0.0/0` inbound | **PUBLIC_ENDPOINT** | 1 |
| No `KmsKeyId` on EndpointConfig | **NO_ENCRYPTION** | 2 |
| Inference pipeline (multi-container) + `EnableInterContainerTrafficEncryption: false` | **NO_ENCRYPTION** | 2 |
| Execution role with `Action: "*"` on `Resource: "*"` | **OVERPERMISSIVE_ROLE** | 3 |
| Execution role with `sagemaker:*` / `s3:*` / `iam:*` on `"*"` | **OVERPERMISSIVE_ROLE** | 3 |
| Execution role with `iam:PassRole` on `"*"` | **OVERPERMISSIVE_ROLE** | 3 |
| No `DataCaptureConfig` (or `EnableCapture: false`) AND no `MonitoringSchedule` | **NO_MONITORING** | 4 |
| `EnableCapture: true` but `InitialSamplingPercentage: 0` | **NO_MONITORING** | 4 |
| `InitialInstanceCount < 2` (single instance — no HA) | **CONFIG_GAP** | 5 |
| All dimensions pass | **OK** | 6 |

**Precedence (worst finding wins):**
PUBLIC_ENDPOINT > NO_ENCRYPTION > OVERPERMISSIVE_ROLE > NO_MONITORING > CONFIG_GAP > OK

## Pre-flight: endpoint metadata gate

Before evaluating the endpoint configuration, classify the endpoint state.
Several endpoint attributes short-circuit the audit.

| Attribute | Value | Effect on audit |
|---|---|---|
| `EndpointStatus` | `InService` | Proceed with full audit. |
| `EndpointStatus` | `Updating` | Proceed, but note that config may be mid-change. Re-audit after update completes. |
| `EndpointStatus` | `Failed` | Endpoint deployment failed. Note `FailureReason`. Still audit the config (the security findings may explain the failure). |
| `EndpointStatus` | `Deleting` | Endpoint is being torn down. Audit for forensic record only. |
| Endpoint type | Real-time | Full audit applies. |
| Endpoint type | Async | Full audit + check `AsyncInferenceConfig.OutputConfig.S3OutputPath` is encrypted (KMS on the bucket). |
| Endpoint type | Serverless | No instance count dimension (scale-to-zero). Skip Step 5 instance-count check. VPC config still applies. |

**If the configuration bundle is incomplete** (missing Model, EndpointConfig,
or Endpoint metadata), output:

```text
ENDPOINT: <name>
VERDICT: ERROR
REASON: Cannot resolve the full Model -> EndpointConfig -> Endpoint resource chain — <missing object>.
REMEDIATION: Retrieve all three objects: aws sagemaker describe-model --model-name <name>, aws sagemaker describe-endpoint-config --endpoint-config-name <config>, aws sagemaker describe-endpoint --endpoint-name <name>.
```

## Process — Classification logic (apply in order, aggregate worst)

### Step 0: Expert knowledge — non-obvious SageMaker behaviors

Non-obvious SageMaker behaviors — VpcConfig lives on the Model, network isolation vs VpcConfig, inter-container encryption only for pipelines, TLS-by-default invocation, execution role on the Model, capture vs monitoring, zero sampling, instance counts, serverless/async exceptions, monitor types, Clarify vs Model Monitor, async S3 output — live in [references/advanced-patterns.md](references/advanced-patterns.md).
Load that reference before classifying an endpoint.

### Step 1: VPC configuration — PUBLIC_ENDPOINT (highest severity)

If the Model has no `VpcConfig` (absent or empty), the endpoint is deployed on
AWS-managed public infrastructure — **the invocation API is internet-facing**.
Any client with the endpoint URL and valid AWS credentials can invoke the
model. This is the most exposed posture.

```text
VERDICT: PUBLIC_ENDPOINT
REASON: Model has no VpcConfig — endpoint is deployed on internet-facing
infrastructure. The InvokeEndpoint API is reachable from any network.
```

**Security-group refinement:** if `VpcConfig` IS present, inspect the
`SecurityGroupIds`. A security group with an inbound rule allowing `0.0.0.0/0`
on any port makes the endpoint effectively public within the VPC. Flag as
PUBLIC_ENDPOINT.

**EnableNetworkIsolation note:** a Model with no `VpcConfig` but
`EnableNetworkIsolation: true` prevents the container from making outbound
calls, but the endpoint API is STILL internet-reachable for invocation. The
PUBLIC_ENDPOINT verdict stands — network isolation restricts egress, not
ingress to the endpoint API.

### Step 2: Encryption — NO_ENCRYPTION

Evaluate two encryption dimensions:

**2a. KMS encryption at rest.** Check `KmsKeyId` on the EndpointConfig. If
absent, the EBS volumes attached to the endpoint instances and the model
artifact storage are unencrypted at rest. A compromised instance or snapshot
exposes model weights and artifacts.

- No `KmsKeyId` on EndpointConfig → **NO_ENCRYPTION**.

**2b. Inter-container traffic encryption (inference pipelines only).** If the
Model has multiple containers (a `SerialInferencePipeline` — check
`Containers` array length > 1 or `PrimaryContainer` + the inference pipeline
config), check `EnableInterContainerTrafficEncryption` on the EndpointConfig.

- Multi-container endpoint + `EnableInterContainerTrafficEncryption: false`
  → **NO_ENCRYPTION** (plaintext traffic between containers on the same host).
- Single-container endpoint → this flag is a no-op. Do NOT flag.

**2c. Async output S3 encryption (additive).** For async endpoints, if
`AsyncInferenceConfig.OutputConfig.S3OutputPath` points to an S3 bucket
without SSE-KMS encryption, append an additive NO_ENCRYPTION finding.

### Step 3: Execution role blast radius — OVERPERMISSIVE_ROLE

Evaluate the Model's `ExecutionRoleArn` trust policy (the identity-based
policy attached to the role). The execution role determines what AWS resources
the model container can access at runtime. Apply the same classification as
the iam-least-privilege-advisor:

- `Action: "*"` on `Resource: "*"` → **OVERPERMISSIVE_ROLE** (admin-equivalent
  — the container can do anything in the account).
- Service wildcard on `"*"` (`sagemaker:*`, `s3:*`, `iam:*`, `kms:*`,
  `secretsmanager:*`) → **OVERPERMISSIVE_ROLE**. The execution role only needs
  narrow permissions (InvokeEndpoint, S3 GetObject on model artifacts, KMS
  Decrypt on the endpoint key). Service wildcards are always over-scoped.
- `iam:PassRole` on `"*"` → **OVERPERMISSIVE_ROLE** (privilege escalation —
  the container can pass any role to any service).
- `NotAction` / `NotResource` → **OVERPERMISSIVE_ROLE** (inverse wildcards).
- Named actions on specific ARNs → pass this step.

**The SageMaker execution-role minimum-viable permission set:**
`sagemaker:InvokeEndpoint` (self), `s3:GetObject` on the model artifact
bucket/prefix, `kms:Decrypt` on the endpoint KMS key, and optionally
`logs:CreateLogStream` / `logs:PutLogEvents` on the CloudWatch log group.
Anything beyond this scope should be justified by the model's runtime
behaviour (e.g., calling a downstream API, reading a feature store).

If no execution-role policy document is provided, note:
"Execution-role policy not provided — cannot evaluate IAM blast radius.
Retrieve with `aws iam list-attached-role-policies --role-name <name>` and
`aws iam get-role-policy --role-name <name> --policy-name <name>`."

### Step 4: Monitoring coverage — NO_MONITORING

Evaluate two monitoring dimensions:

**4a. Data capture.** Check `DataCaptureConfig` on the EndpointConfig.

- No `DataCaptureConfig` → data capture is disabled.
- `EnableCapture: false` → data capture is disabled.
- `EnableCapture: true` but `InitialSamplingPercentage: 0` → effectively
  disabled (zero requests captured).

**4b. Monitoring schedule.** Check for a `MonitoringSchedule` referencing the
endpoint name.

- No monitoring schedule → no drift detection.
- Monitoring schedule with `Status: Stopped` → schedule exists but is inactive.

**Classification:**
- No data capture AND no monitoring schedule → **NO_MONITORING**.
- Data capture enabled but no monitoring schedule → **NO_MONITORING** (capture
  alone provides no alerts; the data sits idle without a schedule to analyse
  it).
- Monitoring schedule exists but data capture disabled → **NO_MONITORING**
  (the schedule has no data to analyse — Model Monitor cannot function without
  captured request/response payloads).
- Both data capture (with sampling > 0) AND an active monitoring schedule →
  pass this step.

### Step 5: Instance count / HA — CONFIG_GAP

Check `InitialInstanceCount` (or `CurrentInstanceCount` if available) on the
endpoint's `ProductionVariants`.

- `InitialInstanceCount < 2` → **CONFIG_GAP** (single instance — no high
  availability. If the instance fails, the endpoint goes down with no
  fallback. Production endpoints should have at least 2 instances across
  different Availability Zones).
- Serverless endpoint → skip this step (scale-to-zero by design).
- Async endpoint with `InitialInstanceCount: 1` → note as CONFIG_GAP but
  acknowledge the cost-optimisation trade-off (async endpoints can scale to
  zero; flag only if the endpoint serves latency-sensitive production
  traffic).

### Step 6: All dimensions pass — OK

If all of the following hold:
- Model has `VpcConfig` with restrictive security groups.
- EndpointConfig has `KmsKeyId`.
- (Multi-container endpoints have `EnableInterContainerTrafficEncryption: true`).
- Execution role has named actions on specific ARNs (no wildcards).
- Data capture is enabled with sampling > 0 AND an active monitoring schedule
  exists.
- `InitialInstanceCount >= 2` (or serverless/async with justification).

→ **VERDICT: OK**

### Step 7: Aggregation

The final verdict is the **worst finding** across all steps, where:
PUBLIC_ENDPOINT > NO_ENCRYPTION > OVERPERMISSIVE_ROLE > NO_MONITORING > CONFIG_GAP > OK

All individual findings are listed in the FINDINGS section regardless of the
aggregate verdict.

## Output format (per endpoint)

```text
ENDPOINT: <endpoint-name>
VERDICT: PUBLIC_ENDPOINT | NO_ENCRYPTION | OVERPERMISSIVE_ROLE | NO_MONITORING | CONFIG_GAP | OK
REASON: <1-2 sentences citing the worst finding and its step number>
FINDINGS:
  - [PUBLIC_ENDPOINT] <finding description (Step N)>
  - [NO_MONITORING] <finding description (Step N)>
  - [OK] <dimension that passed>
REMEDIATION: <specific CLI action per finding, or "None required" if OK>
```

### Worked example — public endpoint with no monitoring

```text
ENDPOINT: public-endpoint-no-vpc
VERDICT: PUBLIC_ENDPOINT
REASON: Model has no VpcConfig — the endpoint is deployed on internet-facing
infrastructure (Step 1). Data capture is also disabled with no monitoring
schedule (Step 4).
FINDINGS:
  - [PUBLIC_ENDPOINT] No VpcConfig on Model — InvokeEndpoint API reachable
    from any network (Step 1)
  - [NO_MONITORING] No DataCaptureConfig and no MonitoringSchedule — drift
    undetectable (Step 4)
  - [OK] KmsKeyId present on EndpointConfig (Step 2)
  - [OK] Execution role scoped to named actions (Step 3)
REMEDIATION:
  1. Attach a VpcConfig to the Model:
     aws sagemaker create-model --model-name <name> --containers <spec>
       --vpc-config Subnets=<subnet-ids>,SecurityGroupIds=<sg-ids>
  2. Enable data capture on the EndpointConfig and create a monitoring
     schedule (see Remediation guidance below).
```

## Anti-Patterns — NEVER

- NEVER conclude an endpoint is "private" or "VPC-attached" by checking only
  the EndpointConfig. `VpcConfig` lives on the **Model** — the EndpointConfig
  has no VPC fields. Checking the wrong object is the most common false
  negative in SageMaker endpoint audits.

- NEVER flag `EnableInterContainerTrafficEncryption: false` on a
  **single-container** endpoint. There is no inter-container traffic to
  encrypt. The flag is a no-op. Flagging it is a false positive that erodes
  trust.

- NEVER classify an endpoint without `VpcConfig` but with
  `EnableNetworkIsolation: true` as "private." Network isolation blocks
  container **egress**; it does not prevent inbound invocation. The
  InvokeEndpoint API is still internet-reachable. The verdict is
  PUBLIC_ENDPOINT.

- NEVER assume the execution role is on the EndpointConfig or Endpoint. It is
  on the **Model** (`ExecutionRoleArn`). Scanning the wrong object yields no
  role and a silent pass on the IAM dimension.

- NEVER treat `EnableCapture: true` as "monitoring enabled." Data capture
  stores request/response payloads to S3 — it provides no alerts. A
  MonitoringSchedule is required to analyse the captured data and emit drift
  findings. Both must be present.

- NEVER accept `InitialSamplingPercentage: 0` as valid data capture. Zero
  percent sampling captures zero requests. The operator may believe monitoring
  is active when it is silently inert.

- NEVER flag a serverless endpoint for `InitialInstanceCount` being absent or
  below 2. Serverless endpoints use `ServerlessConfig` (memory size + max
  concurrency), not instance count. The HA dimension does not apply.

- NEVER assume `EndpointStatus: Failed` means the endpoint has no security
  findings. A failed deployment often fails BECAUSE of a security
  misconfiguration (e.g., execution role missing `sagemaker:CreateModel`,
  VPC lacking S3 VPC endpoint for model artifacts). Audit the config — the
  security finding may explain the failure.

- NEVER recommend `sagemaker:*` as a remediation for the execution role. The
  execution role needs `sagemaker:InvokeEndpoint` at most — `sagemaker:*`
  grants model/endpoint creation and deletion, which the container never
  needs at runtime. This reintroduces the exact blast radius being constrained.

- NEVER overlook the async OutputConfig S3 path for async endpoints. Async
  inference outputs are written to the configured S3 path. If the bucket
  lacks SSE-KMS, outputs are unencrypted at rest — a silent data-exposure gap.

- NEVER treat SageMaker Clarify enablement as a substitute for Model Monitor.
  Clarify runs at build time (pre-training bias, explainability baselines).
  Model Monitor runs at inference time (runtime drift detection). They are
  different services with different triggers.

- NEVER conflate `InitialInstanceCount` (EndpointConfig) with
  `CurrentInstanceCount` (DescribeEndpoint runtime). Auto-scaling can change
  the count after deployment. For HA auditing, prefer the runtime value when
  available.

## Pre-flight safety checks (run before any remediation CLI)

The full pre-flight safety checklist — confirm gate, Model/EndpointConfig immutability, snapshot for rollback, caller permission check, VPC endpoint prerequisites — lives in [references/diagnostic-commands.md](references/diagnostic-commands.md).
Run these before any remediation CLI.

## Remediation guidance

### For PUBLIC_ENDPOINT — no VpcConfig

1. Create a new Model version with VpcConfig:
   ```bash
   aws sagemaker create-model --model-name <name>-vpc \
     --execution-role-arn <role-arn> --primary-container <container-spec> \
     --vpc-config Subnets=subnet-abc,subnet-def,SecurityGroupIds=sg-xyz \
     --enable-network-isolation
   ```
2. Create a new EndpointConfig referencing the new model.
3. Update the endpoint (blue/green):
   ```bash
   aws sagemaker update-endpoint --endpoint-name <name> \
     --endpoint-config-name <new-config>
   ```
4. Verify the endpoint is now VPC-attached:
   ```bash
   aws sagemaker describe-model --model-name <name>-vpc --query 'VpcConfig'
   ```

### For NO_ENCRYPTION — no KMS key

1. Create a new EndpointConfig with a customer-managed KMS key:
   ```bash
   aws sagemaker create-endpoint-config --endpoint-config-name <name>-enc \
     --production-variants <variants> \
     --kms-key-id arn:aws:kms:us-east-1:<acct>:key/<key-id>
   ```
2. For inference pipelines, add
   `--enable-inter-container-traffic-encryption`.
3. Update the endpoint to the new config.
4. For async endpoints, ensure the OutputConfig S3 bucket has SSE-KMS enabled.

### For OVERPERMISSIVE_ROLE — wildcard execution role

1. Replace wildcard actions with the minimum-viable permission set:
   ```json
   {
     "Version": "2012-10-17",
     "Statement": [{
       "Effect": "Allow",
       "Action": [
         "sagemaker:InvokeEndpoint",
         "s3:GetObject"
       ],
       "Resource": [
         "arn:aws:sagemaker:us-east-1:<acct>:endpoint/<name>",
         "arn:aws:s3:::<model-bucket>/<prefix>/*"
       ]
     }]
   }
   ```
2. Add KMS decrypt scoped to the endpoint key if the endpoint uses SSE-KMS.
3. Derive the exact action set from CloudTrail (90-day window of
   `userIdentity.arn` matching the execution role).

### For NO_MONITORING — no data capture or schedule

1. Create a new EndpointConfig with DataCaptureConfig:
   ```bash
   aws sagemaker create-endpoint-config --endpoint-config-name <name>-cap \
     --production-variants <variants> \
     --data-capture-config EnableCapture=true,InitialSamplingPercentage=100,DestinationS3Uri=s3://<bucket>/capture/,CaptureOptions=[{CaptureMode=Input},{CaptureMode=Output}]
   ```
2. Update the endpoint to the new config.
3. Create a monitoring schedule:
   ```bash
   aws sagemaker create-monitoring-schedule \
     --monitoring-schedule-name <name>-dq-monitor \
     --endpoint-name <name> \
     --monitoring-type DataQuality \
     --monitoring-job-definition <job-def>
   ```

### For CONFIG_GAP — single instance

1. Update the endpoint weights and capacities:
   ```bash
   aws sagemaker update-endpoint-weights-and-capacities \
     --endpoint-name <name> \
     --desired-weights-and-capacities variantName=<variant>,DesiredInstanceCount=2
   ```
2. For async endpoints with justified scale-to-zero, document the
   cost-optimisation trade-off and suppress the finding.

### For OK

1. No remediation required.
2. Recommend verifying the monitoring schedule is producing results:
   `aws sagemaker describe-monitoring-schedule --monitoring-schedule-name <name>`.
3. Recommend reviewing captured data quarterly to confirm sampling is
  representative.

## Recent AWS features (2024-2026)

Recent AWS features 2024-2026 — Inference Components, zero-downtime updates, HyperPod, Unified Studio, EKS-based inference — live in [references/advanced-patterns.md](references/advanced-patterns.md).
Load when auditing endpoints built on these features.

## References (load on demand)

- [references/advanced-patterns.md](references/advanced-patterns.md) — Step-0 non-obvious SageMaker behaviors and recent AWS features (2024-2026)
- [references/diagnostic-commands.md](references/diagnostic-commands.md) — pre-flight safety checks and rollback commands before any remediation

## Domain

AWS CloudOps / SageMaker AI/ML Security & Production Readiness.

## AWS documentation

- **Amazon SageMaker Developer Guide** — https://docs.aws.amazon.com/sagemaker/latest/dg/whatis.html
- **Security** — https://docs.aws.amazon.com/sagemaker/latest/dg/security.html
- **SageMaker API Reference** — https://docs.aws.amazon.com/sagemaker/latest/APIReference/
- **AWS CLI reference (sagemaker)** — https://docs.aws.amazon.com/cli/latest/reference/sagemaker/
- **Inference Components** — https://docs.aws.amazon.com/sagemaker/latest/dg/inference-components.html

