All guides
Practice now
D5 · Security, compliance, and governance

applied to AI

The same principle that governs security in the cloud in general applies to AI services — but with an extra layer: prompts, generated content, and the base model itself introduce new lines of responsibility that don't exist in traditional compute or storage.

The model applied to AI

AWS is responsible for the AI compute infrastructure, and for the security and availability of the base foundation model. The customer is responsible for their prompts and the data they send to the model, for access control (IAM) to the AI services, and for regulatory compliance of their specific use case.

The difference from the "classic" IaaS/PaaS/SaaS model is that in AI there's a new object to protect: the prompt (what you send the model) and the generated response. Neither existed as a security concept in traditional compute.

Why this matters on the exam

A frequent AIF-C01 question presents a data-leak scenario or inappropriate content generated by a model, and asks you to identify whether the failure is AWS's or the customer's. The correct answer is almost always "the customer" — because AWS doesn't control what you send the model or how you configure access.

Responsibility matrix in AI

Who is responsible for each layer when you use AI services on AWS.

LayerResponsible
Physical infrastructure (GPUs, servers, datacenters)AWS
Weights and security of the base foundation modelAWS
Service availability (SLA)AWS
Tenant isolation (your data doesn't train other customers' models)AWS
Prompts you send to the modelCustomer
Data used for fine-tuning or RAGCustomer
Access control (IAM) to the AI servicesCustomer
Guardrails configuration / content filtersCustomer
Regulatory compliance of the use case (HIPAA, GDPR, PCI DSS)Customer
Auditing who invokes which model (CloudTrail enabled)Customer
Encryption of training data and model artifactsShared
Bias detection in the model trained by the customerCustomer

What is ALWAYS each party's responsibility

Regardless of whether you use Bedrock (managed model) or SageMaker (your own model), these responsibilities don't change.

AWS is ALWAYS responsible for:

  • Compute infrastructure: GPUs, servers, physical network, and datacenters where the AI service runs
  • Base foundation model security: That the pre-trained model Bedrock offers hasn't been compromised or tampered with
  • Platform availability: SLAs for the service: Bedrock, SageMaker, and the pre-trained AI services
  • Tenant isolation: That your prompts and data don't mix with or train other customers' models

The customer is ALWAYS responsible for:

  • The prompts it sends: What information is included in the text sent to the model — including whether it exposes sensitive data
  • Its own training/context data: Datasets for fine-tuning, documents for RAG — their classification and protection
  • Access control (IAM): Who can invoke a model, create an endpoint, or access a Knowledge Base
  • Compliance of its use case: If it processes medical, financial, or minors' data, complying with the applicable regulation

Icon-Architecture/48/Arch_Amazon-Bedrock_48 Case: Amazon Bedrock — managed model

Bedrock gives you access to already-trained foundation models via API. It's the "SaaS" equivalent in the AI world: AWS manages most of the stack.

AWS manages:

  • Training and weights of the foundation model
  • Service infrastructure and scaling
  • Isolation between customer accounts
  • Regional availability of the model

You manage:

  • The content of your prompts
  • Bedrock Guardrails configuration
  • Which documents your Knowledge Base (RAG) connects to
  • IAM permissions for who can invoke the model
  • If you fine-tune the model, your training data

Case: — your own model

With SageMaker you train and deploy your own model. It's more like "IaaS": you have more control, and therefore more responsibility.

AWS manages:

  • The hardware where training and endpoints run
  • Infrastructure isolation between customers
  • Availability of the SageMaker platform

You manage:

  • Training data (quality, bias, classification)
  • The architecture and quality of the trained model
  • Detecting and correcting bias (with SageMaker Clarify)
  • Encryption of model artifacts (with KMS)
  • Permissions for who can access the deployed endpoint
  • Documenting the model with Model Cards

Breach scenario: prompt without Guardrails

Realistic case

A fintech builds an internal assistant with Bedrock so support agents can summarize a customer's history before a call. To save time, a developer pastes the customer's full account number, ID, and transaction history directly into the prompt — without masking any data — and doesn't configure to filter sensitive information in the responses.

Weeks later, an application log (poorly protected, with overly broad access due to an over-permissive IAM role) gets exposed. That log contains the full prompts, including the unmasked financial data.

Who is responsible? The customer, at every point in the chain: they decided what to include in the prompt, didn't configure Guardrails to mask PII, and configured an IAM role with excessive permissions over the logs. AWS delivered a functional model and secure infrastructure — none of those three decisions were under its control.

Identity and Policy in AgentCore

When an acts autonomously (calling APIs, executing actions, invoking other tools), you need to manage identity and specific permissions for that agent — not just for the human user who invoked it.

  • • AgentCore Identity: manages who or what the agent is — its own identity, separate from the user who invoked it — and how it authenticates against other services
  • • Policy in AgentCore: defines which actions that agent is allowed to execute on behalf of the user or application, applying the same principle of least privilege that IAM applies to human identities

Toxicity and other risks to filter in the model's output

Besides prompt injection on the input, there are risks that appear in the model's output and that must be filtered before showing it to the end user.

  • • Toxicity: offensive, hateful, or abusive language generated by the model, even without the user explicitly requesting it
  • • Biased or discriminatory content in the generated text
  • • Leakage of sensitive or confidential information included in the prompt or in the RAG context

includes configurable toxicity filters as part of its content-moderation function.

Source citation and data lineage

Documenting where the data used to train or give context to a model comes from (data lineage) is key for traceability and auditing — especially when you have to answer "why did the model say this?" or "which document did this response come from?".

  • • document a model's training data origin in a structured way
  • • A data catalog records which datasets exist, where they come from, and how they've been transformed before reaching the model
  • • In RAG systems, citing the exact source (document, section) a response came from lets the user verify it

Hallucination detection and grounding

Beyond RAG in general, there are concrete techniques to reduce and detect hallucinations before they reach the user.

  • • RAG grounding: anchoring the model's response in real documents retrieved on the spot, instead of relying only on what the model "remembers" from its training
  • • Output validation: validating the model's output (for example, against the retrieved sources or against business rules) before showing it to the user
  • • Confidence scoring: a confidence score attached to the response, letting you decide whether to show it directly, request human review, or reject it

Shared responsibility and compliance in AI

You can inherit AWS certifications for the infrastructure, but compliance for your specific use case is still yours — especially if you process regulated data.

What AWS certifies (infrastructure)

  • ISO 27001: Information security management
  • SOC 1/2/3: Service organization controls
  • HIPAA (with a BAA): Services eligible for US health data
  • GDPR: Data-processing tools and agreements

What you still need to do

  • Avoid sending unmasked sensitive data in a prompt
  • Configure Guardrails appropriate to your use case
  • Apply the principle of least privilege in IAM
  • Encrypt training data and artifacts with KMS
  • Audit access to AI services with CloudTrail
  • Verify whether your use case requires a signed BAA or DPA with AWS

Did you get this topic?

Test what you just learned

A company uses Amazon Bedrock for an internal chatbot. An employee includes a customer's confidential medical information directly in a prompt, without masking it, and that information ends up exposed in logs with overly open IAM permissions. Under the shared responsibility model, who is responsible for this breach?

Ready to test "Shared responsibility applied to AI"?

Put what you learned to the test with original AIF-C01 exam questions.

Start AIF-C01 mock exam

Unlimited mock exams with the Pro plan

Log in to track your progress.