Skip to content

    AI Architect

    Cloud Platforms for AI: Networking, Identity, Keys, Logs

    Design managed model services on AWS, Azure and Google Cloud: private endpoints, workload identity, customer-managed keys, audit logs and region pinning.

    By Published 28 min read

    Share

    This lesson is part of AI Architect (Advanced): Operate, Secure and Govern. Enroll for free, then sign in, to read it in full.

    What you'll learn: how a managed model service is built from six parts you configure (caller identity, private path, keys, logs, region, capacity), what Amazon Bedrock, Azure OpenAI in Microsoft Foundry Models and Google's Gemini Enterprise Agent Platform each document for them as of 2026-10-23, and what does not port when you move between them.

    At a glance

    Figure 1. The anatomy of a managed model service on any cloud

    Anatomy of a managed model service: caller, identity, private path, keys, logs and regionCaller workload to Identity service (prove identity); Caller workload to Private endpoint (call plus token); Private endpoint to Managed model service (private path); Managed model service to Key service (wrap, unwrap); Managed model service to Audit logs (audit events); Managed model service to Invocation logs (content, if on); Caller workload to Egress deny (blocked route)YOUR NETWORKTHE CHOSEN REGIONCaller workload: your codeCallerworkloadyour codeEgress deny: no other routeEgress denyno other routeIdentity service: tokensIdentityservicetokensPrivate endpoint: private IPPrivateendpointprivate IPManaged model service: provider operatesManaged modelserviceprovider operatesKey service: your keysKey serviceyour keysAudit logs: who did whatAudit logswho did whatInvocation logs: off by defaultInvocationlogsoff by defaultprove identitycall plus tokenprivate pathwrap, unwrapaudit eventscontent, if onblocked route

    How to read this: solid arrows are the request path, dashed arrows are logs, the red dashed arrow is the route the design closes, and the right-hand box is the region boundary that keys and logs must stay inside.

    • A managed model service moves the model host to the provider. Identity, network path, keys, logs and region stay yours to configure.
    • Use a private endpoint plus an egress rule, so the public route is closed and not just unused.
    • Use workload identity (short-lived tokens issued to the running workload) instead of a stored key.
    • Customer-managed keys protect stored data, not a prompt on its way to the model.
    • Audit logs of who changed the service are on by default. Who called is on by default only on AWS. Logs of what was said are off by default.
    • Cross-region routing has three documented levels per cloud. Choose the narrowest one the rule allows.

    The real-world problem

    Composite scenario, not a real company. A regional clinic network adds a visit-summary drafter that calls a managed model. The pilot works from a laptop with a long-lived key and a public address. Security asks four questions: which network path, which identity, which key and which log, and nobody can answer them for production.

    After this page you will be able to

    • Name the six configuration surfaces of a managed model service and the cloud setting that controls each.
    • Choose between a private endpoint, a network rule and a service perimeter for a given exposure.
    • Replace a stored key with workload identity and state how the exposure window shrinks.
    • Explain what a customer-managed key does and does not protect, from each provider's page.
    • Pin inference to a region or a geography, and name the evidence that proves it.
    NOTE

    Everything provider-specific on this page is "as of 2026-10-23" and comes from the provider's own documentation pages, linked where used. Google's pages are titled "Gemini Enterprise Agent Platform" (older /vertex-ai/ links redirect), so this page uses that title. Azure's Entra ID, encryption-at-rest and monitoring pages are the "(classic)" portal versions. No prices appear: check the provider pages.

    Core concepts

    Managed model service versus self-hosted

    Layer Managed model service Self-hosted model
    Model weights and inference software The provider deploys and runs them You deploy and patch them
    Network path to the endpoint Shared: the provider offers private options, you choose them You build it
    Identity and permissions You decide who may call You decide who may call
    What data you send, and classification You You
    Log content (prompts, answers) You choose whether to record it You choose whether to record it
    Capacity and quotas The provider sets and enforces them You buy and schedule GPUs

    How to read this: moving to a managed service moves the model rows to the provider and leaves the identity, data and log rows with you.

    Each provider states the split in its own words, as of 2026-10-23.

    • AWS: "Your responsibility is determined by the AWS service that you use" (security). Model providers have no access to the deployment accounts, so none to Bedrock logs or customer prompts (data protection).
    • Azure: "For all cloud deployment types, you own your data and identities" (shared responsibility; its AI page names three layers: AI platform, AI application, AI usage).
    • Google: "customers always remain responsible for their access policies and data" (shared fate).
    Check yourself: which row of the table do all three providers leave with you, whatever the service model?

    Identity and permissions, and the data you choose to send. Each quote above names data, identities or access policies as the customer's side.

    Control plane and data plane

    Figure 2. Two paths into the same service

    Control plane for configuration and data plane for inferencePlatform admin to Control plane (settings); Control plane to Model deployment (create, change); Caller workload to Data plane (prompt); Data plane to Model deployment (inference); Control plane to Management audit log (events); Data plane to Content log (if enabled)CONTROL PLANE PATHDATA PLANE PATHPlatform adminPlatform adminControl plane: configureControl planeconfigureCaller workloadCallerworkloadData plane: inference callsData planeinference callsModel deployment: provider operatesModeldeploymentprovider operatesManagement audit log: on by defaultManagementaudit logon by defaultContent log: opt inContent logopt insettingscreate, changepromptinferenceeventsif enabled

    How to read this: administrators change the service through one path and callers use it through another, so the permissions, tokens and logs of the two paths are separate things to configure.

    Each provider documents the split, and it shows up in three places.

    Where the split shows AWS Azure Google
    Separate endpoints or tokens bedrock (control plane) and bedrock-runtime (endpoints) A different token audience for management and for inference (doc); the inference roles "don't grant control plane access" Admin Activity versus Data Access audit logs (doc)
    Log category CloudTrail records InvokeModel and Converse as management events (doc) Resource logs need a diagnostic setting (doc) Data Access logs are off by default

    How to read this: each row is a way the plane split appears in practice, as of 2026-10-23.

    AWS writes inference calls into the management-event category. Do not assume a category name tells you what a log contains.

    Private networking

    Figure 3. A private endpoint, private DNS and a closed public route

    Private endpoint with private DNS and a blocked public routeCaller workload to Private DNS (resolve name); Caller workload to Private endpoint (TLS to private IP); Private endpoint to Managed model service (provider backbone); Caller workload to Public endpoint (public route)YOUR PRIVATE NETWORKPROVIDER SERVICECaller workloadCallerworkloadPrivate DNS: returns private IPPrivate DNSreturns privateIPPrivate endpoint: private IPPrivateendpointprivate IPManaged model serviceManaged modelservicePublic endpoint: deny or disablePublicendpointdeny or disableresolve nameTLS to private IPprovider backbonepublic route

    How to read this: the workload resolves the service name to an address inside your network and connects to it, and the red path is what the network rule and the missing internet route must close.

    Job AWS Azure Google
    Private path to the endpoint An interface VPC endpoint with AWS PrivateLink (doc) A private endpoint over Azure Private Link (doc) Private Service Connect endpoints for Google APIs, the private method the overview's table lists for Gemini and Claude (doc)
    Default exposure The default endpoint policy "allows full access to Amazon Bedrock through the interface endpoint" "By default, Foundry Tools resources accept connections from clients on any network" Public names resolve to publicly routable addresses
    Limit who may use it An endpoint policy (principals, actions, resources) Firewall and virtual network rules, "Selected Networks and Private Endpoints" A service perimeter with VPC Service Controls (doc)

    How to read this: each row is one job and the product name each provider's page uses, as of 2026-10-23. The mappings are close, not identical.

    A path and a perimeter are different jobs. Google says VPC Service Controls "can help you mitigate the risk of data exfiltration" with a service perimeter, and lists requests for online inferences and Gemini models among the artifacts that cannot leave it. It also says Private Service Connect for Google APIs and Private Google Access "don't eliminate public internet accessibility for Agent Platform APIs".

    Check yourself: a private endpoint exists, but the app subnet still has an internet route and the service still accepts public connections. Is the data private?

    No. The private path exists, but nothing forces the app to use it. Disable or deny the public path and remove the internet route, so the only way to the service is the private one.

    Workload identity instead of long-lived keys

    AWS Azure Google
    Preferred for a workload IAM roles with temporary credentials (IAM best practices) A managed identity with a role on the resource (doc) A service account attached to the resource, or Workload Identity Federation (doc)
    What the docs say about stored keys Bedrock long-term API keys are "Recommended only for exploration"; short-term keys last "up to 12 hours" (API keys) A service principal needs "a client secret or certificate that you rotate" "Service account keys are a security risk if not managed correctly" (service accounts)

    How to read this: the first row is the credential the docs prefer for running code, the second is what each says about the stored alternative, as of 2026-10-23.

    Customer-managed keys

    What the page lists as protected by a customer-managed key
    AWS (Data encryption) Model customization jobs and their custom models, agents, knowledge-base data-source ingestion jobs, vector stores, model evaluation jobs, and S3 and Secrets Manager data used with them
    Azure (encryption at rest) Data persisted by the service, "specifically training data and fine-tuned models"
    Google (CMEK) A list of resources such as datasets, models, endpoints, batch prediction jobs and indexes; not durable caching (zero data retention)

    How to read this: the right column is what each page names, as of 2026-10-23. None of the three lists a live prompt in transit as something the key encrypts.

    A key you hold governs stored artifacts, and revoking it stops access to them. A prompt in transit is protected by transport encryption and the private path.

    Logging and audit

    Layer What it answers Default, as of 2026-10-23
    Management audit log Who changed the service, from where On: AWS CloudTrail is enabled when the account is created; Azure's activity log is collected automatically; Google's Admin Activity audit logs cannot be disabled
    Call metadata Which principal called which operation, when AWS: recorded by CloudTrail. Google: Data Access logs are off until enabled, and its audit page lists predict and rawPredict, not generateContent. Azure: resource logs need a diagnostic setting
    Content log What the prompt and the answer said Off: AWS invocation logging "is disabled by default"; Google request-response logging (Preview) is disabled by default; Azure's monitoring reference lists a RequestResponse resource-log category without describing its contents

    How to read this: each row is a deeper layer of logging, and the content layer is opt-in on the pages read.

    Check yourself: an auditor asks who called the model last Tuesday, and content logging was never enabled. Can you answer?

    Usually yes, from the management or call-metadata layer, if it was on. You cannot answer what was said.

    Regions, data residency and routing of inference

    Figure 4. Choose the narrowest routing the rule allows

    flowchart TD accTitle: Choosing the inference routing level accDescr: A decision tree. If processing must stay in one named region, use an in-region call with no routing profile, where the provider documents one. If it must stay in a geography, use a geographic profile, a data zone deployment or a multi-region endpoint. If neither restriction applies, global routing is allowed. Each choice is then checked in the audit log. Q1{"Must processing stay in one named region?"} Q2{"Must it stay in a geography?"} A1["Single region: in-region call, no profile, where the provider documents it"] A2["Geography: geographic profile, data zone, multi-region endpoint"] A3["Global routing allowed"] V["Verify with the provider audit log"] Q1 -->|"yes"| A1 Q1 -->|"no"| Q2 Q2 -->|"yes"| A2 Q2 -->|"no"| A3 A1 --> V A2 --> V A3 --> V

    How to read this: start at the top, answer yes or no, and stop at the first box. The last step is the same for all three.

    Level AWS Azure Google
    Narrowest documented In-Region: "Your requests never leave the AWS Region you specify"; cross-Region routing needs an inference profile "Standard": processed in the customer-specified geography, and "might be processed between regions within that geography for operational purposes" Locational endpoint: ML processing stays "within the broader multi-regional or country jurisdiction"
    A geography Geographic cross-Region profile (such as US, EU, APAC): requests "stay within that geography" Data Zone deployments (US, EU or APAC), processed within the data zone Multi-region endpoints: "ML processing stays within that specific geographical region"
    Anywhere Global cross-Region profile: "routed worldwide" Global deployment types: any Azure region The global endpoint: "don't provide any data residency guarantees"

    How to read this: each row is a routing level, and each cell quotes or restates the provider page for it, as of 2026-10-23. Sources: AWS and cross-Region, Azure, Google.

    Only AWS documents a level that is one Region: Azure's and Google's narrowest levels are a geography and a jurisdiction. Only AWS's pages read name an audit field for the processing region. Two documented details change the design:

    • AWS: input prompts and output results "might move outside of your source Region" under geographic profiles, and CloudTrail logs the request in the source Region with the processing Region in additionalEventData.inferenceRegion.
    • Azure: for Global and Data Zone deployments, data stored at rest, "including the abuse monitoring data store", stays in the customer-designated geography. Only the location of processing is affected (data privacy).

    A policy check follows. AWS's IAM example for a US geographic profile allows one inference profile and the foundation model in the source Region and in each destination Region. With the three destination Regions in that example, that is 1 profile + 3 models = 4 resources to allow.

    Quotas and capacity

    Choice What the page says Effect on design
    AWS geographic profile Has its own cross-Region requests and tokens per minute quotas (doc) Check that quota, not the single-Region one
    Azure Standard types "best-effort service" (doc) Handle throttling with one retry owner
    Azure Provisioned types "guaranteed throughput and lower latency variance" Choose for steady, high volume

    How to read this: each row is a capacity fact from a provider page, as of 2026-10-23, with its effect on design.

    Retry ownership, timeouts and fallbacks are on Reliability and scaling.

    The portability layer: a gateway, adapters and what does not port

    Figure 5. One gateway, one adapter per provider

    Model gateway with one adapter per providerOrchestrator to Model gateway; Model gateway to Adapter A; Model gateway to Adapter B; Adapter A to Provider A; Adapter B to Provider BOrchestratorOrchestratorModel gateway: one internal contractModel gatewayone internalcontractAdapter A: auth, names, errorsAdapter Aauth, names,errorsAdapter B: auth, names, errorsAdapter Bauth, names,errorsProvider AProvider AProvider BProvider B

    How to read this: the Orchestrator talks to one internal contract and each adapter hides one provider's details, so a migration changes an adapter and a configuration, not the Orchestrator.

    What differs As documented, 2026-10-23
    How the call is authorised AWS: IAM credentials or a Bedrock API key as a bearer token. Azure: a Microsoft Entra token for a stated audience, or an API key. Google: Google credentials or a federated token from the Security Token Service
    Where the call is addressed AWS: a Regional name such as bedrock-runtime.{region}.amazonaws.com. Azure: the resource's own name, which must be a custom subdomain for Entra tokens. Google: a regional or global endpoint
    What names the model AWS: a model ID or an inference profile ID. Azure: "your deployment name, which can differ from the model name"
    Which operation AWS: Converse, InvokeModel, and OpenAI-compatible Responses and Chat Completions on the runtime endpoint. Google: generateContent for Gemini, rawPredict for Anthropic Claude

    How to read this: each row is something an adapter or a configuration value must absorb. Sources: AWS API keys, AWS logging, Azure, Google.

    Retention and logging defaults also differ, as the sections above show. The pages used here do not compare tool schemas or caching across the three, so treat those as untested until your evaluation set says otherwise.

    Same job, three names

    Job AWS Azure Google
    Managed model service Amazon Bedrock Azure OpenAI in Microsoft Foundry Models Gemini Enterprise Agent Platform
    Private path Interface VPC endpoint, AWS PrivateLink Private endpoint, Azure Private Link Private Service Connect
    Perimeter against exfiltration Endpoint policy (closest match) Network rules (closest match) VPC Service Controls
    Workload identity IAM role, temporary credentials Managed identity, Microsoft Entra ID Attached service account, Workload Identity Federation
    Key service and customer key AWS KMS Azure Key Vault Cloud KMS
    Management audit AWS CloudTrail Azure activity log Cloud Audit Logs: Admin Activity
    Content log Model invocation logging Diagnostic settings (resource logs; contents not described) Request-response logging (Preview)
    Region routing Cross-Region inference profile Deployment type Endpoint location

    How to read this: read across a row for the same job, and treat each cell as a product name from the pages read, not as a claim that the features are equivalent.

    Which control fixes this? (interactive when JavaScript is on)

    A developer copies a long-lived key from a laptop into a container image.

    • A customer-managed key
    • Workload identity with short-lived credentials
    • Invocation logging
    • A bigger quota
    Answer

    Workload identity with short-lived credentials. The risk is a credential that outlives its use and travels in an image. A short-lived credential issued to the running workload removes the stored secret.

    A team says a customer-managed key means nobody can read prompts on their way to the model. Which control addresses prompts in transit?

    • The customer-managed key
    • Transport encryption plus a private endpoint
    • Invocation logging
    • Provisioned capacity
    Answer

    Transport encryption plus a private endpoint. The pages read list stored artifacts as what a customer-managed key protects. Transit is protected by TLS and by keeping the path private.

    After creating a private endpoint, the app subnet can still reach the service through the public internet.

    • Create a second private endpoint
    • Deny the public path and remove the internet route
    • Enable content logging
    • Switch to a global deployment
    Answer

    Deny the public path and remove the internet route. A private path that is optional is not a control. Closing the public path makes it the only path.

    A rule says processing must stay in one named region, on a cloud that documents an in-region level. Which routing level fits?

    • Global profile
    • Geographic profile
    • Single region with no routing profile
    • Any, if the data at rest is in region
    Answer

    Single region with no routing profile. Geographic and data zone options can process in other regions inside the geography. Only the single-region call keeps processing in the named region.

    Case files

    Under the hood: Private networking paths

    Intuition

    A private endpoint puts an address for the service inside your network, and private DNS makes the service's normal name resolve to that address from inside. The request then never needs a route to the public internet.

    Mechanism

    Figure 6. One request over a private endpoint

    sequenceDiagram accTitle: One model request over a private endpoint accDescr: The workload asks the private resolver for the service name and receives the private endpoint address. It opens a TLS connection to that address. The private endpoint forwards the request to the managed model service over the provider network. The response returns the same way. If the workload tries a public route, there is no route and the attempt fails. autonumber participant W as Caller workload participant R as Private resolver participant E as Private endpoint participant S as Managed model service W->>R: resolve the service name R-->>W: private address in your network W->>E: TLS request with a short-lived token E->>S: forward over the provider network S-->>E: response E-->>W: response alt the workload tries the public name outside the private resolver W--xW: no internet route, connection fails end

    How to read this: time runs downward, steps 1 and 2 are the DNS answer that makes the path private, and the alt block is the case the egress rule exists for.

    1. You create the endpoint. AWS says it creates "an endpoint network interface in each subnet that you enable"; Azure says the private endpoint "is assigned an IP address from the IP address range of your virtual network".
    2. DNS resolves the name to that address. AWS: with private DNS enabled, calls to the default Regional name "automatically route through the endpoint", and with it off you must pass the endpoint URL. Azure: the record becomes an alias in a privatelink subdomain, with a private DNS zone holding the A records.
    3. Resolving from outside the network still gives the public address. Azure: "When you resolve the endpoint URL from outside the virtual network with the private endpoint, it resolves to the public endpoint".
    4. The client keeps the same name and authorization. Azure warns that clients must use the resource's custom subdomain and not the internal *.privatelink.openai.azure.com name.
    Quantity Value How it is derived
    Subnets enabled 3 Assumption
    Endpoint services created 2 Assumption: one runtime and one control plane
    Endpoint network interfaces 6 3 x 2, from "one in each subnet that you enable"

    How to read this: each enabled subnet gets its own interface for each endpoint service, so a design with more subnets or services creates more addresses to plan.

    Assumptions: the subnet and service counts are invented. The one-per-subnet rule is from the AWS page, as of 2026-10-23.

    Walk one request through the path, with and without the fix.

    One request: private endpoint and workload identity, with and without the fix (interactive when JavaScript is on)

    With the fix

    1. The workload starts. The container has a platform identity and no stored key. Its subnet has no route to the public internet.
    2. Resolve the name. The private resolver returns the private endpoint's address.
    3. Get a token. The workload asks its identity service for a short-lived token and caches it until shortly before expiry.
    4. Call over the private path. The request goes by TLS to the private address with the token. The service checks the identity's permission.
    5. Response and audit event. The answer returns the same way. The audit log records the principal and the operation, and no content.
    6. Token expires. The next call gets a fresh token. No secret on disk works longer than its lifetime.

    Without the fix

    1. A key in an environment variable. The container holds a long-lived key copied from a laptop. It works from anywhere.
    2. Public name, public address. The workload resolves the public name and connects over the internet.
    3. The key leaks. A log line, a backup or a pasted command exposes it. Nothing expires it until someone notices.
    4. Anyone can call. A caller outside your network uses the key on the public endpoint. The audit log shows your key and cannot say who used it.
    Check yourself: with the private path in place, resolving the service name from a laptop on the office network returns the public address. Is that a fault?

    No, it is expected: private DNS answers only inside the network that hosts it. If the office should also use the private path, it needs a route and DNS forwarding or delegation for the private zone.

    What this means for architects

    What changes What you do
    Private DNS answers only inside its network Plan DNS for on-premises and other networks, and test resolution from each
    The endpoint is a new component with its own policy Attach a policy or network rule naming the principals and actions allowed
    A private path does not close the public one Deny or disable the public path and remove the internet route
    Each enabled subnet gets an address Size subnets for endpoints and watch the count

    Under the hood: Workload identity and short-lived credentials

    Intuition

    The workload proves who it is to an identity service, which hands back a credential that expires soon. The model service trusts that credential, so no long-lived secret has to sit in your code.

    Mechanism

    Figure 7. Token exchange, then the call

    sequenceDiagram accTitle: Workload identity token exchange and model call accDescr: The workload presents proof of its platform identity to the token service, which verifies it and returns a short-lived token. The workload calls the model service with the token. The service checks the permission and writes an audit event with the principal. When the token expires the workload repeats the exchange. autonumber participant W as Caller workload participant T as Token service participant S as Managed model service participant A as Audit log W->>T: present platform identity or external token Note over T: Verify the identity and the trust setup T-->>W: short-lived token W->>S: model request with the token Note over S: Check the permission for this principal S-->>W: response S-)A: audit event with the principal Note over W: Token expires, so the workload repeats step 1

    How to read this: steps 1 and 2 are the exchange, step 3 is the call, and the note at the end is why a leaked token stops working on its own.

    1. The workload shows what the platform knows about it. On AWS compute, "AWS delivers the temporary credentials of an IAM role to that compute resource"; outside AWS, IAM Roles Anywhere (a certificate) or STS (a web token or SAML assertion) can issue them.
    2. Azure: Azure "assigns it to an Azure resource" and "rotates its credentials for you", and the client requests "a short-lived access token". Google: Workload Identity Federation follows "the OAuth 2.0 token exchange specification": you "provide a credential from your IdP to the Security Token Service", which returns a federated token.
    3. The call carries the token, and the service checks the permission granted to that identity: for example Azure's "Cognitive Services OpenAI User" role.
    4. The audit log records the principal, not a shared key.
    Credential Lifetime Expected remaining validity when it leaks
    Key rotated every 90 days 2,160 hours 1,080 hours (half the lifetime)
    Short-term token, 12 hours 12 hours 6 hours
    Ratio 1,080 / 6 = 180 times

    How to read this: if a credential leaks at a random moment in its life and nobody revokes it, it stays useful for half its lifetime, so a shorter life shrinks the window in proportion.

    Assumptions: the 90-day rotation is invented. The 12-hour figure is AWS's documented maximum for short-term Bedrock API keys, as of 2026-10-23. The model assumes a uniform leak time and no detection.

    Check yourself: why does the Azure troubleshooting table suggest waiting up to five minutes after assigning a role before debugging a 403?

    Role assignments are not instant. A caller that has the right role can still be denied until the assignment propagates, so retrying briefly is correct before changing anything.

    What this means for architects

    What changes What you do
    No stored key to leak Remove keys from images, environment files and CI variables
    A token has an audience Use separate identities for administration and for inference
    Tokens expire Cache and refresh before expiry; do not fetch one per call
    Each workload gets its own principal Give each service its own least-privilege role, so the audit log names who called

    Under the hood: Customer-managed keys and envelope encryption

    Intuition

    Data is encrypted with a data key, and the data key is itself encrypted by a key you control. Taking away the key you control makes the stored data unreadable without rewriting the data.

    Mechanism

    Figure 8. Envelope encryption, and what revoking does

    sequenceDiagram accTitle: Envelope encryption and key revocation accDescr: The model service asks the key service for a data key, receives a plaintext copy and a copy wrapped by your key, encrypts the stored artifact with the plaintext copy, discards it and stores the wrapped copy beside the ciphertext. To read the artifact later the service asks the key service to unwrap the data key. If you have revoked the key, the unwrap is refused and the read fails. autonumber participant S as Managed model service participant K as Key service participant D as Stored artifact S->>K: request a data key under your key K-->>S: data key in plaintext and wrapped S->>D: store ciphertext and the wrapped key Note over S: Discard the plaintext data key S->>K: unwrap the data key to read alt your key is enabled and permitted K-->>S: data key else you revoked the key K-->>S: refused Note over S: The read fails end

    How to read this: steps 1 to 3 create the envelope, step 4 is the read, and the alt block is what revocation changes.

    1. AWS KMS defines envelope encryption as "the practice of encrypting plaintext data with a data key, and then encrypting the data key under another key". KMS keys "never leave" the KMS hardware security modules "unencrypted", so using one means calling KMS.
    2. The wrapped data key is stored beside the data. AWS notes you can "safely store the encrypted data key alongside the encrypted data".
    3. Rotating the key does not rewrite the data. Azure: "Rotating the key doesn't trigger re-encryption of data in the resource."
    4. Revoking changes what can be read. Azure: revoking an active key "will prevent downloading of training data and results files, fine-tuning new models, and deploying fine-tuned models", while "previously deployed fine-tuned models will continue to operate". Google, for serving-profile keys (Gemini Live and Interactions APIs): requests that need protected data "fail with a FAILED_PRECONDITION error that indicates the key is unavailable".
    Operation Without envelopes With envelopes
    Re-protect 1,000 artifacts of 50 MB Re-encrypt 1,000 x 50 MB = 50,000 MB (50 GB) Re-wrap 1,000 data keys of 32 bytes = 32,000 bytes of key material

    How to read this: re-wrapping the small keys is far less work than re-encrypting the data, which is the benefit AWS lists for envelope encryption.

    Assumptions: 1,000 artifacts and 50 MB are invented. 32 bytes is a 256-bit key; the table ignores wrapping overhead. Decimal units.

    What this means for architects

    What changes What you do
    A key protects what the page lists as stored Read each provider's list before promising "encrypted with our key"
    Prompts in transit are not in those lists Rely on TLS and the private path for transit
    Revoking has documented effects that differ Rehearse revocation in a test account and write down what stops
    Key and resource often share a region Azure requires the same region and tenant. Google's training CMEK needs the key ring in the resource's region, and serving profiles a us or eu multi-region key

    Under the hood: Logging and audit trails in a managed AI service

    Intuition

    Two questions get different logs. Who did what is a small, durable audit record. What was said is the prompt and answer, and that is personal data the moment you store it.

    Mechanism

    Figure 9. Three layers of logs and where each one goes

    Management audit, call metadata and content logs routed to a protected storeManaged model service to Management audit; Managed model service to Call metadata; Managed model service to Content log (if enabled); Management audit to Log store; Call metadata to Log store; Content log to Redaction; Redaction to Log storeLOG LAYERSManaged model serviceManaged modelserviceManagement audit: on by defaultManagementauditon by defaultCall metadata: varies by cloudCall metadatavaries by cloudContent log: off by defaultContent logoff by defaultRedaction: before storageRedactionbefore storageLog store: in region, retentionLog storein region,retentionif enabled

    How to read this: the first two layers go straight to the store, and the content layer passes through redaction first. Redaction before storage is the design from the security page.

    1. Management events are recorded without setup. AWS: CloudTrail "is enabled on your AWS account when you create the account", and inference operations such as InvokeModel and Converse are management events. Google: Admin Activity logs cannot be disabled.
    2. Call metadata can need setup. Google: Data Access logs are off until you "explicitly enable them". Azure: resource logs "aren't collected and stored until you create a diagnostic setting".
    3. Content logging is a separate switch. AWS: model invocation logging "is disabled by default", logs "are stored until the logging configuration is deleted", only the same account and Region are supported as destinations. Calls through the bedrock-mantle endpoint "are not currently captured".
    4. Google's request-response logging (Preview) writes full_request and full_response to a BigQuery table, with a sampling fraction between 0 and 1. Its VPC Service Controls page says request and response logging "isn't available with VPC Service Controls".
    Layer Record size Records per day Volume per day Volume per year
    Metadata only 0.5 KB 100,000 50 MB 18.25 GB
    With content 8 KB 100,000 800 MB 292 GB
    Ratio 16 times

    How to read this: content logs are 16 times larger here, and each of those bytes is also personal data to protect.

    Assumptions: the record sizes and request count are invented, in decimal units. 100,000 x 0.5 KB = 50,000 KB = 50 MB; 50 MB x 365 = 18,250 MB = 18.25 GB; 100,000 x 8 KB = 800 MB; 800 MB x 365 = 292,000 MB = 292 GB.

    Check yourself: a team enables content logging and then enables a service perimeter. What do they need to check first on Google?

    Whether the two can be combined. Google's page lists request and response logging as not available with VPC Service Controls, so the team must pick a different evidence source or revisit the perimeter.

    What this means for architects

    What changes What you do
    The audit questions have default answers, the content question does not Decide the content-logging policy in the design review and record it
    Content logs hold personal data Redact before storage, restrict reads, set retention (PII in logs, security)
    Retention defaults differ, and logs may last until deleted Set retention on purpose, using the audit-trail rules
    Some endpoints are not covered Test that your calls appear in the log you rely on

    Decision framework

    Figure 10. Which platform control for which exposure

    flowchart TD accTitle: Choosing a platform control for an exposure accDescr: Start with the exposure. If a stored credential exists, move to workload identity. If the endpoint is reachable from the public internet, add a private endpoint and close the public path. If processing must stay in a region or geography, pin it and verify it in the audit log. If prompts or answers are stored in logs, redact them and set retention. If stored artifacts need your control, add a customer-managed key. S(["Find the exposure"]) Q1{"Is a long-lived key stored anywhere?"} Q2{"Is the endpoint reachable from the public internet?"} Q3{"Must processing stay in a region or geography?"} Q4{"Do logs hold prompts or answers?"} Q5{"Do stored artifacts need your key?"} A1["Workload identity with short-lived credentials"] A2["Private endpoint, deny public path, no internet route"] A3["Pin the region and verify in the audit log"] A4["Redact before storage, set retention"] A5["Customer-managed key, rehearse revocation"] S --> Q1 Q1 -->|"yes"| A1 Q1 -->|"no"| Q2 A1 --> Q2 Q2 -->|"yes"| A2 Q2 -->|"no"| Q3 A2 --> Q3 Q3 -->|"yes"| A3 Q3 -->|"no"| Q4 A3 --> Q4 Q4 -->|"yes"| A4 Q4 -->|"no"| Q5 A4 --> Q5 Q5 -->|"yes"| A5

    How to read this: go top to bottom and apply each control you reach, because the fixes stack and the order puts credentials and exposure first.

    If Then Because Revisit when
    A workload holds a long-lived key Move to workload identity The exposure window shrinks from the key lifetime to the token lifetime A system outside the cloud needs access
    The model endpoint is public Add a private endpoint and close the public path A private path that is optional is not a control A new network or on-premises site connects
    A rule names a region or geography Choose the narrowest routing level and verify it in the audit log Wider levels can process elsewhere inside their boundary A provider changes the documented behaviour
    A feature stores prompts or answers Redact before storage and set retention Content logs are personal data A regulator or contract changes retention
    Stored artifacts need your control Add a customer-managed key and rehearse revocation Keys govern what the page lists as stored A new resource type is added

    Comparison of the main options

    Option What it constrains Strength Limit
    Public endpoint with an access key Who knows the key Fastest to start Key leaks; open from anywhere
    Public endpoint with workload identity Who holds a valid token No stored secret Still reachable from the internet
    Private endpoint with workload identity Path and caller Closes the public route and the stored key DNS and routing to plan
    Service perimeter (Google) or network rules (Azure) Which networks and projects may call Limits exfiltration and callers Can limit features, such as Google content logging
    Customer-managed key Access to stored artifacts Revocation and audit of key use Does not cover prompts in transit

    Failure scenarios to design for

    Failure What the system does Why
    Private DNS is not reachable from another network The call fails closed or is denied by the network rule Private DNS answers only inside its network
    A role was just assigned The caller retries briefly, then alerts Azure documents up to five minutes to apply
    The key is disabled or unavailable Requests needing protected data fail with a clear error and an alert Google documents FAILED_PRECONDITION for serving-profile keys
    Inference is routed outside the allowed region The audit check finds it and raises an incident Geographic and global routing can process elsewhere
    Content logging captures personal data Redaction, retention and access limits cap the exposure Content logs are personal data
    A call uses an endpoint the log does not cover A pipeline test fails AWS documents that bedrock-mantle calls are not captured by invocation logging

    Worked example

    Assumptions:

    • A service makes 40,000 requests a day and must keep processing in one region.
    • AWS-style geographic profile with 3 destination Regions, as in the AWS IAM example.
    • Content logs are off, so the audit check relies on the provider audit log.
    Quantity Value Calculation
    Resources to allow for one geographic profile 4 1 profile + 3 destination models
    Regions a Region allow-list must permit 3 against 1 3 destination Regions for the profile (or an inference-profile exception), 1 for a single-Region call
    Daily events the audit job scans 40,000 One per request
    Out-of-region events expected 0 Single-Region calls only
    Events per year 14,600,000 40,000 x 365

    How to read this: a single-Region design allows fewer Regions, and the audit job checks every event, not a sample.

    The residency claim is a count, not an opinion: 14,600,000 events a year, each checked.

    A pre-deployment guard for a model endpoint

    The sketch rejects a configuration with a stored key, a public path, a region outside the allowed set or unredacted content logging. Field names are invented: map them to your platform.

    ALLOWED_REGIONS = {"region-a"}
    
    
    def check_endpoint(cfg: dict) -> list:
        """Return a list of problems with a model-endpoint configuration."""
        problems = []
        if cfg.get("auth") != "workload_identity":
            problems.append("use workload identity, not a stored key")
        if cfg.get("static_keys"):
            problems.append("remove stored keys from the deployment")
        if not cfg.get("private_endpoint"):
            problems.append("add a private endpoint")
        if cfg.get("public_access", True):
            problems.append("disable or deny the public path")
        if cfg.get("internet_egress", True):
            problems.append("remove the internet route from the workload subnet")
        if cfg.get("routing") not in {"single_region"}:
            problems.append("routing must be single_region for this rule")
        if cfg.get("region") not in ALLOWED_REGIONS:
            problems.append("region is not in the allowed set")
        if cfg.get("content_logging") and not cfg.get("redaction"):
            problems.append("content logging needs redaction before storage")
        if cfg.get("content_logging") and cfg.get("log_region") != cfg.get("region"):
            problems.append("log store must be in the same region")
        return problems

    Run it in CI and fail the build on any problem. It checks configuration, not behaviour, so keep the audit-log check as the runtime proof.

    Common mistakes

    • Treating a private endpoint as the whole fix. Close the public path too.
    • Keeping a long-lived key "just for CI". Federate the CI identity.
    • Saying "encrypted with our key" about everything. Name the stored artifacts the key covers.
    • Turning on content logging without a privacy plan. Redact and set retention first.
    • Assuming geographic routing equals one region. Check the audit log.
    • Assuming a migration is a URL change. Authorization, addressing, model names and logging defaults differ.

    Try it

    Time: 30 to 40 minutes. Pick one cloud and one model feature you know, or invent a small one.

    1. Draw Figure 1 for your feature with your component names.
    2. For each of the six parts write the setting that controls it, from the provider's page.
    3. Write the routing level your rule needs and the audit field that proves it.
    4. Write one sentence on what a customer-managed key does and does not protect for your feature.

    Done when each of the six parts has a named setting and source link, your region rule has audit evidence, and no stored key remains.

    Key takeaways

    • Six parts configure a managed model service: identity, private path, keys, logs, region and capacity.
    • Use workload identity: a stored key is exposed for its lifetime, a token for its short life.
    • A private endpoint is a control only when the public path is closed.
    • A customer-managed key governs stored artifacts, not prompts in transit.
    • Audit logs answer who acted. Content logs answer what was said, and are opt-in personal data.
    • Pin inference to the narrowest level the rule allows, and verify the processing region in the audit log.
    • Put one adapter per provider behind a gateway, and treat what you did not test as not portable.

    Self-check

    1. Why is a private endpoint alone not enough?

    Nothing forces the workload to use it. Deny or disable the public path and remove the internet route, so the private path is the only one.

    2. What does a customer-managed key protect, according to the pages read, and what does it not?

    The stored artifacts each provider lists, such as custom models, datasets and indexes. None of the pages lists a live prompt in transit, which TLS and a private path protect.

    3. How much shorter is the expected exposure with a 12-hour token than with a key rotated every 90 days?

    180 times: expected remaining validity is half the lifetime, 1,080 hours against 6, and 1,080 / 6 = 180.

    4. A rule says processing must stay in one named region. Why is a geographic profile or data zone not enough?

    Those levels can process in other regions inside their boundary. Only a single-region call, checked against the audit log, keeps processing in the named region, and only AWS documents one. Azure's and Google's narrowest levels are wider.

    5. Name two things that differ between providers and must be absorbed by an adapter.

    For example authorisation, addressing, model names, operation names and logging defaults.

    Further reading

    Last verified: 2026-10-23

    Next

    Page 15 is the capstone: two full designs that apply the whole course, Capstone: Two Full AI System Designs.

    Enroll to keep reading

    Lesson 6 of 7 · AI Architect (Advanced): Operate, Secure and Govern

    Design managed model services on AWS, Azure and Google Cloud: private endpoints, workload identity, customer-managed keys, audit logs and region pinning.

    In the rest of this lesson

    • Case files
    • Under the hood: Private networking paths
    • Under the hood: Workload identity and short-lived credentials
    • Under the hood: Customer-managed keys and envelope encryption
    • Under the hood: Logging and audit trails in a managed AI service
    • Decision framework

    Enrolling is free. It unlocks every lesson in AI Architect (Advanced): Operate, Secure and Govern, tracks your progress across devices and keeps your quiz scores. The newsletter is optional.

    Ask about this article

    Get answers grounded in this post. AI-generated — based on this article, and may be imperfect.

    Scaled AI Weekly

    Enjoyed this? Get more like it every Monday.

    Real architecture decisions, LLMOps patterns that survive production, and engineering leadership advice — from 12+ years of building at enterprise scale. Free. No spam. Unsubscribe anytime.

    Get new articles by email

    Free. We email a confirmation link first, and you can unsubscribe from any email.

    Join engineers building production AI systems

    Comments