AIP-C01 practice question: Layered safety controls across the request path
AI Safety, Security, and Governance A free question from our original AIP-C01 practice exam. Try it, then open the answer to see why each option is right or wrong.
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 →