Securing an AI system means protecting four distinct asset classes at the same time: the training and reference data, the model weights or model endpoints, the inference infrastructure, and the application layer that turns model outputs into user-facing actions. Traditional application security covers some of this surface, but generative AI introduces concerns that have no analog in pre-AI workloads. A model can memorize and leak training data. A user can rewrite the model's instructions through prompt injection. A tool-using agent can be coerced into calling backend APIs with arguments derived from attacker-controlled context. Every method discussed in this section attaches to one or more of those asset classes, and every method has a corresponding AWS service or feature that operationalizes it.
The starting point is the AWS shared responsibility model adapted for AI. AWS protects the global infrastructure, the hardware accelerators, the hypervisors, the managed control planes for Amazon Bedrock and Amazon SageMaker AI, and the model hosting environment. The customer is responsible for the configuration of those services: who can call them, with what data, under which encryption keys, with which network paths, and with what logging in place. For first-party Amazon Bedrock foundation models the customer also retains responsibility for the prompts they submit, the data they ingest into Amazon Bedrock Knowledge Bases, the fine-tuning data they provide, and the way they validate model outputs before acting on them. AWS does not see or use customer prompts, completions, or fine-tuning data to train the underlying foundation models.
Defense in depth is the second method. No single control catches every threat: a content filter cannot stop credential theft, an IAM policy cannot detect toxic output, and encryption cannot prevent a prompt injection that exfiltrates context. Layering controls so that a failure in one layer is caught by another is the structural property an exam scenario is usually testing when it asks for "the most secure" approach. The order an architect typically applies the layers is identity, network, data, runtime, application, and observability, with each layer feeding evidence into the layers below for audit.
A third method is least-privilege access for both human users and the AI runtime itself. The IAM role that an Amazon Bedrock agent assumes to call action groups should grant only the specific actions on the specific resources required for those action groups. The IAM principal that invokes the model should not also have permissions to modify model evaluation jobs. Service control policies at the AWS Organizations level restrict which Regions can invoke which foundation models. Amazon Bedrock AgentCore Identity lets the agent obtain short-lived credentials per end user instead of running with a single shared role, which is the structural fix for the multi-tenant identity problem that traditional service accounts cannot solve.
A fourth method is data minimization. Every datum that the model sees is a candidate for memorization, logging, leakage, or accidental retrieval through RAG. The fewer personal identifiers, secrets, and confidential strings flow into the prompt, the embedding store, or the fine-tuning corpus, the smaller the blast radius. Amazon Macie scans Amazon S3 for personally identifiable information and credentials so that data engineers can redact or partition before ingestion. The Amazon Bedrock Guardrails sensitive information filter detects and masks PII entity types in both prompts and responses at runtime.
A fifth method is runtime policy enforcement. Identity and encryption stop an unauthorized caller; they do not stop an authorized caller from submitting a malicious prompt. Amazon Bedrock Guardrails apply content filters, denied topics, sensitive information filters, contextual grounding checks, word filters, and prompt-attack filters on the request path and the response path. Policy in AgentCore expresses agent-level rules such as which tools the agent may invoke and under what conditions, so that a single compromised prompt cannot reach a high-impact tool.
A sixth method is auditability. AWS CloudTrail captures management events such as model invocation logging configuration changes, IAM role assumptions, and key usage. Amazon Bedrock model invocation logging captures the prompt and the completion in Amazon S3 or Amazon CloudWatch Logs for forensic review and compliance attestation. Amazon SageMaker Model Cards document the model itself: its intended use, training data lineage, evaluation results, known biases, and approved owners. Together these produce the evidence chain that auditors and incident responders require.
Data governance strategies (lifecycles, logging, residency, monitoring, observation, retention)
A data lifecycle for an AI workload spans ingestion, classification, transformation, training or indexing, inference use, and disposition. Each phase has its own security obligations. At ingestion, data is tagged with classification (public, internal, confidential, restricted) and an owner. At classification, Amazon Macie may inspect Amazon S3 buckets and flag managed identifiers (Social Security numbers, payment card numbers, AWS access keys) before that data is allowed into a vector store or training set. At transformation, AWS Glue jobs apply masking, tokenization, or k-anonymization. At training or indexing, the result is encrypted at rest with an AWS Key Management Service key whose key policy restricts decryption to a small set of service-linked roles. At inference, prompts and responses pass through Amazon Bedrock Guardrails. At disposition, Amazon S3 Object Lock prevents premature deletion and Amazon S3 Lifecycle rules transition data to S3 Glacier or expire it on a documented schedule.
Logging is the connective tissue of the lifecycle. The four logging stores that an AIF-C01 candidate should recognize are AWS CloudTrail (control plane API calls, including who invoked a model, who created a guardrail, who modified a knowledge base), Amazon CloudWatch Logs (application logs, agent traces, AgentCore Observability spans), Amazon Bedrock model invocation logging (the prompt and completion bodies, configured per account per Region), and Amazon S3 server access logs or CloudTrail data events (object-level reads and writes on training and reference data). Each store should write to a dedicated logging account with restricted IAM access so that an attacker who compromises the workload account cannot tamper with the audit trail.
Residency rules dictate which AWS Region holds and processes the data. Amazon Bedrock invokes the foundation model in the Region where the API call is made. Cross-Region inference profiles allow Amazon Bedrock to route requests across a defined set of Regions for higher availability, and the candidate must know that a workload subject to single-Region residency must either disable cross-Region inference or restrict the profile to Regions within the allowed jurisdiction. Amazon Bedrock Knowledge Bases store embeddings in the vector store the customer chooses (Amazon OpenSearch Serverless, Aurora PostgreSQL with pgvector, others) and those resources stay in the Region where they are created.
Monitoring is the active layer over logging. Amazon CloudWatch metrics on Amazon Bedrock invocations track throttling, latency, and input or output token counts per model. Amazon SageMaker Model Monitor runs scheduled jobs that compare production traffic against a baseline for data quality, model quality, bias drift, and feature attribution drift. AWS Config rules monitor configuration state: whether Amazon S3 buckets used for training data have block-public-access enabled, whether knowledge base index encryption is enabled, whether AWS CloudTrail is on in every Region.
Observation is the qualitative cousin of monitoring. Where monitoring asks "is a numeric threshold exceeded," observation asks "what is actually happening end to end inside this agent right now." AgentCore Observability captures spans across the agent loop, tool invocations, memory reads and writes, and model calls. Those spans feed Amazon CloudWatch and downstream tools such as Amazon OpenSearch Service for full-text search. Observation reveals subtler failures than monitoring catches, such as an agent that succeeds every call but takes three loops to do what should take one.
Retention is the explicit policy that says how long each artifact is kept and when it is destroyed. Common retention buckets include training data (often retained for as long as the resulting model is in production plus a regulatory tail), prompt and completion logs (often 30 to 90 days for operational debugging, longer when a regulator requires it), CloudTrail trails (often retained for the audit window of the strictest regulator, typically seven years for financial services), and embeddings (retained as long as the source documents are valid, deleted when the source is deleted). Amazon S3 Lifecycle policies and Amazon CloudWatch log retention settings encode these rules so they apply automatically rather than depending on manual cleanup.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "RestrictBedrockToApprovedRegions",
"Effect": "Deny",
"Action": ["bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream", "bedrock:Converse", "bedrock:ConverseStream"],
"Resource": "*",
"Condition": {
"StringNotEquals": {
"aws:RequestedRegion": ["eu-central-1", "eu-west-1"]
}
}
}
]
}
π‘ Exam Trap: A question that asks how to keep all generative AI processing inside a specific jurisdiction usually expects a service control policy at the AWS Organizations level plus a restricted cross-Region inference profile, not just an IAM policy on a single role. Single-role IAM policies do not stop another principal in the account from invoking the model from a different Region.
π‘ Exam Trap: The shared responsibility model for Amazon Bedrock places infrastructure, foundation model hosting, and base model weights with AWS. The customer is responsible for prompts, fine-tuning data, knowledge base content, IAM, encryption choices, guardrail configuration, and how the application acts on completions. AWS does not train its foundation models on customer prompts or completions.
β οΈ Anti-Pattern: Granting
bedrock:*ands3:*to a single application role because the developer wanted the agent to "just work." The structural correction is to split the agent into action groups, scope each action group to specific Amazon S3 prefixes, and use Amazon Bedrock AgentCore Identity to obtain short-lived per-user credentials so the agent cannot escalate beyond what the calling user can do.
π Limit: Amazon Bedrock model invocation logging is configured at the AWS account and Region scope. Each account per Region has one logging configuration that emits to either Amazon S3, Amazon CloudWatch Logs, or both. There is no per-model toggle for inclusion in logs; exclusions are by content type (text, image, embedding, video).
π― Scenario: A bank deploys an Amazon Bedrock agent that summarizes customer call transcripts and writes the summary to a case management system. Three days after launch, a security review flags that the call transcripts contain payment card numbers. The lowest-effort, highest-confidence fix is to enable the Amazon Bedrock Guardrails sensitive information filter for the PAYMENT_CARD_NUMBER entity in MASK mode on both input and output, enable model invocation logging into a dedicated logging account with KMS encryption, and add an Amazon Macie discovery job on the Amazon S3 bucket that holds the raw transcripts so that the data control gap is closed at ingestion as well as runtime.
π‘ Exam Trap: "Data lifecycle" on the exam refers to the chain of states an artifact goes through, not the Amazon S3 Lifecycle feature. Amazon S3 Lifecycle is one mechanism that implements one phase of the broader data lifecycle.
Decision Anchor: defense-in-depth choice. Choose layered runtime controls (Amazon Bedrock Guardrails on the request and response, AgentCore Policy on tool access, IAM on the calling role) when the threat model includes both malicious end users and accidentally over-permissioned application logic. Choose perimeter-only controls (IAM plus VPC endpoints) when the application is internal, the prompts come only from trusted services, and the budget for runtime filtering latency is zero. Defense in depth is the default for any public-facing or multi-tenant AI surface.
