Courseiva
AIF-C01Chapter 4 of 16Objective 2.1

Security, Governance, and Compliance for AI

Security, governance, and compliance for AI — this is the invisible fence that keeps your AI projects safe from trespassers, mistakes, and legal trouble. For the AIF-C01 exam, you need to know how AWS protects your AI data and models, and how you can use those same tools to follow the rules. Without this, your AI could get hacked, leak private data, or land your company in court.

12 min read
Intermediate
Updated Jul 23, 2026
Reviewed by Johnson Ajibi· Senior Network & Security Engineer · MSc IT Security

A simple way to picture Security, Governance, and Compliance for AI

The 24-Hour Pop-Up Bakery Analogy

You and your friend decide to open a pop-up bakery in a shared commercial kitchen for exactly 24 hours. You have 3 ovens, 2 mixers, and 1 fridge, all rented from the kitchen owner.

The first thing you do is lock the kitchen door and decide who has which key. You give your friend a key to the main door, but you keep the key to the fridge that holds the expensive imported chocolate. That is Identity and Access Management (IAM) — you are deciding who can enter and what they can unlock inside.

Next, your friend accidentally leaves a tray of croissants out overnight. By morning, they are stale. But the kitchen owner has a rule: every tray that goes into the oven must be photographed and logged with a timestamp. You check the log and see that the croissants were left out at 11 p.m. That is Cloud Logging — you have a record of every action, so you can audit what went wrong.

Finally, you store your secret recipe for vegan brownies in a locked drawer. Even if someone sneaks into the kitchen, they cannot read the recipe without the combination. That is Encryption — scrambling your data so only someone with the right key (the combination) can unscramble it.

Without the lock on the door (IAM), the logbook (logging), and the locked drawer (encryption), your pop-up bakery would be chaos. Anyone could steal your recipe, use your oven, or spoil your ingredients without anyone knowing.

How It Actually Works

When you build an AI workload on AWS, you are essentially renting a slice of a giant computer — the cloud. But that giant computer is shared by millions of other customers. Security, governance, and compliance are the systems that ensure your data stays yours, your AI behaves predictably, and you obey the law. Let us break down each part.

Identity and Access Management (IAM) is the system that controls who can do what inside your AWS account. Think of it as the bouncer at a nightclub. Every person (or computer) that tries to access your AWS resources must prove who they are (authentication) and then the bouncer checks a list of what they are allowed to do (authorisation). In IAM, you create users (people), groups (teams), and roles (a temporary identity for a computer or service). You attach policies (written rules) to them that say things like "allowed to read from this S3 bucket" or "allowed to launch this specific AI model." For AI workloads, this is critical because your AI model might be a valuable piece of intellectual property. You do not want a junior developer accidentally deleting it, and you do not want an attacker stealing it. IAM lets you give each person or system the absolute minimum access they need — this is called the principle of least privilege, and AWS loves to test it.

Encryption is like a secret code. When your data is stored anywhere in the cloud (at rest), or when it is moving between your computer and the cloud (in transit), encryption scrambles it so that only someone with the right key can read it. On AWS, you have several encryption options. The simplest is server-side encryption using Amazon S3-managed keys (SSE-S3), where AWS handles the key for you. More control comes with AWS Key Management Service (AWS KMS), where you create and manage your own encryption keys. For top-secret data, you can even use AWS CloudHSM, which gives you a dedicated hardware device just for storing keys. In AI workloads, encryption matters because AI models often train on sensitive data — customer names, medical records, financial transactions. If that data is stolen but encrypted, the thief just sees gibberish. The exam expects you to know that encryption is mandatory for compliance with many regulations, and that AWS offers multiple layers of it.

Logging and monitoring are the surveillance cameras and black boxes of your cloud. AWS CloudTrail records every API call made in your account — every time someone launches a server, reads a file, or deletes a resource, CloudTrail logs who did it, when, and from where. Amazon CloudWatch collects performance metrics (like CPU usage) and can trigger alarms when something looks wrong (e.g., your AI model is sending out more data than normal — a possible sign of a breach). For AI specifically, Amazon SageMaker logs every step of training a model, so you can review exactly what data went in and how the model was built. This is essential for governance (proving you followed the rules) and for compliance (showing an auditor that you did not train your model on illegal data).

Governance and compliance are the policies and laws that guide how you manage security. Governance means your internal rules — who approves a new AI model? How often do you rotate passwords? Compliance means following external regulations — laws like GDPR in Europe, HIPAA in healthcare, or PCI DSS for credit card data. AWS provides tools like AWS Artifact (which gives you access to AWS’s compliance reports) and AWS Config (which checks if your resources follow your rules). For example, you can set a rule that all S3 buckets containing AI training data must be encrypted. If someone creates a bucket without encryption, AWS Config flags it immediately.

Together, these three — IAM, encryption, and logging — form the foundation of security for any AWS AI workload. The AIF-C01 exam will test your understanding of what each tool does, when to use it, and how they work together. You do not need to memorise every IAM policy syntax or encryption algorithm, but you do need to know that IAM controls access, encryption protects data, and logging records events.

Flow of an access request to an AI workload on AWS, showing the IAM checks, encryption layers, and logging pipeline.

Walk-Through

1

Define Your Access Requirements

List every person or service that will interact with your AI workload. Decide exactly what actions each needs (read training data? delete models? invoke the endpoint?). Use the principle of least privilege — no extra permissions.

2

Create IAM Roles and Policies

In the AWS IAM console, create separate roles for human users (data scientists, admins) and AWS services (SageMaker, Lambda). Write JSON policies that grant only the required actions. Attach those policies to the roles.

3

Enable Encryption on All Data Stores

For your S3 buckets containing training data, enable default encryption using AWS KMS or SSE-S3. For your SageMaker notebook instances and training jobs, specify a KMS key for encryption at rest. Ensure your endpoint uses HTTPS for encryption in transit.

4

Turn On Logging and Monitoring

Activate AWS CloudTrail in all regions to log API calls. Set up Amazon CloudWatch to collect logs from SageMaker training jobs and endpoints. Create a CloudWatch alarm that triggers if the endpoint invocation rate exceeds a normal threshold.

5

Set Up Governance Rules with AWS Config

Create AWS Config rules that check for required encryption on S3 buckets, that IAM roles have not attached overly permissive policies, and that CloudTrail is enabled. Configure an SNS topic to send alerts when a rule is violated.

6

Review and Rotate Regularly

Periodically check CloudTrail logs for unusual activity. Rotate your KMS keys according to your compliance schedule. Update IAM policies when team members leave or change roles. Use AWS Audit Manager to generate compliance reports for external audits.

What This Looks Like on the Job

Imagine you work for a healthcare company building an AI that predicts patient readmission rates. The AI is trained on millions of patient records — highly sensitive data protected by HIPAA. Here is how you would actually use IAM, encryption, and logging in this scenario.

First, you set up IAM. You create an IAM role called 'DataScientistRole' that gives data scientists read-only access to an S3 bucket containing de-identified patient data. You attach a policy that specifically denies delete access. You also create a separate role called 'TrainingJobRole' that Amazon SageMaker assumes when it runs a training job. This role only has permissions to read from the training data bucket and write to a separate model output bucket. The key point: no human user ever gets direct access to the production AI model. All access is through roles with minimal permissions.

Second, you enable encryption. You use AWS KMS to create a Customer Managed Key (CMK) specifically for this project. You encrypt the S3 training bucket with this key, and you tell SageMaker to use the same key when encrypting the model artifacts it produces. You also set up an S3 bucket policy that denies any request that is not encrypted. Additionally, you enable encryption in transit by ensuring all connections to your AI endpoint use HTTPS (the secure version of HTTP).

Third, you turn on logging and monitoring. You enable AWS CloudTrail in all regions and create a trail that delivers logs to a dedicated S3 bucket that only an auditor can access. You configure Amazon CloudWatch to monitor the SageMaker endpoint's invocations. If the request rate spikes unexpectedly (perhaps someone is stealing your model by sending millions of queries), you set up a CloudWatch alarm that sends an alert to the security team. You also enable model quality monitoring in SageMaker to detect data drift — when the input data changes so much that the model's predictions become unreliable.

The step-by-step actions you take each week:

Review CloudTrail logs for any failed API calls (could indicate someone trying to break in)

Rotate the KMS keys according to your company's policy (every 90 days)

Check that no S3 buckets were accidentally left public using AWS Config rules

Run a compliance report using AWS Audit Manager to show an external auditor that you are following HIPAA rules

In this real world, security is not a one-time setup. It is a continuous cycle of checking, updating, and reacting. The AIF-C01 exam does not ask you to implement all this, but it does ask you to identify the right tool for each job — like knowing that CloudTrail logs API calls, not network traffic (that is VPC Flow Logs).

How AIF-C01 Actually Tests This

The AIF-C01 exam focuses on security, governance, and compliance heavily, because these concepts apply to every AWS service, not just AI. About 20–25% of the exam questions relate to this objective. Here is exactly what they test.

First, they love to test IAM basics. You will see questions like: 'Which AWS service controls who can access your AI model endpoint?' The answer is always IAM. They might describe a scenario where a developer needs to temporarily access a SageMaker notebook — the correct answer is to create an IAM role and have the developer assume it. Traps: they might list 'security groups' or 'network ACLs' as possible answers. Those control network traffic, not user identity. Another trap: they say 'Amazon Cognito' — that is for user sign-up/sign-in for mobile apps, not for internal AWS access.

Second, encryption is a favourite topic. They will ask: 'Which encryption option gives you the most control over your encryption keys?' The answer is AWS CloudHSM (a physical device in your control). The trap is picking AWS KMS, which lets you manage keys but stores them on shared hardware. They also ask about encryption in transit vs at rest. A common question: 'Your AI model is deployed behind an HTTPS endpoint. What is being protected?' Answer: data in transit between the client and the model.

Third, logging is asked alongside monitoring. They will present a scenario: 'Your AI model starts returning strange results and you suspect a data breach. What is the first place to look?' The answer is AWS CloudTrail (to see who made API calls) and then perhaps CloudWatch Logs (to see the model's input). A trap: 'VPC Flow Logs' — those show network traffic, not API calls. Another trap: 'S3 server access logs' — those only log access to S3, not to SageMaker.

The exam also tests governance and compliance tools. They might ask: 'Which AWS service can automatically check if your resources follow company policies?' Answer: AWS Config. 'Which service provides pre-built compliance reports for regulations like HIPAA?' Answer: AWS Artifact. 'Which service helps you manage multiple AWS accounts and centrally apply security policies?' Answer: AWS Organizations.

Key definitions to memorise exactly:

IAM policy: a JSON document that defines permissions (does not 'enforce' anything itself — it is just a rule)

IAM role: an identity you can assume, without a permanent username or password

Encryption at rest: protecting data when it is stored on disk

Encryption in transit: protecting data when it moves over a network (HTTPS, TLS)

CloudTrail: logs API calls in your AWS account (control plane)

CloudWatch: monitors performance and logs custom events (data plane)

AWS Config: evaluates resource configurations against rules

AWS Artifact: provides compliance documentation

Finally, expect questions about the 'shared responsibility model'. AWS is responsible for security OF the cloud (hardware, data centres, networking). You are responsible for security IN the cloud (your data, your IAM configurations, your encryption choices). A classic trap: 'Who is responsible for encrypting your AI model's training data?' The answer is you (the customer). AWS provides the tools, but you must enable them.

Key Takeaways

IAM policies are written permission rules, IAM roles are temporary identities that assume those rules, and the principle of least privilege grants the minimal access needed for a task.

Encryption at rest protects data stored in S3 or EBS volumes, while encryption in transit protects data moving over networks (usually via HTTPS or TLS).

AWS CloudTrail logs every API call made in your account for auditing, while Amazon CloudWatch monitors performance metrics and custom logs.

AWS Config continuously checks your resources against your own defined rules for governance, and flags any non-compliant resources automatically.

The shared responsibility model means AWS secures the cloud infrastructure, but you are responsible for securing your data, IAM policies, and encryption settings.

For AI workloads on AWS, SageMaker integrates with IAM for access control, KMS for encryption of models and data, and CloudWatch for monitoring model performance and drift.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

IAM Policy

A written document defining permissions (a 'rule book')

Cannot be assumed directly; it must be attached to a user, group, or role

Defines what actions are allowed on which resources

IAM Role

An identity that you or a service can temporarily assume

Gets its permissions by having policies attached to it

Used when a service needs access to another resource (e.g., SageMaker accessing S3)

Encryption at Rest

Protects data stored on disk or in storage services (e.g., S3, EBS)

Implemented using technologies like AES-256 with keys from KMS or CloudHSM

If a hard drive is stolen, the data remains unreadable

Encryption in Transit

Protects data as it travels across networks (e.g., between client and server)

Implemented using protocols like TLS or HTTPS

If a network packet is intercepted, the data is scrambled

AWS CloudTrail

Records API calls made to the AWS control plane (e.g., who launched an instance)

Primarily used for auditing and security investigation

Stores logs for up to 90 days by default, can be extended to S3

Amazon CloudWatch

Monitors metrics (e.g., CPU usage) and collects custom log data from applications

Used for operational monitoring, alerts, and troubleshooting

Can trigger alarms based on thresholds or anomaly detection

AWS Config

Continuously evaluates your resource configurations against rules

Flags resources that violate internal policies (e.g., unencrypted S3 bucket)

Helps enforce governance and detect drift in real time

AWS Artifact

Provides on-demand access to AWS compliance reports and certifications

Gives you documents like SOC, PCI, and HIPAA reports for auditors

Does not monitor your own resources; it is a documentation library

Watch Out for These

Mistake

IAM policies and IAM roles are the same thing.

Correct

An IAM policy is a set of rules (like a permission slip), while an IAM role is an identity that you can temporarily assume. A role has policies attached to it, but they are different concepts.

Beginners see both terms used in similar contexts and assume they are interchangeable.

Mistake

If I enable encryption on an S3 bucket, all my data is automatically encrypted from the moment I create the bucket.

Correct

Encryption must be configured, and data that already exists in the bucket before you enable encryption remains unencrypted unless you manually copy or update it.

People assume 'default encryption' is retroactive, but AWS does not automatically encrypt existing objects.

Mistake

AWS CloudTrail logs everything that happens in my account, including the contents of my AI model's predictions.

Correct

CloudTrail logs API calls (like who started a training job), not the data inside the requests or responses. For the model's actual input/output, you need a different service like CloudWatch Logs or SageMaker Model Monitor.

The name 'logging' sounds all-encompassing, so beginners assume it covers all types of activity.

Mistake

Compliance is only a problem for big companies in finance or healthcare.

Correct

Compliance regulations like GDPR apply to any company that handles personal data of EU residents, regardless of size or industry. Even a small startup building an AI chatbot for customer support must comply if it collects names and email addresses.

Newcomers think regulations are niche, but privacy laws are now global and cover many types of data.

Mistake

If I use a strong password for my root user, I have done enough for security.

Correct

The root user should almost never be used. Instead, you should create IAM users with specific permissions, enable multi-factor authentication (MFA) on all accounts, and use roles for services. A strong password alone does not protect against leaked credentials or phishing.

Many people come from a personal computing mindset where the admin password is the main defence. In the cloud, access is much more complex and distributed.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

What is the difference between CloudTrail and CloudWatch in AWS security?

CloudTrail logs API calls (who did what in your account), while CloudWatch monitors metrics (like CPU usage) and stores log files from applications. For security, CloudTrail is for auditing actions, and CloudWatch is for detecting operational anomalies or errors.

Do I need to encrypt my AI model after it is trained?

Yes, you should encrypt your trained model artifacts (the files that define the model). AWS SageMaker automatically encrypts model artifacts at rest using a KMS key if you specify one in the training job. Without encryption, anyone with access to the S3 bucket can download and use your model.

What does 'least privilege' mean in IAM?

Least privilege means giving a user or service only the exact permissions needed to do their job, and nothing more. For example, a data scientist might have read-only access to training data but cannot delete the S3 bucket or modify IAM policies.

Is it safe to use the root user of my AWS account for daily AI work?

No. The root user has unrestricted access to your entire account. AWS recommends creating an IAM user for daily tasks and enabling multi-factor authentication (MFA) on the root account. Use the root user only for tasks that require it, like changing account settings.

What is the shared responsibility model in simple terms?

AWS is responsible for keeping their cloud infrastructure secure (the hardware, networking, and data centres). You are responsible for securing what you put in the cloud (your data, IAM configurations, encryption settings, and compliance with regulations).

How do I know if my AI workload is compliant with GDPR?

AWS provides tools like AWS Artifact (to download compliance reports) and AWS Config (to enforce rules like encryption). However, compliance is ultimately your responsibility. You must ensure your training data is properly anonymised, you have consent to use it, and you can delete customer data if requested.

Terms Worth Knowing

Keep going

You've finished Security, Governance, and Compliance for AI. Continue through the AIF-C01 study guide to build a complete picture of the exam.

Done with this chapter?