Anthropic CCA-F Practice Test 2
Question 10
A ticket-writing agent times out after requesting a ticket creation. A retry might create two tickets. What should the controller use?
- A stable idempotency key and read-before-retry reconciliation for the write
- Stop futile retries and surface the credential error for remediation
- Return a structured error tool_result that preserves the failure condition
- Reject the call, expose a clear validation failure, and allow bounded correction
Explanation
Correct Answer
A:A retry after uncertain completion can duplicate side effects. Deduplicating the write through an idempotency key and checking its outcome makes recovery safe. A timeout gives no reliable indication whether the service committed the ticket. Reusing a stable request identifier and checking the provider record before repeating creation prevents duplicate cases and preserves a record of the attempted operation.
Incorrect Answers
B:Authentication failure will not improve through immediate identical retries. This alternative does not establish how to prevent duplicate external writes on retry in the stated workflow.
C:Treating failure as an empty successful result leads the model to make false conclusions. Although useful elsewhere, it is not the direct mechanism to prevent duplicate external writes on retry.
D:Rejecting invalid arguments cannot determine whether the first ticket-creation call succeeded before the timeout. A completely valid request can still create a duplicate when repeated after an uncertain network response. The controller needs a durable idempotency identifier and reconciliation of the first write before retrying.
Question 11
A returns agent can look up orders but may issue refunds only after authorized human approval. Which THREE controls should enforce that boundary? Choose THREE.
- Gate the refund tool in application code before performing its write
- Append the tool_result tied to the outstanding tool_use identifier before continuing
- Wait for the customer lookup and pass its result before choosing the contract tool parameters
- A stable idempotency key and read-before-retry reconciliation for the write
- Verify the signed-in actor has refund authority at the server-side tool boundary.
- Require a recorded approval token linked to the exact refund amount before execution.
Explanation
Correct Answers
A:The refund tool must enforce approval at the executing service, not just in the language-model instruction. Before moving funds, verify the actor, authorized amount, recipient and approval token; reject any attempt that lacks those checks. Server-side gating prevents an apparently persuasive prompt from initiating a payment outside the documented business workflow.
E:Application authorization must be checked for the actual requester, not accepted from model prose. The refund handler should verify the authenticated identity, assigned permission and applicable limits before changing payment state. A model's assertion of approval cannot substitute for a server-side authorization decision tied to the real caller.
F:Binding an approval record to the specific write prevents a general prompt from becoming broad payment authority. The approval needs to authorize this customer, this refund destination and amount, not merely grant the agent general access to a payment tool. The executing service should enforce the token and keep an audit record so a persuasive prompt cannot bypass the financial control.
Incorrect Answers
B:Correlating `tool_result` with the original `tool_use_id` keeps the conversation protocol valid, but it does not authorize money movement. A refund could have perfectly matched tool IDs and still be unapproved. Server-side refund authorization, authenticated actor permissions and an approval record bound to the specific amount are the required controls.
C:The later tool call needs information from the earlier tool response. That addresses a different part of the system, not the requirement to enforce human approval for protected actions.
D:Idempotency keys protect against repeated execution of the same refund, but they do not establish whether the requester was authorized to refund at all. A single unauthorized refund with a perfect idempotency key is still unauthorized. Check the signed-in actor and transaction-bound human approval at the refund tool boundary.
Question 12
A search tool returns thousands of raw documents for a short summary task, exhausting context. What should the application change?
- Limit and rank tool output before adding concise relevant evidence to the conversation
- Preserve the ordered message history and tool-use/result relationships across turns
- Reject the call, expose a clear validation failure, and allow bounded correction
- Branch explicitly on termination and continuation reasons, handling truncation or errors separately
Explanation
Correct Answer
A:Tool results consume context and can bury relevant passages. Retrieval filtering and careful summarization keep sufficient evidence without letting verbose output dominate. The search layer should select only documents relevant to the stated summary, cap the returned passages and retain citation handles. Passing full unranked output can crowd out instructions and evidence from the available context window.
Incorrect Answers
B:Tool-using systems rely on conversational state and referenced tool IDs. It would leave the stated need to keep loop observations bounded and task relevant unresolved.
C:Schema validation can reject malformed tool arguments, yet the stated problem is excessive valid search output that overwhelms context. Even a well-formed query may return thousands of documents. Rank and bound the retrieved evidence before inserting it into the conversation; rejecting arguments alone does not reduce observation volume.
D:A response can stop for reasons other than successful completion. This alternative does not establish how to keep loop observations bounded and task relevant in the stated workflow.
Question 13
A model calls a write tool with arguments that fail its JSON Schema. Which TWO controller steps avoid unsafe execution? Choose TWO.
- Inspect the stop reason and execute any requested tool_use blocks
- Reject the call, expose a clear validation failure, and allow bounded correction
- Preserve the ordered message history and tool-use/result relationships across turns
- Append the tool_result tied to the outstanding tool_use identifier before continuing
- Prevent the side-effecting operation until a corrected payload passes schema validation.
Explanation
Correct Answers
B:Executing invalid arguments can corrupt records or fail unpredictably. A structured validation error makes the specific repair possible without performing the bad action. Return a validation failure for bounded correction, and separately refuse to run the invalid write until validation passes.
E:Blocking execution until revalidation makes the malformed request non-destructive. Schema rejection must occur before a refund, database update or other irreversible action is invoked. The controller should return field-specific validation feedback and permit only a bounded corrected attempt, with the same checks applied again.
Incorrect Answers
A:The tool_use stop reason tells the host that it should handle a tool request, but it is not authorization to execute every offered payload. The arguments are known to violate JSON Schema. Executing them would bypass required input validation; return a field-specific error and do not perform the side effect.
C:Tool-using systems rely on conversational state and referenced tool IDs. Although useful elsewhere, it is not the direct mechanism to handle tool argument validation before executing actions.
D:A well-formed `tool_result` is necessary after a client-tool request, including when the host rejects bad input. But merely appending a result says nothing about preventing the unsafe write; the controller must first refuse execution and report the schema failure so any corrected payload is validated again before the side effect.
Question 14
A claims processing system has three fixed deterministic steps with no branching or judgment. Which architecture is most proportionate?
- Stop futile retries and surface the credential error for remediation
- Gate the refund tool in application code before performing its write
- Terminate the agent loop and return the assistant response
- Use a fixed application workflow instead of an open-ended autonomous loop
Explanation
Correct Answer
D:A fixed sequence of three deterministic checks does not need autonomous tool selection or repeated model planning. Implement each step explicitly in application code, including validation, error handling and audit logging. Claude can still assist with text reasoning where useful, but the predetermined workflow should enforce its own ordering and completion criteria.
Incorrect Answers
A:Stopping identical authentication retries is useful when a credential is actually invalid, but the described claims process has no authentication failure. It has three fixed steps. The design choice is deterministic orchestration of those steps, not an error-specific retry policy for a problem the scenario does not present.
B:Prompt requests alone are not deterministic safeguards for sensitive side effects. This capability does not directly select deterministic flow when the process is fully prescribed.
C:End_turn marks completion of the assistant turn. That addresses a different part of the system, not the requirement to select deterministic flow when the process is fully prescribed.
Question 15
A controller restarts a tool-using conversation using only the latest assistant message, omitting earlier tool_use blocks. What should it preserve?
- Preserve the ordered message history and tool-use/result relationships across turns
- Execute the requested tool and return its result in the next model turn
- Append the tool_result tied to the outstanding tool_use identifier before continuing
- Reject the call, expose a clear validation failure, and allow bounded correction
Explanation
Correct Answer
A:Tool-using systems rely on conversational state and referenced tool IDs. Replaying only the most recent text loses decisions and may break the protocol. A resumed controller must retain which assistant tool_use IDs were issued and which user tool_result blocks answered them. Losing this ordered history can cause a fresh response to refer to nonexistent or unmatched tool calls and may repeat state-changing operations.
Incorrect Answers
B:The tool_use stop reason indicates that the model expects the application to perform the tool invocation and provide the result. It would leave the stated need to maintain a coherent message transcript during loop replay unresolved.
C:The assistant cannot reason reliably from an external result it never received. Although useful elsewhere, it is not the direct mechanism to maintain a coherent message transcript during loop replay.
D:Executing invalid arguments can corrupt records or fail unpredictably. This alternative does not establish how to maintain a coherent message transcript during loop replay in the stated workflow.
Question 16
An agent receives a persistent 401 from an external customer API yet keeps calling it unchanged. What is the appropriate controller policy?
- Execute the requested tool and return its result in the next model turn
- Stop futile retries and surface the credential error for remediation
- A stable idempotency key and read-before-retry reconciliation for the write
- Wait for the customer lookup and pass its result before choosing the contract tool parameters
Explanation
Correct Answer
B:Authentication failure will not improve through immediate identical retries. A bounded retry policy should distinguish transient errors from permanent configuration problems. An HTTP 401 signals invalid, missing or expired authentication for the attempted request. Retrying the same credential without refresh or intervention cannot address the cause; surface a sanitized error and route credential renewal to the authorized component.
Incorrect Answers
A:The tool_use stop reason indicates that the model expects the application to perform the tool invocation and provide the result. The scenario instead requires a way to avoid repeating terminal errors without changing conditions.
C:A retry after uncertain completion can duplicate side effects. That addresses a different part of the system, not the requirement to avoid repeating terminal errors without changing conditions.
D:Waiting for a customer lookup is useful when one tool depends on another's output. The failure here is different: the API has already returned an HTTP 401 on an unchanged request. There is no missing dependency to wait for. Stop identical retries and escalate credential renewal or permission repair to an authorized component.
Question 17
A single Claude response asks the host to run two client tools, each with a different tool_use ID. Both tools succeed. Which controller behavior prevents mismatching their outputs before the next Messages API call?
- Return the two tool_result blocks with their original tool_use_id values and preserve the assistant tool-use message in history
- Put the two results in a prose paragraph without identifiers so the model can infer the order
- Discard the original assistant response and start a fresh conversation using only the last result
- Mark the first result as end_turn and omit the second result because one tool already succeeded
Explanation
Correct Answer
A:The host must execute both pending client-tool requests and send a tool_result for each, referencing that request's actual tool_use_id. The original assistant tool-use message and the user result blocks form a linked history; preserving that mapping avoids attaching payment or account data to the wrong operation.
Incorrect Answers
B:Prose without matching identifiers cannot establish which output belongs to which requested operation, particularly when parallel tools finish in a different order. The Messages API expects structured tool_result blocks with matching call IDs, not a narrative guess about sequence.
C:Replacing the conversation with just the last result loses the two pending tool calls and their execution context. The model may then use an incomplete or invalid history, and the first result is never delivered to the request that produced it.
D:End_turn marks completion of an assistant turn, not completion of one of several pending client-tool calls. Omitting the second result leaves an unresolved tool_use ID and can cause an invalid continuation or an incorrect combined answer.
Question 18
A Claude API response has stop_reason max_tokens and ends halfway through a JSON object required by a client. No tool call is pending. What should the application do instead of treating the fragment as a completed answer?
- Treat max_tokens as equivalent to end_turn and commit the incomplete object
- Raise the output allowance or resume generation with the preserved context, then validate the completed object
- Invent the missing keys from defaults and persist the object without validation
- Replay the original user request as an unrelated new conversation and silently discard the partial output
Explanation
Correct Answer
B:The response stopped because it exhausted its output allowance, leaving the JSON object unfinished. The controller should increase the allowed output budget or resume with preserved context as supported, then validate the complete object against the expected schema before any client action. A partial fragment is never evidence that all required values were generated.
Incorrect Answers
A:The max_tokens stop signals an incomplete generation, not a successful final answer. Committing the unclosed JSON object would produce invalid or missing fields and may trigger an unsupported downstream action. An explicit completion and validation step is required before consuming its content.
C:Guessing required values changes the meaning of the extraction or transaction and hides an incomplete inference. The consumer needs actual supported fields and a validation pass, not fabricated defaults added to repair truncation cosmetically.
D:A fresh unrelated conversation loses the exact partial context and may produce different unsupported claims. Recovery should be explicit and tied to the original request, preserving enough state to distinguish an incomplete response from a new task.
Question 19
An informational Claude request does not need access to external systems, but the application sets tool_choice to 'any' for every request. The assistant repeatedly calls unnecessary tools. Which setting best restores proportional tool selection?
- Increase max_tokens and keep forcing a tool call on every request
- Set tool_choice to auto or omit forced selection, while retaining a properly scoped tool list for tasks that need it
- Give the model a broader set of write-enabled tools so it can choose from more possibilities
- Treat every tool_use response as end_turn even when a tool execution is still pending
Explanation
Correct Answer
B:Use automatic tool selection for an informational question. The `any` mode forces a call to one of the provided tools on models that support forced tool selection, even when the user only needs an explanation. `auto` permits a direct answer and still allows a required lookup when the request actually needs external data. Restrict the tool list separately; automatic selection is not a replacement for authorization checks.
Incorrect Answers
A:The output token limit controls response length, not whether a tool call is mandatory. Increasing it does not undo the 'any' selection requirement. The application would still ask the model to choose some tool even for a purely explanatory response, creating needless latency and access to external data.
C:Adding more write-enabled tools cannot solve mandatory tool triggering. It increases the set of potential side effects and permissions without giving the assistant permission to answer directly. The appropriate fix is an automatic or none tool-choice mode, with task-scoped capabilities and runtime authorization rather than a larger privileged tool catalog.
D:Tool-use responses represent outstanding work to execute or handle, not a completed answer merely because text may also be present. Misclassifying tool_use as end_turn would lose real tool results and break the client-tool loop. The problem in this scenario is unnecessary mandatory selection, which should be corrected at the tool_choice configuration boundary.
Question 20
A Claude request uses only a server-executed web search tool. An application stalls, waiting to receive a client-side tool_use block so it can run that search locally. What correction is required?
- Construct a synthetic client tool_result containing a guessed search answer
- Always rerun the web search through an unrelated local shell command
- Let Anthropic execute the server tool and process its returned server_tool_use/results or the final response; handle pause_turn if the server loop pauses
- Mark server_tool_use as an authentication failure unless a human explicitly approves the search
Explanation
Correct Answer
C:Server-executed tools run inside Anthropic’s provider-side loop; the caller does not execute them as client callbacks. It should interpret the returned server tool records and final model response, and preserve the conversation if the operation returns `pause_turn`. A separate client `tool_result` with `tool_use_id` is required for client-executed tools, not for this server-side search.
Incorrect Answers
A:A fabricated tool result would make the model rely on unverified evidence and would not correspond to a pending client-executed tool_use identifier. This server-side search is already handled by the platform. The application must not invent a local replacement for a result that should come from the actual server tool.
B:Server-executed searches do not require a second local copy of the operation. Reissuing the query in a shell can change sources, double costs and create two incompatible evidence trails. The integration should distinguish its own client tools from those Anthropic runs as part of the Messages API request.
D:A `server_tool_use` block describes a provider-executed tool operation; it does not mean the provider rejected the request as unauthorized. Misclassifying this event as authentication failure would prevent a valid search from completing and conceal the actual protocol state. The integration should process the server-tool response or pause rather than invent an unrelated login failure.