Amazon AWS Certified Generative AI Developer - Professional AIP-C01 Practice Test 2
Question 10
Two agent workers concurrently update the shipping address of one order. The customer authorized a new address, but a delayed retry from the older workflow later overwrites it. What state-management control directly prevents this?
- Write any latest-arriving value because the most recent network packet must be the newest customer decision.
- Allow each agent to modify the record without checking the order’s current version.
- Use a version-checked conditional update and reject stale workflow writes before committing the address.
- Ask the model to describe the latest address clearly, then trust that text instead of the database.
Explanation
Correct Answer
C:Store a version number or comparable concurrency token with the order. Each mutation includes the version it observed and succeeds only if the record still matches, using a conditional write or transaction. If the state changed, reload and reconcile with the user’s latest authorized request. Use idempotent retry identifiers and audit the accepted transition. The concurrency guard should be checked under overlapping retries and delayed responses, including the case in which a customer immediately corrects an address.
Incorrect Answers
A:Network arrival order does not establish business causality. A delayed retry can represent an older authorization and arrive after a valid customer change. Applying last-arrival-wins without conditions may restore outdated details. The backend must compare the state version and the actual authorized mutation before committing changes.
B:Unconditional writes permit race conditions even when each agent individually behaved correctly. A distributed workflow needs a conflict rule tied to the record’s state and approved user action. Otherwise, a stale task can silently overwrite the current address and produce incorrect shipments.
D:Generated text is not the source of truth for a transactional address update. Even a fluent summary can omit a unit number or describe stale state. The database needs guarded writes and authoritative version checks; prose may help explain a conflict to the user but cannot enforce consistency.
Question 11
A customer-support model generates a four-page response to a question that requires one short answer. The provider supports an output-token cap. Which change directly reduces avoidable output spend without confusing input limits?
- Set a suitable maximum output-token budget and test that required answer fields are not truncated.
- Increase the model context window so the model knows it may write fewer words.
- Give the model a broader IAM policy to speed up response generation.
- Lower the request-rate quota for the entire application without changing response lengths.
Explanation
Correct Answer
A:A supported output-token setting limits the maximum generated completion length and directly bounds this part of consumption. Pair the cap with a clear concise-answer format, then test edge cases where a complete answer still needs more tokens. Measure actual token counts and whether truncation removes required safety or factual details. Sample short and unusually complex yes/no requests, ensuring the cap does not truncate a mandated qualification or leave malformed response structure.
Incorrect Answers
B:Context capacity governs how much input and generated content can fit in a request, not the desired style or hard completion length. A larger window may support even more context and cost. To reduce unnecessary completion tokens, constrain the generated budget with model-supported settings and validate final answers.
C:IAM policy determines allowed AWS actions and resources, not how many tokens the foundation model generates. Expanding privileges creates a security problem unrelated to verbosity. Keep least privilege and control response length through the invocation parameters and prompt design supported by the selected model.
D:A lower request rate would deny or delay users while allowing every accepted request to produce the same excessive response. It may reduce total volume but not solve per-answer waste. The appropriate control is a response-token budget with measured completion quality and user experience.
Question 12
A model generates a confident market-research report with citations. Three citations refer to papers that do not exist, although the report reads professionally. What evaluation metric should be added?
- Grammar and readability only, because a fluent report is likely accurate.
- Total number of citations, whether or not any publication record exists.
- Mean response length across the sample, with no access to the cited works.
- Claim-level factuality and citation verification against actual source records.
Explanation
Correct Answer
D:Evaluate whether each referenced source exists and whether its actual content supports the associated factual statement. Report missing papers, incorrect bibliographic metadata and unsupported inferences separately. A grounded report should preserve traceable source identifiers and acknowledge uncertainty when no evidence is available. This criterion directly captures the reported defect despite polished prose. Include references that exist but concern a different topic, since the same validator should detect both fabricated sources and irrelevant real citations.
Incorrect Answers
A:Fluency measures linguistic quality and cannot establish that a cited paper or fact exists. A language model can produce well-formed invented references. This evaluation would reward the current failure rather than detect it. The report must be checked against trustworthy source material at the claim level.
B:Counting citations can encourage adding more plausible-looking references without evaluating authenticity or support. Ten fabricated sources are not better evidence than one. The evaluation should inspect source existence, exact matching passages, and whether each cited passage actually justifies the associated claim.
C:Response length may be relevant to readability or cost, but has no reliable relationship to citation authenticity. A short report can fabricate a paper, and a long report can be well grounded. Use real publication records and claim-to-evidence checks instead of proxy metrics.
Question 13
A call-center refund agent may propose refunds but must receive a supervisor’s confirmation before the payment API is invoked. The application also needs a traceable approval record. Which design meets that requirement?
- Tell the model to ask politely for approval, then let it call the payment API without checking a recorded decision.
- Store a user-facing disclaimer and allow every refund below the configured model output-token limit.
- Use a workflow state with a supervisor approval step and have the payment backend verify the authorized approval before execution.
- Hide the payment API from the model’s list of visible tools while leaving a general unrestricted executor available.
Explanation
Correct Answer
C:An orchestrator such as Step Functions can pause at a defined approval state and record who approved which amount and recipient. The backend payment API must validate that approval token, current request identity and idempotency key before processing. Persist the decision and outcome for audit; the model may suggest a refund but does not grant authority. Demonstrate that a mismatched approval amount, stale approval reference or reused payment idempotency key causes a deliberate rejection by the backend.
Incorrect Answers
A:A prompt asking for approval is helpful for dialog but cannot prove that a real supervisor authorized a specific amount and recipient. The model can skip or misunderstand its instructions. A protected backend action must verify a separate approval artifact and its scope before funds move.
B:A disclaimer only informs the customer about the process. Output-token limits have no relationship to the refund amount, authority or destination. Treating them as a financial control would leave the payment action unprotected. Use enforceable authorization and transactional audit evidence.
D:Concealing a named tool from the model interface is insufficient if a separate generic executor can still call the same privileged API. Tool discovery and backend permission are different controls. Remove or scope capabilities so unapproved refunds cannot be executed through any alternate path.
Question 14
A Bedrock Guardrails policy begins blocking legitimate educational explanations containing words also used in harmful requests. The team must preserve protection while restoring approved learning content. What should it do?
- Disable all guardrails on the production chatbot until learners stop complaining.
- Analyze labeled false-positive and harmful test cases, then narrowly tune supported safety policy settings and retest.
- Increase the maximum model context window so the content classifier becomes automatically more accurate.
- Exclude every request from a school network because those users are assumed to be safe.
Explanation
Correct Answer
B:Build a representative set of approved educational requests and disallowed near-miss prompts, including paraphrases and context. Inspect which guardrail category or rule caused the block, tune supported thresholds or exemptions narrowly, and compare false-positive and harmful-content detection after the change. Monitor drift so the correction does not reopen attack paths. Summarize category-wise false-positive rates after tuning so a narrow legitimate exception does not silently weaken the detection of truly prohibited requests.
Incorrect Answers
A:Removing all moderation would expose users and connected workflows to the risks the policy was intended to address. The reported problem is an overbroad restriction, not evidence that safety controls are unnecessary. Reproduce the cases and adjust only justified policy behavior while maintaining meaningful negative tests.
C:Context length controls inference input capacity, not the precision of a separately configured content policy. It cannot be relied upon to change guardrail classification behavior. Diagnose the actual triggering rule, test approved cases and avoid changing unrelated model settings as a workaround.
D:Network location does not establish request safety. A school user can submit malicious instructions, and a legitimate student may connect from home. Broad trusted-location exceptions would create bypass opportunities. Keep content-based policy enforcement and tune false positives using actual labeled request examples.
Question 15
An order agent invokes a payment provider through Lambda. Lambda times out after a payment is accepted, and a retry runs on a new execution environment. Select TWO controls that prevent a duplicate charge while allowing safe recovery.
- Use an idempotency key or transaction reference that the payment backend enforces across retries.
- Delete previous execution history so the model does not remember whether payment succeeded.
- Persist the workflow checkpoint and reconcile payment status from the provider before repeating the action.
- Record a retry counter in Lambda process memory and skip the payment-provider status lookup after a timeout.
- Permit unlimited retries until the order succeeds, without tracking the original transaction.
Explanation
Correct Answers
A:A durable idempotency key ties retries to the same business operation, allowing the payment service to return the prior result or reject a duplicate. This is necessary because network timeouts do not establish whether funds moved. The key must be stable across Lambda retries and associated with the authorized customer, amount and recipient. Test an ambiguous provider timeout where the first payment was accepted, then verify the second invocation produces no duplicate charge or customer notice.
C:A workflow checkpoint records that payment was requested and saves the transaction identifier. After a timeout, the next invocation checks the payment provider’s authoritative result and either continues from confirmed success or follows a controlled failure path. This pairs with idempotency so uncertain delivery never becomes an unbounded second charge. Test an ambiguous provider timeout where the first payment was accepted, then verify the second invocation produces no duplicate charge or customer notice.
Incorrect Answers
B:Deleting state removes the evidence needed to distinguish an incomplete request from a successfully charged one. It makes duplicate payment more likely, not less. Transactional workflows must preserve the original operation identifier and reconcile uncertain outcomes against the provider before attempting another side effect.
D:Lambda retries can run in a different execution environment, so an in-memory counter cannot reliably identify an already accepted charge. After an ambiguous timeout the workflow must reconcile provider state and rely on a durable idempotency token respected across invocations. A counter alone provides neither guarantee.
E:Unlimited retries can trigger multiple charges when the first response was lost even if the payment was accepted. It also increases cost and incident noise. Bound attempts, preserve transaction identity and check the provider’s accepted operation before determining whether a retry is safe.
Question 16
A government RAG assistant uses public regulations and private case files. Its public answers must never include details from internal cases, even when the same query mentions a claimant. Which control should be applied?
- Combine all indexed passages and instruct the model to omit private names from the final prose.
- Use a single unrestricted retrieval identity because the model can decide what content is public.
- Fine-tune on carefully tagged public and private cases, but continue retrieving across both classifications into a shared prompt.
- Separate source authorization by data classification and requester identity before placing passages into model context.
Explanation
Correct Answer
D:Classify public regulations separately from private case records, then implement identity-scoped retrieval filters or physically isolated indexes. Pass only passages authorized for the caller and current task to the model. Validate access from public and internal accounts, including cached and indirect query paths. Citations should preserve source versions without revealing excluded private records. An explicit public-only test account must not retrieve internal case metadata through either semantic search, cached answers or citation-preview endpoints.
Incorrect Answers
A:Omitting names from generated prose does not prevent leakage of other private facts, and the model has already received the restricted files. Postgeneration filtering is not a reliable substitute for authorization. Enforce public/private classification and retrieval permissions before context assembly, then test that restricted documents never appear for public queries.
B:A general retrieval identity may see files a public user is not entitled to read. A model cannot grant itself or the user authority through its generated reasoning. Bind each retrieval call to verified permissions and data classifications, with separate service identities where necessary and meaningful logs.
C:Training with sensitivity labels can improve model recognition but does not implement an access-control boundary. An authorized public user might still receive private case excerpts if retrieval ignores source permissions. Enforce classification and identity filtering before generation regardless of how the model was customized.
Question 17
A customer uploads a PDF for summarization. One page contains text formatted as a system instruction commanding the agent to export account secrets. The PDF itself is untrusted. How should the workflow handle it?
- Treat the embedded instruction as document data, maintain instruction hierarchy and enforce independent secret/tool authorization.
- Elevate the text to the developer role because it appears inside the requested document.
- Execute the export but omit the secret values from the user-visible summary.
- Grant the PDF author access to AWS Secrets Manager before summarizing so the instruction can complete.
Explanation
Correct Answer
A:The document may contain quoted, malicious or irrelevant instructions. Summarization requires interpreting its content, not obeying its commands. Keep lower-trust document text separate from application-controlled rules and restrict any sensitive tool operations using verified identity and IAM boundaries. Flag the suspicious command as source evidence if appropriate. Include a test PDF that impersonates the administrator role and check that restricted AWS actions remain denied despite the document formatting.
Incorrect Answers
B:Document formatting does not confer developer authority. Promoting lower-trust source material into a privileged role would let any uploader change application policy. The assistant should recognize the instruction as part of the PDF and continue only the authorized summary task.
C:Hiding exfiltration from the displayed answer does not make the underlying action safe. If secrets were exported, the security boundary has already failed. Enforcement must stop unauthorized tool invocation rather than merely redact the response text. Preserve relevant detection and tool-call evidence.
D:The PDF author is not automatically an authenticated customer or privileged operator. Granting Secrets Manager access based on embedded document text would create an escalation vulnerability. Verify and restrict backend permissions independently; the user asked for a summary, not a credential export.
Question 18
Two customers use a shared kiosk to continue order-status conversations. The app stores an opaque session ID in a browser cookie, but does not tie it to an authenticated user. What must change?
- Increase cookie lifetime so sessions survive a kiosk restart.
- Bind each session and memory lookup to the verified customer identity and clear or rotate kiosk session state between users.
- Let the model infer the current customer from the wording of their shopping question.
- Store complete customer account passwords alongside conversation history for quicker reauthentication.
Explanation
Correct Answer
B:The application should authenticate the customer before retrieving memory, verify that the session belongs to that principal, and rotate or clear local state at logout or timeout. Conversation records must be partitioned at the storage layer, not selected solely by a stale cookie. Test consecutive users on the same kiosk to confirm isolation. Compare a session that ends with logout and another that expires while the next kiosk visitor is already authenticated to a different account.
Incorrect Answers
A:Longer cookie validity increases the exposure window on shared devices. It does not prove who is using the kiosk or prevent session reuse after a customer leaves. The application needs authenticated ownership checks and safe session cleanup independent of duration settings.
C:User language can be guessed or copied and cannot establish access rights to orders. A model may also confuse people with similar names or products. Identity authorization belongs in the backend session and data lookup, not in natural-language reasoning about the conversation.
D:Storing passwords in a conversational memory database creates unnecessary secret exposure and is not a suitable authentication scheme. Use supported sign-in and short-lived session tokens, keep credential material protected, and enforce per-user data access at every lookup.
Question 19
A helpdesk proof of concept gives fluent answers but sometimes invents escalation phone numbers. The sponsor wants a release decision based on customer risk. Which test strategy is most appropriate?
- Demonstrate five polished answers with no source checks and rely on the sponsor’s impression.
- Choose the model with the longest responses as evidence of completeness.
- Build a labeled corpus of verified escalation contacts, missing-contact cases and near-miss questions; test grounded accuracy and safe refusal.
- Raise temperature so incorrect numbers are less likely to be repeated verbatim.
Explanation
Correct Answer
C:Assemble representative questions that map to verified contact directory entries, including similar department names, outdated numbers and cases where the directory has no answer. Require the assistant to cite the current source or clearly decline to guess. Track exact contact accuracy, unsupported outputs and escalation fallback performance before expanding the pilot. Score both false-contact assertions and correctly declined responses, with stronger penalties for numbers that could redirect callers to fraudsters.
Incorrect Answers
A:A curated demo can showcase usability but hides failure modes. A contact number can look plausible while reaching the wrong team, creating operational risk. The release criterion must require matching approved source records and appropriate behavior when no authorized contact is known.
B:Length is not a measure of whether a phone number is real. Longer answers may introduce more unsupported details and frustrate callers. Use a defined accuracy and refusal rubric on authentic contact records rather than treating verbosity as quality evidence.
D:Sampling randomness can change which invented number appears, not supply authoritative contact information. Lower randomness may reproduce the same hallucination consistently. Ground outputs in a verified directory and use evaluation against labeled cases to establish whether the assistant is safe for customers.
Question 20
A support chatbot includes two years of chat history with every model call, making requests expensive and sometimes exceeding the context limit. It must still remember an active unresolved refund promise. What should it do?
- Delete all history and ask the model to guess any missing commitments.
- Keep every turn forever because additional context always improves answer relevance.
- Move the entire chat into a system instruction so its tokens do not count against the context budget.
- Retain essential verified commitments in structured state and prune or summarize unrelated older turns with provenance checks.
Explanation
Correct Answer
D:Store durable facts such as the verified refund promise, authorized amounts, timestamps and pending action in structured state. Summarize or prune incidental conversation while preserving citations or IDs for important commitments. Measure input-token reduction and test multi-turn continuity so optimization does not lose legal or customer obligations. Review memory summaries for omitted promises, dates and approved amounts after multiple topic switches and during a different Lambda execution.
Incorrect Answers
A:Deleting every record removes the promise the team must honor. The model cannot independently reconstruct a customer-specific agreement or refund amount. Preserve key business commitments in authenticated structured state and provide relevant context to the next interaction instead of guessing.
B:More history can increase cost, latency and distracting context while risking the model’s token limit. It can also include sensitive information no longer needed. Use a retention policy and select or summarize what matters to the current support task, with explicit protected fields for unresolved commitments.
C:System instructions still occupy model context and carry higher behavioral authority, making this a poor place for untrusted historical conversation text. Moving content between roles does not make tokens free. Keep user-history data separate from application policy and control how much authorized context is supplied.