← AI Practitioner study path

Responsible AI, security and governance · 15 min

Auditing, compliance and AI governance on AWS

In this lesson you will learn which AWS service answers each audit and compliance question, what Amazon Bedrock model invocation logging stores, which governance strategies and processes the exam guide asks about and how to place a case in its scope of the Generative AI Security Scoping Matrix.

Auditing, compliance and AI governance are the topic of task 5.2 of the AWS Certified AI Practitioner exam guide. An audit is a review, often done by someone from outside, to check that a company does what it says; compliance is following the laws and standards that apply to it; and governance is the internal rules that say who decides, who reviews and who is accountable for each system. That task asks you to recognize governance and compliance services, data governance strategies and processes to follow governance protocols. The guide makes clear that writing those policies is out of scope for the exam, so what is assessed is recognizing what each service solves.

Each service answers a different question. For example, at an online store that has an internal chatbot for its employees, the legal team may ask what an employee wrote to the chatbot last Tuesday, an auditor may ask for proof that the infrastructure complies with SOC 2, and the security team may want to know whether someone left the training unencrypted. On AWS, each of those questions is answered by a different service.

Which service answers each question?

Six cards, one per service: AWS CloudTrail, AWS Config, Amazon Inspector, AWS Artifact, AWS Trusted Advisor and Amazon Macie, each with the question it answers

Six AWS services answer audit and compliance questions, each one its own, and on the exam the clue is in the question the scenario asks:

  • AWS CloudTrail, which answers who did what, when and from where. For example, which employee deleted a setting on Monday.
  • AWS Config, which answers how each is configured and how it changed. For example, whether the training bucket was encrypted a month ago.
  • Amazon Inspector, which answers what your software has in EC2, ECR and Lambda, which are services where your programs run. For example, whether the chatbot's server uses a version of a program with a known flaw.
  • AWS Artifact, which is where you download the AWS compliance reports, such as SOC, ISO and PCI, to give them to your auditors. SOC, ISO and PCI are recognized security standards, and each report proves that an outside reviewer checked that AWS meets them. For example, the store downloads the AWS SOC 2 report for its auditor.
  • AWS Trusted Advisor, which answers what to improve in cost, performance, security, , service limits and operational excellence. For example, that the store has a server running that nobody uses.
  • Amazon Macie, which answers where there is sensitive data in S3. For example, which stored files contain customers' card numbers.

CloudTrail and Config

CloudTrail is on from the moment the account is created, and its event history stores 90 days of management events per Region at no cost. A management event is an action that changes or looks up something in your account, such as creating a resource or calling a model. InvokeModel and Converse calls to Bedrock, and their versions, are recorded in that history as management events. For example, if a store employee asked the chatbot a question a month ago, CloudTrail shows that they called the model, at what time and from where.

Config, for its part, uses rules that mark a resource that breaks a rule as noncompliant, such as an unencrypted training bucket, and that send a notification. In this way, CloudTrail and Config cover the same change from two sides: CloudTrail tells you who made it, and Config tells you what state the resource was left in afterward. For example, if someone removes encryption from the training bucket, Config marks it as noncompliant and alerts the team, and CloudTrail says which person made the change.

Artifact and Trusted Advisor

Artifact reports prove what AWS does, while you document what your company does. For example, the AWS report proves that its data centers are protected, but the store has to show on its own which of its employees can use the chatbot. In Trusted Advisor, the support plan, which is the level of help you contract with AWS, defines how many checks you see: with the Basic plan you see only some, and to see all of them you need Business Support+, Enterprise or Unified Operations.

Which service answers?

0 of 5

Tap the service that answers each question.

  1. Who deleted the guardrail yesterday at 3 p.m.?

  2. Was any training data bucket left unencrypted?

  3. The auditor asks for the AWS SOC 2 report.

  4. Where can I lower costs and improve the fault tolerance of the account?

  5. How was this endpoint configured two weeks ago?

What does Bedrock model invocation logging store?

The legal team's question isn't answered by CloudTrail, which says that the employee called the model but not what they wrote to it. That is stored by Amazon Bedrock model invocation logging, which contains the full prompt and response, with their . An invocation is each time an application calls the model to ask it for a response. For example, if the store employee asked "what is my boss's salary?", invocation logging stores that exact sentence and what the model answered.

This logging is off by default. You turn it on in the Bedrock settings and choose the destination (CloudWatch Logs, S3 or both), which has to be in the same account and the same . The logs stay in that destination until you delete the configuration. For example, if the store never turned on logging, there is no way to know what the employee wrote on Tuesday, because nothing was stored.

Bedrock compliance

As for compliance, the Bedrock FAQs say that the service is in scope for SOC 1, 2 and 3 and for ISO, that it is eligible for HIPAA, a United States law on health data, that it has FedRAMP Moderate, a United States government authorization, and that it can be used in compliance with the GDPR, the European Union's data protection law. The reports that prove it are downloaded in AWS Artifact. For example, a hospital that wants to use Bedrock can download in Artifact the reports its auditor asks for.

Which log has it?

The legal team needs the exact text an employee sent to the Bedrock model on Tuesday. Where do they look for it?

What data governance strategies does the guide ask about?

The six data governance strategies in the exam guide: data lifecycles, logging, residency, monitoring, observation and retention

Data governance is the rules on how a company stores, uses and deletes its data. Objective 5.2.2 of the guide names six data governance strategies, which the guide only lists:

  • The lifecycle, which is the stages of a piece of data from when it is created until it is deleted.
  • Logging, which is the records of what happens in a system.
  • Residency, which is the place in the world where the data is stored.
  • Monitoring, which is watching the data and the systems continuously.
  • Observation, which is looking at how the system behaves to understand what is happening.
  • Retention, which is how long a piece of data is kept before it is deleted.

Of these, the lifecycle and residency have details specific to AI. In the lifecycle, AI adds a problem that the Scoping Matrix explains with the right to have your data deleted, such as the one the GDPR grants. The only fully effective way to remove data from a model is to remove it from the training dataset and train a new version. For example, if a store customer asks for their data to be deleted and their conversations were used to train the chatbot, deleting the file isn't enough: the model has to be trained again without them. In residency, Bedrock stores your content in the Region where you use it, unless you use cross-Region inference, which is letting AWS handle your request in another Region. For example, if the store uses Bedrock in São Paulo without cross-Region inference, its content stays in that Region.

What is the Generative AI Security Scoping Matrix?

The Generative AI Security Scoping Matrix is the governance framework the exam guide names, and it is used to know which security controls apply to you depending on how much of the model is yours. Today the AWS page is called AI Security Scoping Matrix, but it is the same framework.

Five scopes of the Scoping Matrix, from less to more ownership of the model and its data, and the five disciplines reviewed in each one

The matrix sorts use cases into five scopes, from less to more control over the model, and in each scope you review the same five security disciplines. The scopes are:

  • Scope 1, the consumer app, where you use a public third-party service, without an enterprise agreement. For example, a store employee uses a free chat on the internet.
  • Scope 2, the enterprise app, where you use a third-party application with built-in AI and with a business relationship in place. For example, the store pays for an email program that summarizes messages with AI.
  • Scope 3, the pretrained model, where you build your application on a model someone else already trained and that you call through an . For example, the store's internal chatbot uses a Bedrock model as it comes.
  • Scope 4, the fine-tuned model, where you build your application on a model you refined with your data, that is, one you taught more with your own examples. For example, the store fine-tunes a Bedrock model with its support conversations.
  • Scope 5, where you build your application on a model you trained from scratch. For example, a large company trains its own model with all its data.

Data in each scope

Each scope changes which data it makes sense to use. In scope 1, the provider can use what you send it to improve its service, so send public data whenever possible. In scopes 4 and 5, the model is classified at the level of the most sensitive data you used to train it. For example, if the store fine-tunes a model with conversations that include customers' addresses, that model has to be protected the same way as the addresses, and not just any employee can use it.

Which scope is it?

0 of 4

Tap the Scoping Matrix scope for each case.

  1. An employee uses a public chat on a website to come up with campaign ideas

  2. Your support chatbot with an untuned Bedrock model and Knowledge Bases

  3. The meeting agenda drafted by your enterprise calendar software

  4. A Bedrock model fine-tuned with your hospital's medical records

What governance processes does the guide ask about?

The four AI governance processes: policies, review cadence and strategies, transparency standards and team training

Objective 5.2.3 of the guide lists the governance processes, which are the activities a company repeats so its rules are followed. The Scoping Matrix adds that controls are reviewed every time the threats change, including after the application is launched. The guide names four processes:

  • Written policies, which say how AI is used in the company. For example, "customer data is not pasted into public chats".
  • Review cadence and strategies, which say how often and how a system is reviewed. For example, reviewing the chatbot's responses every quarter.
  • Transparency standards, such as Model Cards, which document what each model is for and what risk it carries. For example, one card for each model the store uses.
  • Team training, which teaches employees the policies and the risks. For example, a short course on which data is not given to a model.

The services in both accounts

CloudTrail, CloudWatch, AWS Config and AWS Artifact are available on the free plan of the new experience, although Artifact doesn't include the HIPAA and SEC agreements there. Trusted Advisor and Macie are not available in that account unless you turn on the advanced features, and Inspector doesn't appear on any list of services. For example, in the new experience account you can see the CloudTrail history and create a Config rule, but you can't see the Trusted Advisor checks without turning on those features.

On the exam

Questions on this topic usually ask an audit question, and these words in the question point to the answer:

  • "Who did", which points to CloudTrail.
  • "What they wrote" or "prompt and response", which point to invocation logging.
  • "Configuration" or "noncompliant", which point to Config.
  • "SOC, ISO, PCI reports", which points to Artifact.
  • "Cost and security recommendations", which points to Trusted Advisor.
  • "Scope" or "how much of the model is yours", which point to the Scoping Matrix.

For example, if the question says a school wants to know which teacher changed a bucket's permissions, the phrase "which teacher changed" is a "who did" and leads you to CloudTrail.

Review question

An auditor needs to know who called an Amazon Bedrock model and what prompt they sent to it. Which combination of services or features do they use?

Next