Layered safety controls across the request path: AIP-C01 study notes and practice questions
What to know about Layered safety controls across the request path for the AIP-C01 exam, from the AI Safety, Security, and Governance domain (20% of the exam guide), then 1 free question to test it. Part of the AIP-C01 study guide.
AIP-C01 presents an application with one safety control that failed, and asks which additional layer closes the gap. The exam rewards layers that do not depend on developers remembering to call them, and that fail closed.
Layers on the request path
Step
Control
Stops
Edge
AWS WAF rules on API Gateway, plus API Gateway request validation
Floods, malformed or oversized requests, known bad clients
Pre-filter
Comprehend PII detection, or regex checks in Lambda
Personal data entering prompts or logs
Input
Bedrock guardrail with input tags and the prompt attack filter
Harmful or manipulative user input
Model
Least-privilege model access and a restricted endpoint
Calls to unapproved models
Tool step
Validation of tool results before the model reads them
Injected instructions from data sources
Output
Output guardrail, then a Lambda that checks format and content
Unsafe or malformed answers
Each layer is independent, so a miss at one step can be caught by another. Use the guardrail’s prompt attack filter rather than Comprehend prompt safety classification, which is in maintenance. See AWS WAF with API Gateway.
Forcing the guardrail
A guardrail that developers may skip is not a control. Add an IAM condition on the bedrock:GuardrailIdentifier key so that model invocation is denied unless the request names an approved guardrail. Apply the same rule across accounts with a service control policy in AWS Organizations. The request then fails closed instead of running unfiltered. See enforcing a guardrail.
Central policy, per-application guardrails
A central security team owns guardrail versions for each risk tier, and each application references the approved version by ARN. Stricter tiers use tighter thresholds. Publish a new version rather than editing one in place, so a change can be tested and rolled back.
Checking tool results
Retrieved documents, web pages and tool responses can carry injected instructions. Validate tool results against an expected schema, strip or flag markup, and keep the agent’s permissions narrow, so a successful injection has limited effect.
Logging and alerting
Monitor guardrail intervention metrics in CloudWatch and alarm on sudden spikes, which can signal an attack or a broken prompt. Record configuration changes in CloudTrail. Do not write full prompts into general application logs, because they may hold personal data.
How to choose
Scenario wording
Choose
“Developers sometimes call the model without the guardrail”
IAM condition on the guardrail identifier, or an SCP
“Block floods before any model cost is incurred”
WAF rate rules and API Gateway validation
“Several apps must share one safety policy”
Central guardrail version referenced by each app
“Notify the team when harmful requests increase”
CloudWatch alarm on guardrail intervention metrics
Common traps
Relying on one layer, usually the model’s own refusal.
Trusting developers to call the guardrail rather than enforcing its use.
Adding a Comprehend prompt safety classifier, which is in maintenance.
Logging raw prompts into widely readable logs.
Giving each app an editable guardrail with no versioning or central review.
A state agency runs a benefits question assistant that citizens reach through a public web form. The form calls a REST API in Amazon API Gateway, which invokes a Lambda function that calls a model on Amazon Bedrock.
The agency has seen bot floods that run up model charges, and malformed payloads that crash the function. Model replies must also be checked before they reach citizens, because some answers have included personal details from other cases.
The design must stop floods and bots at the edge before any model cost is incurred, reject malformed requests before the model is invoked, and filter both the question and the reply with a Bedrock guardrail.
Which design meets these requirements?
Choose one answer.
AA. Associate an AWS WAF web ACL with rate-based and bot rules with the REST API, turn on request validation, and call Bedrock with a guardrail on input and output.
BB. Rely on API Gateway usage plans and API keys to limit each caller, and apply a guardrail to the model's input only, because the model's own safety training is expected to keep its replies safe.
CC. Expose the function through a Network Load Balancer, check the request length and banned words in the browser before each submit, and call Bedrock with a guardrail on the input only.
DD. Place a Lambda authorizer on every route to validate a citizen token, and rely on the function's error handling to return a generic message whenever the model's output looks unsafe.
Show the answer and explanation
Answer: A
A. Right: Each control handles a different problem: WAF drops floods and bots at the edge, request validation rejects bad payloads before the Lambda runs, and the guardrail filters the question and the reply. Together they cover every stage of the request path. Learn more: Use AWS WAF to protect your REST APIs in API Gateway (opens in a new tab)
C. Wrong: A network load balancer does not inspect requests for bots or malformed JSON, and browser checks can be bypassed by any client that calls the endpoint directly. Filtering only the input leaves replies unchecked.
D. Wrong: An authorizer confirms who is calling but does not limit floods from callers that hold valid tokens, and it does nothing to reject malformed payloads. Error handling cannot judge whether a reply is safe, so the reply check is missing. Learn more: Request validation for REST APIs in API Gateway (opens in a new tab)
Explanation
Layered controls each stop a different problem: AWS WAF drops floods and bots at the edge, request validation rejects malformed payloads before any model call, and the guardrail filters both the question and the reply. Usage plans, client-side checks and authorizers do not provide these protections on their own.
Want more on Layered safety controls across the request path? The 5 full-length practice sets have 6 more Layered safety controls across the request path questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →
Study Layered safety controls across the request path