Anthropic CCDV-F (Claude Certified Developer - Foundations) Practice Test 4

Question 30

A classifier confuses “cancel a pending order” with “return an already delivered order.” Its prompt contains only straightforward cancellation examples. What prompt change most directly teaches the missing distinction?

  1. Add many more examples of obvious pending-order cancellations only.
  2. Add contrasting labeled examples for both delivery states and the decision rule.
  3. Remove all task-specific instructions and rely on a general helpful-assistant role.
  4. Label delivered-order examples as cancellations so both outputs use one category.

Explanation

Correct Answer

B:

The missing boundary is the order’s state, not the number of examples. Contrasting similar requests with different states demonstrates how the rule should affect classification; labels must remain consistent so the examples do not contradict the instruction.

Incorrect Answers

A:

More examples on the same side of the boundary reinforce existing coverage. They do not show when a superficially similar request should be treated as a return.

C:

A broad role does not explain the operational distinction between cancellation and return. Removing the rule makes the required classification boundary less explicit.

D:

That changes the task by erasing the required distinction. Consistent formatting cannot compensate for examples that teach the wrong business rule.

Question 31

A document-answering assistant must report only facts supported by the supplied product manual. A user asks for a warranty duration, but the manual contains no warranty information. Which response policy best meets the requirement?

  1. Use the most common warranty duration for similar products without qualification.
  2. Invent a warranty sentence and cite the nearest maintenance section.
  3. Ask Claude to be more confident and then accept its first specific duration.
  4. Report the evidence gap and request an authoritative warranty source.

Explanation

Correct Answer

D:

The available evidence does not support a duration. Explicitly identifying the gap preserves the source boundary and gives the user a practical next step without converting a plausible guess into a documented fact.

Incorrect Answers

A:

A common industry pattern is not evidence about this product. It violates the requirement to report only facts supported by the supplied manual.

B:

A citation must support its associated claim. Pointing to unrelated manual text gives unsupported information the appearance of verification and does not establish a warranty period.

C:

Confidence in phrasing is not additional evidence. A more assertive answer still lacks the required source support when the relevant information is absent.

Question 32

A consumer expects structured output but occasionally receives stop_reason="max_tokens" with an unfinished JSON string. What is the best handling strategy before downstream processing?

  1. Detect truncation and recover a complete response before parsing and validation.
  2. Assume HTTP success guarantees a complete application payload.
  3. Append a closing brace and assume every intended field is now present.
  4. Disable validation so incomplete objects can pass through the workflow.

Explanation

Correct Answer

A:

Truncation is a generation outcome the consumer must handle explicitly. It should not publish partial data as complete; a retry with sufficient output budget or another designed recovery path can precede parsing, schema checks, and business validation.

Incorrect Answers

B:

Transport success and task completion are different conditions. A successful API response can report that generation stopped at its limit, so the application must inspect the response metadata.

C:

Repairing surface syntax does not recover omitted content. A string made parseable this way may still lack required values or contain incomplete meaning.

D:

Removing checks hides the failure and transfers uncertainty into downstream logic. Consumers may then act on missing fields or silently interpret partial data as final.

Question 33

A support tool accepts account_id. A signed-in customer asks Claude to inspect another customer’s account, and the model produces a syntactically valid tool request using that identifier. Where must the decisive access check occur?

  1. Only in the tool’s JSON Schema by declaring account_id to be a string.
  2. In a response filter after the complete account record has been sent to Claude.
  3. Only in a prompt asking Claude to respect customer privacy.
  4. In the backend tool or service, against the caller’s authenticated identity and entitlement.

Explanation

Correct Answer

D:

A model-proposed identifier is untrusted input, even when it satisfies the tool schema. The service must verify that the authenticated caller may access the selected account before returning its data.

Incorrect Answers

A:

A type constraint checks representation, not ownership. A well-formed string can still identify an account the caller is not authorized to read.

B:

Post-retrieval filtering acts after unauthorized data has already been exposed to another processing component. The decisive check belongs before protected data is returned.

C:

Prompt guidance can influence behavior but is not the enforcing authority for protected data. Access checks must still hold when the model follows an improper request or is manipulated.

Question 34

A Claude Code deployment must prevent its agent from deleting production records. The team can configure tool hooks and the database identity used by the tool. Which TWO controls directly enforce prevention at separate layers? Choose TWO.

  1. Keep full database privileges and rely only on a CLAUDE.md warning.
  2. Remove production-delete privileges from the database identity used by the agent.
  3. Allow deletion whenever the model describes the action as safe.
  4. Use a PreToolUse policy hook that denies the prohibited delete operation before execution.
  5. Use only a PostToolUse hook to announce that a deletion already happened.

Explanation

Correct Answers

B:

A backend permission boundary denies deletion even if an upper-layer control is missed. This limits the authority available to the agent instead of relying solely on correct model behavior or one hook implementation.

D:

A pre-execution decision can block a matching tool invocation before its side effect occurs. The policy needs to cover the actual operation and arguments; a reminder in natural language is not the same as a blocking hook.

Incorrect Answers

A:

The warning supplies behavioral context rather than an independently enforced permission boundary. An instruction-following failure would still leave the deletion capability available.

C:

A model-generated description is not an authorization decision. Allowing the same actor to override the rule through its own wording defeats the prohibition.

E:

Post-action observation can support auditing, but it runs after the operation. Announcing a completed deletion is not preventive enforcement.

Question 35

A public browser bundle accidentally contains a production Anthropic API key. The application still needs to call Claude. Which TWO actions directly address the exposed credential and prevent the replacement from being distributed in browser code? Choose TWO.

  1. Delete the key from the source file but leave the exposed credential active indefinitely.
  2. Encode the existing key with Base64 before rebuilding the browser bundle.
  3. Revoke the exposed credential and provision a replacement through the approved secret-management process.
  4. Place the replacement in a frontend build variable and substitute it into public JavaScript.
  5. Make authenticated backend calls using a server-held secret instead of embedding the replacement in the frontend.

Explanation

Correct Answers

C:

A key delivered publicly must be treated as compromised. Revocation removes its ongoing authority; issuing a replacement through controlled handling restores service without continuing to trust the disclosed credential.

E:

The backend can hold the provider credential outside the downloadable bundle and enforce application access controls. Browser code then invokes the application’s authorized endpoint rather than possessing the provider’s secret.

Incorrect Answers

A:

Removing future exposure does not invalidate copies already downloaded. The compromised credential remains usable until its authority is revoked or otherwise disabled.

B:

Base64 is reversible encoding, not secret protection. Anyone who can download the bundle can recover the same still-valid credential.

D:

Build-time substitution still ships the resulting value to clients. Calling it an environment variable does not keep a credential secret when its contents are embedded in downloadable code.

Question 36

Claude often confuses a lookup_customer tool with a create_customer tool. Both have vague descriptions, and their identifiers are documented only as “id.” Which change most directly improves the model-facing contract?

  1. Clarify tool purposes, side effects, and required parameter semantics.
  2. Return larger customer records from every call without changing the definitions.
  3. Make all inputs optional so any model-generated call can be accepted.
  4. Force create_customer on every turn to make tool selection predictable.
  5. Rename both tools to short numeric names while leaving descriptions unchanged.

Explanation

Correct Answer

A:

Tool selection depends on understanding what each capability does and when it is appropriate. Clear parameter semantics distinguish an existing customer identifier from data needed to create a record. Execution-side validation and permissions remain necessary.

Incorrect Answers

B:

More output may increase context use, but the selection error happens before those results arrive. It does not repair the vague descriptions and parameter meanings.

C:

Removing required fields can allow incomplete operations through the contract. It does not teach the distinction between reading an existing record and creating a new one.

D:

A fixed choice removes ambiguity by choosing an operation that is wrong for lookup requests. Predictability is useful only when the selected action matches the user’s intent.

E:

Short labels do not explain the difference between lookup and creation. Removing semantic clues makes selection harder without clarifying the argument requirements.

Question 37

An MCP server should expose a callable reservation operation, a policy document that an application can read as context, and a reusable user-invoked planning template. Which THREE mappings use the corresponding MCP primitives correctly? Choose THREE.

  1. Expose the reservation operation as a tool.
  2. Expose the reservation side effect only as an ordinary document resource read.
  3. Use a prompt as the server’s transport connection.
  4. Expose the policy document as a resource.
  5. Expose the reusable planning template as a prompt.
  6. Use a resource URI as a universal authorization grant for every tool.

Explanation

Correct Answers

A:

Tools represent executable capabilities offered by a server. A reservation operation takes inputs and performs work, so it belongs behind a callable interface with the necessary authorization and confirmation controls.

D:

Resources provide contextual information that a client can retrieve and supply to its model. A document reference is a natural fit when the purpose is to read policy content rather than trigger a reservation.

E:

Prompts package reusable interaction templates that a user can select. Parameters can adapt the template while preserving the intended planning structure.

Incorrect Answers

B:

Reading contextual data should not disguise a reservation action. A side-effecting operation needs an explicit callable contract rather than being hidden behind the document retrieval requested here.

C:

A prompt is an interaction template, not the communication channel. Transport configuration determines how client and server exchange protocol messages.

F:

A resource identifier locates context; it does not establish entitlement to unrelated operations. Authentication and authorization must be enforced separately from naming resources.

Question 38

A local MCP server uses stdio. It writes JSON-RPC messages and ordinary debug lines to stdout, causing its client to report malformed messages. What is the appropriate fix?

  1. Prefix debug lines with DEBUG and continue writing them to stdout.
  2. Reserve stdout for valid protocol messages and send diagnostic logging to stderr.
  3. Ask Claude to ignore malformed lines in its system prompt.
  4. Send all JSON-RPC responses to stderr and keep logs on stdout.

Explanation

Correct Answer

B:

In stdio transport, stdout is the server’s protocol channel. Unstructured log lines contaminate that stream. Stderr is available for diagnostics without making those lines part of the JSON-RPC exchange.

Incorrect Answers

A:

A recognizable label does not turn a log line into a valid MCP message. The client still receives nonprotocol content on the channel it must parse.

C:

The transport parser encounters the invalid lines before they can become model context. Prompt instructions do not fix the process-level protocol framing.

D:

That reverses the documented channel responsibilities. A client reading protocol responses from stdout would still receive logs and miss the actual messages.

Question 39

A team already has working repository-reading and test tools. It wants Claude Code to follow a reusable release-review checklist with examples and supporting scripts, invoked when a developer requests that review. No new external service is needed. Which customization is the closest fit?

  1. Increase the model’s context window and leave the procedure in private notes.
  2. Build a new MCP server just to restate the checklist as a remote integration.
  3. Replace every existing tool with one unrestricted shell command.
  4. Package the checklist, examples, and supporting resources as a Claude Code Skill.

Explanation

Correct Answer

D:

A Skill organizes reusable task instructions and related resources for an existing agent environment. It can guide how available capabilities are used without introducing a new network service solely to distribute the review procedure.

Incorrect Answers

A:

A larger window does not automatically make the checklist available to the team or invoke it at the right time. The procedure still needs a shared, discoverable packaging mechanism.

B:

MCP is useful for exposing services and capabilities through a protocol boundary. This requirement is primarily reusable procedure within an environment that already has the necessary tools, so the extra integration is unnecessary.

C:

Consolidating tools does not package the review method or examples. It also broadens the execution interface without solving the instruction-reuse requirement.

Question 40

A custom address-lookup tool fails because its upstream service times out. The harness has a pending tool_use identifier, and the lookup has not produced an address. How should the failure be returned to Claude?

  1. Return a matching tool_result with is_error=true and a concise, sanitized failure description.
  2. Put the entire exception, including credentials, into ordinary assistant text and omit the tool result.
  3. Generate a new unrelated tool-use identifier for the error.
  4. Return an empty address as a successful result.

Explanation

Correct Answer

A:

The matching identifier connects the observation to the attempted lookup. An explicit error distinguishes failure from an empty successful result, allowing the application and model to follow their recovery policy without inventing an address or exposing sensitive diagnostics.

Incorrect Answers

B:

That leaks sensitive information and bypasses the structured tool-response relationship. A sanitized error observation is sufficient; raw secrets are not needed for the model to understand that the lookup failed.

C:

The result must refer to the pending invocation. A new identifier breaks that association and can leave the original tool call unresolved in the conversation.

D:

An empty successful value can be interpreted as a real lookup outcome. It hides the difference between “no address exists” and “the service did not respond.”

Claude Certified Developer - Foundations (CCDV-F) Practice Tests