Question 750
In a Python Claude API backend, a release requirement is to reuse a long stable instruction or document prefix over repeated requests. Which implementation addresses that specific requirement?
- Assign and preserve unique custom identifiers for batched requests.
- Read the completed stream's usage and final message metadata.
- Cache an eligible unchanged prefix with cache_control.
- Inspect changes to content and ordering before the cache breakpoint.
Explanation
Correct Answer
C:To reuse a long stable instruction or document prefix over repeated requests in this Python Claude API backend, prompt caching reduces repeated input processing when the prefix matches; changes before the cache boundary can prevent a hit; the proposed implementation directly supplies that capability.
Incorrect Answers
A:The proposed alternative helps to map out-of-order batch outputs back to source records reliably because asynchronous results need stable correlation keys; relying on processing order can attach an output to the wrong input; that mechanism does not meet the different requirement to reuse a long stable instruction or document prefix over repeated requests.
B:The proposed alternative helps to account accurately for token consumption when a response is streamed because early text deltas do not necessarily carry authoritative final usage or stop information; accounting must wait for the appropriate terminal event; that mechanism does not meet the different requirement to reuse a long stable instruction or document prefix over repeated requests.
D:The proposed alternative helps to explain why a previously cached prompt is now charged as new input because cache reuse depends on matching prefix material; adding text to the front changes what is cached even if later text is unchanged; that mechanism does not meet the different requirement to reuse a long stable instruction or document prefix over repeated requests.
Question 751
For a customer-facing AI feature, a design is acceptable only if it can authenticate a server-to-server Claude API request while also being able to catch unsafe credentials and incorrect tool calls before deployment. Which paired implementation is sufficient?
- Perform both steps: (1) Add automated consumer-provider contract tests; (2) use the provider-specific endpoint, authentication, and request conventions.
- Perform both steps: (1) Add automated consumer-provider contract tests; (2) require peer review focused on api, security, and tool-side effects.
- Perform both steps: (1) Place a valid secret in the documented API authentication header; (2) use the provider-specific endpoint, authentication, and request conventions.
- Perform both steps: (1) Place a valid secret in the documented API authentication header; (2) require peer review focused on api, security, and tool-side effects.
Explanation
Correct Answer
D:The first change enables the team to authenticate a server-to-server Claude API request because API authentication is a request transport concern; placing a key inside the prompt body neither authenticates the request nor protects it; the second addresses the separate need to catch unsafe credentials and incorrect tool calls before deployment because human review should check trust boundaries and external actions in addition to style; successful compilation cannot prove these behaviors are safe.
Incorrect Answers
A:Both steps target different results—detect a changed tool response field before it breaks downstream code and support Claude models accessed through different supported cloud offerings—because schema contracts make integration changes visible and prevent a renamed field from silently corrupting later model context and Claude API, Bedrock, and Vertex-style integrations are not interchangeable URLs; host authentication and service wrappers differ; the required capabilities are instead to authenticate a server-to-server Claude API request and to catch unsafe credentials and incorrect tool calls before deployment.
B:The second step meets the requirement to catch unsafe credentials and incorrect tool calls before deployment because human review should check trust boundaries and external actions in addition to style; successful compilation cannot prove these behaviors are safe; the first step would only help to detect a changed tool response field before it breaks downstream code because schema contracts make integration changes visible and prevent a renamed field from silently corrupting later model context, leaving the separate requirement to authenticate a server-to-server Claude API request unmet.
C:The first step is appropriate for the requirement to authenticate a server-to-server Claude API request because API authentication is a request transport concern; placing a key inside the prompt body neither authenticates the request nor protects it; the other step instead aims to support Claude models accessed through different supported cloud offerings because Claude API, Bedrock, and Vertex-style integrations are not interchangeable URLs; host authentication and service wrappers differ, which does not meet the second requirement to catch unsafe credentials and incorrect tool calls before deployment.
Question 752
A team maintaining a controlled model release must meet 3 separate acceptance criteria: (1) compare candidate models before switching a mission-critical endpoint; (2) ask questions about information in a user-provided PDF through a supported document input; (3) send a model inference request with the operation expected by the REST endpoint. Which three implementation actions directly satisfy the stated requirements? Choose THREE.
- Authenticate incoming callbacks and validate their signatures where supported.
- Enable required plugin or connector capabilities using least-privilege configuration.
- Treat model migration as a tested deployment with staged traffic.
- Attach the PDF using the supported document content form.
- Use the API's documented POST request with a JSON body.
- Specify expected concurrency and enforce admission or queueing limits.
Explanation
Correct Answers
C:The test to compare candidate models before switching a mission-critical endpoint is met because model upgrades may alter output distributions or supported features; staged validation reduces the chance of an unnoticed behavior shift; the remaining selections covers the separate need to ask questions about information in a user-provided PDF through a supported document input and need to send a model inference request with the operation expected by the REST endpoint.
D:The test to ask questions about information in a user-provided PDF through a supported document input is met because document analysis depends on actual supported content blocks and size limits; a local file path alone is not accessible to the remote model; the remaining selections covers the separate need to compare candidate models before switching a mission-critical endpoint and need to send a model inference request with the operation expected by the REST endpoint.
E:The test to send a model inference request with the operation expected by the REST endpoint is met because a state-changing inference operation is submitted as an HTTP request with an explicit method and payload, not inferred from a browser URL alone; the remaining selections covers the separate need to compare candidate models before switching a mission-critical endpoint and need to ask questions about information in a user-provided PDF through a supported document input.
Incorrect Answers
A:The action is useful for the separate capability to trust a callback only after verifying who actually sent it because network arrival alone does not prove a webhook's origin; authenticity checks prevent forged events from changing agent state; however, the required test outcomes are to compare candidate models before switching a mission-critical endpoint and to ask questions about information in a user-provided PDF through a supported document input and to send a model inference request with the operation expected by the REST endpoint.
B:The action is useful for the separate capability to expose external business tools only to workflows that actually need them because tools expand the application's action surface; indiscriminate activation increases risk and can confuse model selection among similar functions; however, the required test outcomes are to compare candidate models before switching a mission-critical endpoint and to ask questions about information in a user-provided PDF through a supported document input and to send a model inference request with the operation expected by the REST endpoint.
F:The action is useful for the separate capability to design for a documented burst of simultaneous requests without uncontrolled overload because capacity planning separates average traffic from peak demand and prevents upstream rate limits from becoming cascading application failures; however, the required test outcomes are to compare candidate models before switching a mission-critical endpoint and to ask questions about information in a user-provided PDF through a supported document input and to send a model inference request with the operation expected by the REST endpoint.
Question 753
Two approval criteria are still open for a business workflow that calls Claude: the team must recover when a response ends because its generation budget was reached and detect that the assistant has naturally finished a response. Which two implementation actions satisfy them? Choose TWO.
- Enable streaming and consume server-sent events in order.
- Detect transport interruption and mark incomplete generated content.
- Handle stop_reason max_tokens as truncation and continue or revise the limit.
- Use stop_sequences and inspect the returned stop_sequence field.
- Treat stop_reason end_turn as a completed assistant turn.
Explanation
Correct Answers
C:To recover when a response ends because its generation budget was reached as part of a design that must also detect that the assistant has naturally finished a response, a truncated completion may contain unfinished content, so treating it as a validated final answer risks losing required fields; this is why the action is one of the two required selections.
E:To detect that the assistant has naturally finished a response as part of a design that must also recover when a response ends because its generation budget was reached, the completion signal is explicit in the response metadata; it should not be inferred solely from a sentence ending in punctuation; this is why the action is one of the two required selections.
Incorrect Answers
A:This alternative serves the separate goal to show generated text progressively instead of waiting for the full response because streaming transmits partial deltas and completion events, allowing earlier display while requiring the client to assemble content safely; the required outcomes are instead to recover when a response ends because its generation budget was reached and to detect that the assistant has naturally finished a response.
B:This alternative serves the separate goal to avoid silently treating a broken streaming connection as a complete answer because network termination before a final message event can leave a partial response, which needs explicit recovery rather than success handling; the required outcomes are instead to recover when a response ends because its generation budget was reached and to detect that the assistant has naturally finished a response.
D:This alternative serves the separate goal to enforce a caller-defined textual boundary on generation because a stop sequence halts generation at a specified marker, distinct from natural completion and separate from a JSON schema validator; the required outcomes are instead to recover when a response ends because its generation budget was reached and to detect that the assistant has naturally finished a response.
Question 754
A change request for a high-volume Messages API gateway combines two needs: recover when a response ends because its generation budget was reached, and set consistent developer-controlled behavior separately from untrusted user text. Which implementation pair addresses both, not just one?
- Perform both steps: (1) Parse response content by block type and follow current thinking-field rules; (2) inspect http status and structured error payload before interpreting model output.
- Perform both steps: (1) Handle stop_reason max_tokens as truncation and continue or revise the limit; (2) inspect http status and structured error payload before interpreting model output.
- Perform both steps: (1) Handle stop_reason max_tokens as truncation and continue or revise the limit; (2) send instructions using the request's top-level system field.
- Perform both steps: (1) Parse response content by block type and follow current thinking-field rules; (2) send instructions using the request's top-level system field.
Explanation
Correct Answer
C:The first change enables the team to recover when a response ends because its generation budget was reached because a truncated completion may contain unfinished content, so treating it as a validated final answer risks losing required fields; the second addresses the separate need to set consistent developer-controlled behavior separately from untrusted user text because the system field separates higher-priority application guidance from user-message content and should not be simulated by ordinary quoted text.
Incorrect Answers
A:Both steps target different results—handle a response containing reasoning-related blocks without confusing them with ordinary final text and distinguish API transport failures from a successfully returned model refusal—because structured content may contain distinct block types and signatures; a parser that assumes only plain text can discard important protocol data and rate limits, authorization failures, and server errors happen at the request layer, unlike a normal response with a refusal stop reason; the required capabilities are instead to recover when a response ends because its generation budget was reached and to set consistent developer-controlled behavior separately from untrusted user text.
B:The first step is appropriate for the requirement to recover when a response ends because its generation budget was reached because a truncated completion may contain unfinished content, so treating it as a validated final answer risks losing required fields; the other step instead aims to distinguish API transport failures from a successfully returned model refusal because rate limits, authorization failures, and server errors happen at the request layer, unlike a normal response with a refusal stop reason, which does not meet the second requirement to set consistent developer-controlled behavior separately from untrusted user text.
D:The second step meets the requirement to set consistent developer-controlled behavior separately from untrusted user text because the system field separates higher-priority application guidance from user-message content and should not be simulated by ordinary quoted text; the first step would only help to handle a response containing reasoning-related blocks without confusing them with ordinary final text because structured content may contain distinct block types and signatures; a parser that assumes only plain text can discard important protocol data, leaving the separate requirement to recover when a response ends because its generation budget was reached unmet.
Question 755
While planning a hosted document-processing service, the product owner specifies that it must prevent duplicate purchases or tickets if an agent repeats a tool call. Which solution fulfills the requirement?
- Supply the required API version header.
- Classify permanent client errors separately from transient failures.
- Use asynchronous SDK calls with bounded concurrency.
- Give mutating operations an application-level idempotency key.
Explanation
Correct Answer
D:To prevent duplicate purchases or tickets if an agent repeats a tool call in this hosted document-processing service, idempotency ensures replays of the same intended action do not create duplicate real-world effects even when orchestration retries; the proposed implementation directly supplies that capability.
Incorrect Answers
A:The proposed alternative helps to make a direct REST request with a declared supported API contract because the version header selects the protocol contract supported by the endpoint, preventing accidental dependence on unspecified behavior; that mechanism does not meet the different requirement to prevent duplicate purchases or tickets if an agent repeats a tool call.
B:The proposed alternative helps to avoid retrying a malformed request that the API consistently rejects because a deterministic validation or authorization error requires fixing the request or credential, not another identical attempt; that mechanism does not meet the different requirement to prevent duplicate purchases or tickets if an agent repeats a tool call.
C:The proposed alternative helps to serve many concurrent network-bound Claude requests without blocking worker threads unnecessarily because async I/O can overlap network waits, but it does not remove provider limits or make CPU-heavy postprocessing nonblocking; that mechanism does not meet the different requirement to prevent duplicate purchases or tickets if an agent repeats a tool call.
Question 756
To ship a TypeScript Claude integration, the application must ask Claude to interpret a supported image supplied as part of a request and distinguish an end user's request from previous assistant turns in a dialogue. Which pair of listed actions is necessary for those stated capabilities? Choose TWO.
- Include a typed image content block in the message.
- Assemble messages with correct user and assistant roles.
- Branch on stop_reason tool_use and dispatch the declared calls.
- Configure an available server-side tool with the required API definition.
- Cache an eligible unchanged prefix with cache_control.
Explanation
Correct Answers
A:To ask Claude to interpret a supported image supplied as part of a request as part of a design that must also distinguish an end user's request from previous assistant turns in a dialogue, multimodal input must use the API's image representation and supported sourcing; merely writing a filename in text does not transfer pixels; this is why the action is one of the two required selections.
B:To distinguish an end user's request from previous assistant turns in a dialogue as part of a design that must also ask Claude to interpret a supported image supplied as part of a request, conversation structure influences how the model interprets dialogue and tool history; flattening roles into one text string loses that structure; this is why the action is one of the two required selections.
Incorrect Answers
C:This alternative serves the separate goal to recognize that the model is asking the application to execute a client tool because a tool-use stop requires host-side handling and a follow-up message containing results, not presenting the call as final prose; the required outcomes are instead to ask Claude to interpret a supported image supplied as part of a request and to distinguish an end user's request from previous assistant turns in a dialogue.
D:This alternative serves the separate goal to use provider-hosted search or execution without implementing the tool body locally because provider-executed tools are handled in Anthropic's environment and differ from client functions that the caller must run; the required outcomes are instead to ask Claude to interpret a supported image supplied as part of a request and to distinguish an end user's request from previous assistant turns in a dialogue.
E:This alternative serves the separate goal to reuse a long stable instruction or document prefix over repeated requests because prompt caching reduces repeated input processing when the prefix matches; changes before the cache boundary can prevent a hit; the required outcomes are instead to ask Claude to interpret a supported image supplied as part of a request and to distinguish an end user's request from previous assistant turns in a dialogue.
Question 757
An end-to-end test for a multi-tenant support application checks whether it can handle a response containing reasoning-related blocks without confusing them with ordinary final text and avoid silently treating a broken streaming connection as a complete answer. Which plan should be approved to satisfy both checks?
- Perform both steps: (1) Parse response content by block type and follow current thinking-field rules; (2) detect transport interruption and mark incomplete generated content.
- Perform both steps: (1) Inspect HTTP status and structured error payload before interpreting model output; (2) attach the pdf using the supported document content form.
- Perform both steps: (1) Parse response content by block type and follow current thinking-field rules; (2) attach the pdf using the supported document content form.
- Perform both steps: (1) Inspect HTTP status and structured error payload before interpreting model output; (2) detect transport interruption and mark incomplete generated content.
Explanation
Correct Answer
A:The first change enables the team to handle a response containing reasoning-related blocks without confusing them with ordinary final text because structured content may contain distinct block types and signatures; a parser that assumes only plain text can discard important protocol data; the second addresses the separate need to avoid silently treating a broken streaming connection as a complete answer because network termination before a final message event can leave a partial response, which needs explicit recovery rather than success handling.
Incorrect Answers
B:Both steps target different results—distinguish API transport failures from a successfully returned model refusal and ask questions about information in a user-provided PDF through a supported document input—because rate limits, authorization failures, and server errors happen at the request layer, unlike a normal response with a refusal stop reason and document analysis depends on actual supported content blocks and size limits; a local file path alone is not accessible to the remote model; the required capabilities are instead to handle a response containing reasoning-related blocks without confusing them with ordinary final text and to avoid silently treating a broken streaming connection as a complete answer.
C:The first step is appropriate for the requirement to handle a response containing reasoning-related blocks without confusing them with ordinary final text because structured content may contain distinct block types and signatures; a parser that assumes only plain text can discard important protocol data; the other step instead aims to ask questions about information in a user-provided PDF through a supported document input because document analysis depends on actual supported content blocks and size limits; a local file path alone is not accessible to the remote model, which does not meet the second requirement to avoid silently treating a broken streaming connection as a complete answer.
D:The second step meets the requirement to avoid silently treating a broken streaming connection as a complete answer because network termination before a final message event can leave a partial response, which needs explicit recovery rather than success handling; the first step would only help to distinguish API transport failures from a successfully returned model refusal because rate limits, authorization failures, and server errors happen at the request layer, unlike a normal response with a refusal stop reason, leaving the separate requirement to handle a response containing reasoning-related blocks without confusing them with ordinary final text unmet.
Question 758
A team maintaining a Python Claude API backend has two different engineering requirements: (1) catch mismatches between model calls, tool handlers, and application persistence, and (2) restore a known-working prompt and model configuration after quality degrades. Which TWO independent changes directly meet them? Choose TWO.
- Keep versioned artifacts and a tested rollback procedure.
- Validate generated fields against domain rules after parsing.
- Enable required plugin or connector capabilities using least-privilege configuration.
- Send instructions using the request's top-level system field.
- Exercise complete request-to-tool-to-response paths in a controlled environment.
Explanation
Correct Answers
A:To restore a known-working prompt and model configuration after quality degrades as part of a design that must also catch mismatches between model calls, tool handlers, and application persistence, model IDs, prompts, schemas, and tool contracts are release components; restoring just the application binary may not restore prior behavior; this is why the action is one of the two required selections.
E:To catch mismatches between model calls, tool handlers, and application persistence as part of a design that must also restore a known-working prompt and model configuration after quality degrades, unit tests cannot reveal every serialization or permission issue across service boundaries; integration tests validate the connected contract; this is why the action is one of the two required selections.
Incorrect Answers
B:This alternative serves the separate goal to stop a well-formed JSON response from introducing an impossible customer status because a syntactically valid object may still contain invalid business values; server-side semantics determine whether it is acceptable; the required outcomes are instead to catch mismatches between model calls, tool handlers, and application persistence and to restore a known-working prompt and model configuration after quality degrades.
C:This alternative serves the separate goal to expose external business tools only to workflows that actually need them because tools expand the application's action surface; indiscriminate activation increases risk and can confuse model selection among similar functions; the required outcomes are instead to catch mismatches between model calls, tool handlers, and application persistence and to restore a known-working prompt and model configuration after quality degrades.
D:This alternative serves the separate goal to set consistent developer-controlled behavior separately from untrusted user text because the system field separates higher-priority application guidance from user-message content and should not be simulated by ordinary quoted text; the required outcomes are instead to catch mismatches between model calls, tool handlers, and application persistence and to restore a known-working prompt and model configuration after quality degrades.
Question 759
A team maintaining a document assistant product must meet 3 separate acceptance criteria: (1) let a reviewer trace claims to the material actually consulted; (2) set consistent developer-controlled behavior separately from untrusted user text; (3) determine whether a quality regression came from a recent instruction edit. Which three implementation actions directly satisfy the stated requirements? Choose THREE.
- Set the appropriate application/json content type and serialize a valid payload.
- Send instructions using the request's top-level system field.
- Retain source identifiers with retrieved evidence and render supported citations.
- Store prompt versions with release identifiers and rollback history.
- Commit lockfiles and control library upgrades.
- Configure supported structured outputs with a JSON Schema.
Explanation
Correct Answers
B:The test to set consistent developer-controlled behavior separately from untrusted user text is met because the system field separates higher-priority application guidance from user-message content and should not be simulated by ordinary quoted text; the remaining selections covers the separate need to let a reviewer trace claims to the material actually consulted and need to determine whether a quality regression came from a recent instruction edit.
C:The test to let a reviewer trace claims to the material actually consulted is met because traceability requires linking claims to accessible source passages; fabricated URLs or unlabeled snippets do not provide verifiable provenance; the remaining selections covers the separate need to set consistent developer-controlled behavior separately from untrusted user text and need to determine whether a quality regression came from a recent instruction edit.
D:The test to determine whether a quality regression came from a recent instruction edit is met because a prompt is a behavior-changing artifact; versioning makes comparisons and safe reversions possible during incident response; the remaining selections covers the separate need to set consistent developer-controlled behavior separately from untrusted user text and need to let a reviewer trace claims to the material actually consulted.
Incorrect Answers
A:The action is useful for the separate capability to have the server parse a JSON request body predictably because a JSON body requires both correct serialization and matching HTTP metadata; raw language-model text cannot replace a valid request object; however, the required test outcomes are to set consistent developer-controlled behavior separately from untrusted user text and to let a reviewer trace claims to the material actually consulted and to determine whether a quality regression came from a recent instruction edit.
E:The action is useful for the separate capability to ensure a rebuilt agent uses the same tested SDK dependency set because dependency pinning reduces environment drift; transitive SDK updates can change behavior even when prompt text is unchanged; however, the required test outcomes are to set consistent developer-controlled behavior separately from untrusted user text and to let a reviewer trace claims to the material actually consulted and to determine whether a quality regression came from a recent instruction edit.
F:The action is useful for the separate capability to need schema-conformant JSON for a downstream parser at generation time because constrained JSON generation targets machine-parseable fields and types; free-form prompting alone does not establish the same guarantee; however, the required test outcomes are to set consistent developer-controlled behavior separately from untrusted user text and to let a reviewer trace claims to the material actually consulted and to determine whether a quality regression came from a recent instruction edit.
Question 760
For a production inference application, the missing capability is to limit the blast radius of a new model configuration during rollout. What should the developers implement?
- Use the API's documented POST request with a JSON body.
- Exercise complete request-to-tool-to-response paths in a controlled environment.
- Handle stop_reason max_tokens as truncation and continue or revise the limit.
- Release to a small monitored cohort before broad deployment.
Explanation
Correct Answer
D:To limit the blast radius of a new model configuration during rollout in this production inference application, canary exposure provides real traffic signals with an option to stop or roll back, unlike a simultaneous change for every customer; the proposed implementation directly supplies that capability.
Incorrect Answers
A:The proposed alternative helps to send a model inference request with the operation expected by the REST endpoint because a state-changing inference operation is submitted as an HTTP request with an explicit method and payload, not inferred from a browser URL alone; that mechanism does not meet the different requirement to limit the blast radius of a new model configuration during rollout.
B:The proposed alternative helps to catch mismatches between model calls, tool handlers, and application persistence because unit tests cannot reveal every serialization or permission issue across service boundaries; integration tests validate the connected contract; that mechanism does not meet the different requirement to limit the blast radius of a new model configuration during rollout.
C:The proposed alternative helps to recover when a response ends because its generation budget was reached because a truncated completion may contain unfinished content, so treating it as a validated final answer risks losing required fields; that mechanism does not meet the different requirement to limit the blast radius of a new model configuration during rollout.