Keeping Data Private When Sending It to AI Services
This lesson explains how Amazon Bedrock handles prompts and responses, how interface VPC endpoints keep traffic private, and how data residency and minimisation reduce what leaves the application.
Learning outcomes
After completing this lesson, you will be able to:
- Explain why Amazon Bedrock does not use prompts for training or share them with model providers.
- Describe how interface VPC endpoints, private DNS and endpoint policies secure calls to Bedrock.
- Explain how cross-Region inference affects data residency.
- Identify ways to minimise the sensitive data sent to AI services and developer tools.
How Amazon Bedrock handles data
Amazon Bedrock does not use prompts or completions to train any foundation model and does not share them with model providers. Each provider's model runs in a model deployment account that the Bedrock service team owns; Bedrock copies the provider's software into it, and the provider has no access to that account, its logs or customer prompts. Requests require TLS 1.2 or later, and resources that Bedrock stores for you, such as custom models, knowledge base data and agent configuration, can be encrypted with a customer managed AWS KMS key.
For exam questions, a requirement that "inputs and outputs must not be used to train models" or "must not be shared with the model provider" is met by using Bedrock as it is. No opt-out setting is needed, and answers that add one usually describe controls that do not exist.
Bedrock and your data
Private connectivity with AWS PrivateLink
By default, SDK calls reach Bedrock's public endpoints over TLS. A function in private subnets therefore needs a NAT gateway, and its traffic leaves the VPC. An interface VPC endpoint, powered by AWS PrivateLink, places network interfaces for the service in the VPC's subnets, so traffic stays on the AWS network. The following table lists the endpoints a developer is most likely to need.
| Endpoint service name | Used for |
|---|---|
com.amazonaws.region.bedrock-runtime | Model inference: Converse, InvokeModel, ApplyGuardrail |
com.amazonaws.region.bedrock | Control plane: guardrails, logging configuration, model information |
com.amazonaws.region.bedrock-agent-runtime | Knowledge base retrieval and InvokeAgent |
com.amazonaws.region.bedrock-agentcore | Invoking AgentCore agents and tools |
With private DNS enabled, the service's usual hostname resolves to the endpoint's private addresses, so SDK code needs no change. The endpoint's security group must allow HTTPS (port 443) from the function's security group. An endpoint policy limits what can be done through the endpoint, for example only bedrock:InvokeModel on one model by one role, and an IAM condition on aws:SourceVpce can deny calls that do not arrive through the endpoint.
aws ec2 create-vpc-endpoint --vpc-endpoint-type Interface \
--vpc-id vpc-0abc1234 --service-name com.amazonaws.eu-west-1.bedrock-runtime \
--subnet-ids subnet-0aaa1111 subnet-0bbb2222 --security-group-ids sg-0ccc3333 \
--private-dns-enabledData residency and minimisation
Cross-Region inference trades locality for capacity. A geographic inference profile may process a request in any Region of its geography, such as several European Regions, and a global profile in any supported commercial Region, although data at rest stays in the source Region. A workload whose prompts must be processed in one Region calls the in-Region model ID, and a workload restricted to one geography uses only that geography's profile.
The most effective privacy control is to send less. The application sends only the fields the model needs, replaces direct identifiers such as names and account numbers with internal references, and masks remaining PII before the request, for example with a guardrail's sensitive information filter applied to the input through ApplyGuardrail.
Keep prompts private
Data protection in developer tools
Prompts sent from developer tools can contain source code and data too. In Kiro, content from free and individual users may be used to improve the service unless the user opts out in the telemetry and content settings, while enterprise users are opted out automatically. A .kiroignore file keeps credentials, customer data and other sensitive files out of the agent's context, and teams avoid pasting production data into prompts.
A private claims assistant
An insurer's Lambda function summarises claim notes with Bedrock. The function runs in private subnets with no NAT gateway, traffic must not traverse the internet, and claim notes must be processed only in the EU.
The developer creates an interface endpoint for bedrock-runtime with private DNS and an endpoint policy that allows only the function's role to invoke one model.
The function calls an EU geographic inference profile rather than a global one, and before each call it masks policyholder names and phone numbers with ApplyGuardrail. No setting is added to prevent training on the notes, because Bedrock never uses them for training.
A Lambda function in private subnets with no NAT gateway times out when calling Converse. What is missing?
Show answer
A path to the service: an interface VPC endpoint for bedrock-runtime with private DNS enabled and a security group that allows HTTPS from the function.
Exam Tips
Remember for the exam
- Bedrock never trains on prompts or shares them with providers; no setting is needed.
- Private subnets without internet access: an interface endpoint for bedrock-runtime with private DNS.
- Limit what can be invoked through the endpoint: a VPC endpoint policy.
- Single-Region processing: use the in-Region model ID, not a cross-Region profile.