Securing AI Systems on AWS
This lesson explains how AI workloads are secured with the same AWS foundations as any other workload, plus controls for AI-specific threats such as prompt injection, data leakage and poisoning.
Learning outcomes
After completing this lesson, you will be able to:
- Apply the shared responsibility model to AI workloads.
- Explain how the Generative AI Security Scoping Matrix assigns security responsibilities.
- Identify the core security controls for AI systems.
- Identify the services that monitor and audit AI workloads, such as Bedrock model invocation logging.
Shared responsibility
The shared responsibility model applies to AI workloads just as to other AWS services. AWS secures the cloud itself: the infrastructure and the managed services, including the hosting of models in Bedrock. You secure what you do in the cloud: your data, who may call which models, the prompts you send, how outputs are used, and the configuration of your application. For example, AWS protects the servers that run a model, but you decide whether sensitive data may be included in prompts. The following table summarises the division.
| AWS secures (security of the cloud) | You secure (security in the cloud) |
|---|---|
| Infrastructure and managed services, including Bedrock model hosting | Your data, access, prompts, application and configuration: who calls which models, what data you send and how outputs are used |
Whose responsibility?
The Generative AI Security Scoping Matrix
The matrix divides generative AI use cases into five scopes. Your security responsibilities grow from scope 1 to scope 5, so a ready-made application leaves you the least to secure and a self-trained model the most.
In scopes 1 and 2, you use an application someone else built: a public consumer application, such as a public chat app, or an enterprise application licensed for your organisation, such as Amazon Quick or Kiro. You mainly control what data your staff share with it. In scope 3, you build your own application on pre-trained models, for example by calling Bedrock, so you also secure the application and its prompts. In scope 4, you fine-tune a model on your data, so you also protect that training data and the customised model. In scope 5, you train a model from scratch and are responsible for everything, including the full training data set. The following table summarises the scopes.
| Scope | Use case | Example |
|---|---|---|
| 1 | Consumer application | A public chat app |
| 2 | Enterprise application | Amazon Quick, Kiro |
| 3 | Pre-trained models in your app | Your app calling Bedrock |
| 4 | Fine-tuned models | Your customised model |
| 5 | Self-trained models | A model you trained from scratch |
The following diagram shows how responsibility grows across the five scopes.

The five scopes
Core security controls
AI systems use the same core security controls as other workloads. For identity and access, IAM roles with least-privilege policies decide who can do what; for example, an application's role may be allowed to invoke only specific models, and permissions for training data, customisation and inference can be kept separate. For encryption, KMS keys protect training data, custom models and knowledge bases at rest, and TLS protects data in transit.
For the network, AWS PrivateLink provides private connections to Bedrock and SageMaker AI from a VPC, without the internet, and SageMaker can run in your VPC with network isolation. For sensitive data, Amazon Macie finds personal information in S3 training data so it can be masked or removed. For agents, AgentCore Identity manages credentials, AgentCore Policy sets the boundaries of their actions, and Guardrails checks their inputs and outputs. The following table summarises the controls.
| Control | How |
|---|---|
| Identity and access | IAM roles and least-privilege policies, e.g. an app's role may invoke only specific model IDs; separate permissions for training data, customisation and inference |
| Encryption | AWS KMS keys at rest (training data, custom models, knowledge bases); TLS in transit |
| Network | AWS PrivateLink (interface VPC endpoints) to Bedrock and SageMaker AI; SageMaker in your VPC with network isolation |
| Sensitive data | Amazon Macie finds PII in S3 training data to mask or remove |
| Agents | AgentCore Identity for credentials; Policy in AgentCore for action boundaries; Guardrails for inputs and outputs |
Core controls
AI-specific threats and controls
AI systems also face threats of their own, each with matching controls. Prompt injection and jailbreaks are countered by the Guardrails prompt attack filter and by validating input. Data leakage, where a model reveals information it should not, is countered by personal-information filters, least-privilege access and never putting secrets in prompts. Toxic output is countered by content filters.
Model and data poisoning, where attackers corrupt training data or knowledge sources, is countered by using trusted, validated data sources with known lineage. Model theft or misuse is countered by access control and monitoring. Hallucinations are countered by grounding answers with RAG, contextual grounding checks, validating outputs and confidence scoring. The following table summarises the threats and controls.
| Threat | Control |
|---|---|
| Prompt injection and jailbreaks | Guardrails prompt attack filter, input validation |
| Data leakage | PII filters, least privilege, no secrets in prompts |
| Toxic output | Content filters |
| Model and data poisoning | Trusted, validated data sources with known lineage |
| Model theft or misuse | Access control and monitoring |
| Hallucinations | RAG grounding, contextual grounding checks, output validation, confidence scoring |
Monitoring and audit
Several services record what happens in AI workloads, for security monitoring and audits. Bedrock model invocation logging records the prompts sent to models and the responses returned, to CloudWatch Logs or S3, which lets you review how a model is being used. AWS CloudTrail records who called which API, such as who changed a guardrail. Amazon CloudWatch provides metrics, logs and alarms, for example on unusual usage, and Amazon Inspector finds vulnerabilities in the compute and code that run AI applications. The following table summarises the services.
| Service | Records or detects |
|---|---|
| Bedrock model invocation logging | Prompts and responses, to CloudWatch Logs or S3 |
| AWS CloudTrail | Who called which API |
| Amazon CloudWatch | Metrics, logs and alarms |
| Amazon Inspector | Vulnerabilities in compute and code |
Who did what?
Securing a Bedrock application end to end
A healthcare company builds an assistant on Bedrock. Its security review works through the layers the customer is responsible for:
| Layer | Control |
|---|---|
| Who can call which model | IAM policy allowing bedrock:InvokeModel only on the approved model ARN, for the application's role only |
| Network path | Interface VPC endpoint (PrivateLink) for Bedrock; no internet route from the application |
| Training and knowledge base data | Macie scan removed patient identifiers; S3 and the knowledge base encrypted with a KMS customer managed key |
| Inputs and outputs | Guardrails: prompt attack filter, PII masking |
| Audit | Model invocation logging to an encrypted S3 bucket; CloudTrail for API calls |
| Vulnerabilities | Amazon Inspector for the application's compute and container images |
{
"Effect": "Allow",
"Action": ["bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream"],
"Resource": ["arn:aws:bedrock:us-east-1:111122223333:inference-profile/us.amazon.nova-2-lite-v1:0",
"arn:aws:bedrock:*::foundation-model/amazon.nova-2-lite-v1:0"]
}Under the shared responsibility model, AWS secures the infrastructure and the model hosting; everything in this table is the customer's part.
When an application uses Amazon Bedrock, who is responsible for its data, prompts and access permissions?
Show answer
The customer, who controls the data, prompts, IAM permissions and application security. AWS secures the underlying infrastructure and the service.
Exam Tips
Remember for the exam
- AWS secures the cloud infrastructure, and you secure your data, access and usage (the shared responsibility model).
- To assign security duties by generative AI use case, use the Generative AI Security Scoping Matrix and its five scopes.
- For private connectivity to Bedrock without the internet, use PrivateLink (an interface VPC endpoint).
- To restrict which models an application can call, write an IAM policy on model IDs.
- To find PII in training data in S3, use Amazon Macie.
- For an audit trail of prompts and responses use model invocation logging; for API calls use CloudTrail.
- To encrypt custom models and training data with your own keys, use AWS KMS.