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

Question 300

Two approval criteria are still open for an agent access-control assessment: the team must stop frontend users from receiving unrestricted backend tool credentials and reduce exposure after an API key is suspected compromised. Which two implementation actions satisfy them? Choose TWO.

  1. Use a server-side workload identity or scoped service credential.
  2. Check resource-level authorization for every sensitive tool request.
  3. Enforce a pre-tool hook that denies the disallowed call.
  4. Record authenticated approval events with actor, scope, and request correlation.
  5. Revoke and rotate the affected credential and update dependent services.

Explanation

Correct Answers

A:

To stop frontend users from receiving unrestricted backend tool credentials as part of a design that must also reduce exposure after an API key is suspected compromised, service identities tie privileges to a runtime workload and avoid exposing long-lived secrets to browsers or untrusted users; this is why the action is one of the two required selections.

E:

To reduce exposure after an API key is suspected compromised as part of a design that must also stop frontend users from receiving unrestricted backend tool credentials, rotation restores credential control only when the old secret is disabled and consumers move to the replacement safely; this is why the action is one of the two required selections.

Incorrect Answers

B:

This alternative serves the separate goal to stop an authenticated user from reading another tenant's records via a tool because proving identity does not grant access to every object; the backend must enforce tenant and resource permissions separately; the required outcomes are instead to stop frontend users from receiving unrestricted backend tool credentials and to reduce exposure after an API key is suspected compromised.

C:

This alternative serves the separate goal to stop a coding agent from running commands that match a prohibited destructive pattern because a deterministic hook checks the proposed command before execution, providing a stronger control than asking the agent to self-police; the required outcomes are instead to stop frontend users from receiving unrestricted backend tool credentials and to reduce exposure after an API key is suspected compromised.

D:

This alternative serves the separate goal to demonstrate who approved a privileged tool action and when because an audit trail binds authorization to a specific action, making privilege use reviewable without treating model-generated text as proof of consent; the required outcomes are instead to stop frontend users from receiving unrestricted backend tool credentials and to reduce exposure after an API key is suspected compromised.

Question 301

A planned upgrade to a multi-tenant support application has two requirements that must both pass: distinguish an end user's request from previous assistant turns in a dialogue; recognize that the model is asking the application to execute a client tool. Identify the two direct implementations. Choose TWO.

  1. Configure an available server-side tool with the required API definition.
  2. Return tool_result blocks containing the corresponding tool_use_id.
  3. Assemble messages with correct user and assistant roles.
  4. Include a typed image content block in the message.
  5. Branch on stop_reason tool_use and dispatch the declared calls.

Explanation

Correct Answers

C:

To distinguish an end user's request from previous assistant turns in a dialogue as part of a design that must also recognize that the model is asking the application to execute a client tool, 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.

E:

To recognize that the model is asking the application to execute a client tool as part of a design that must also distinguish an end user's request from previous assistant turns in a dialogue, a tool-use stop requires host-side handling and a follow-up message containing results, not presenting the call as final prose; this is why the action is one of the two required selections.

Incorrect Answers

A:

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 distinguish an end user's request from previous assistant turns in a dialogue and to recognize that the model is asking the application to execute a client tool.

B:

This alternative serves the separate goal to connect execution output to the exact tool request Claude made because tool correlation preserves call-to-result semantics in the message sequence, especially when several tools were requested together; the required outcomes are instead to distinguish an end user's request from previous assistant turns in a dialogue and to recognize that the model is asking the application to execute a client tool.

D:

This alternative serves the separate goal to ask Claude to interpret a supported image supplied as part of a request because multimodal input must use the API's image representation and supported sourcing; merely writing a filename in text does not transfer pixels; the required outcomes are instead to distinguish an end user's request from previous assistant turns in a dialogue and to recognize that the model is asking the application to execute a client tool.

Question 302

A change request for a production prompt pipeline combines two needs: maintain label semantics when a few-shot prompt contains dialogue, and teach a classifier how to label borderline requests consistently. Which implementation pair addresses both, not just one?

  1. Perform both steps: (1) Rank and select relevant passages before building the model context; (2) specify the forbidden content alongside an enforceable validation check.
  2. Perform both steps: (1) Use properly labeled example inputs and outputs instead of mixing speakers; (2) specify the forbidden content alongside an enforceable validation check.
  3. Perform both steps: (1) Use properly labeled example inputs and outputs instead of mixing speakers; (2) supply representative labeled examples including edge conditions.
  4. Perform both steps: (1) Rank and select relevant passages before building the model context; (2) supply representative labeled examples including edge conditions.

Explanation

Correct Answer

C:

The first change enables the team to maintain label semantics when a few-shot prompt contains dialogue because correct role boundaries keep demonstrations interpretable and prevent an example answer from looking like a live instruction; the second addresses the separate need to teach a classifier how to label borderline requests consistently because diverse demonstrations make the intended decision boundary clearer than an isolated easy example, provided labels are accurate.

Incorrect Answers

A:

Both steps target different results—keep only evidence that matters to the question when retrieval returns hundreds of documents and avoid a prohibited output element such as confidential identifiers—because relevance filtering reduces distracting information and token usage; dumping every retrieved page can degrade grounding and exceed limits and negative prompt guidance signals the intended boundary, but a deterministic validator is needed where violating it has consequences; the required capabilities are instead to maintain label semantics when a few-shot prompt contains dialogue and to teach a classifier how to label borderline requests consistently.

B:

The first step is appropriate for the requirement to maintain label semantics when a few-shot prompt contains dialogue because correct role boundaries keep demonstrations interpretable and prevent an example answer from looking like a live instruction; the other step instead aims to avoid a prohibited output element such as confidential identifiers because negative prompt guidance signals the intended boundary, but a deterministic validator is needed where violating it has consequences, which does not meet the second requirement to teach a classifier how to label borderline requests consistently.

D:

The second step meets the requirement to teach a classifier how to label borderline requests consistently because diverse demonstrations make the intended decision boundary clearer than an isolated easy example, provided labels are accurate; the first step would only help to keep only evidence that matters to the question when retrieval returns hundreds of documents because relevance filtering reduces distracting information and token usage; dumping every retrieved page can degrade grounding and exceed limits, leaving the separate requirement to maintain label semantics when a few-shot prompt contains dialogue unmet.

Question 303

A team maintaining a document-analysis assistant must meet 2 separate acceptance criteria: (1) pinpoint which known workflow stage failed when the final artifact is incomplete; (2) inspect the result of a completed tool call before later model reasoning consumes it. Which two implementation actions directly satisfy the stated requirements? Choose TWO.

  1. Record stage-level traces and intermediate validation outcomes.
  2. Fan out to role-specific reviewers and aggregate disagreements.
  3. Alternate model tool-use requests with tool results until completion.
  4. Attach a post-execution observation hook to the tool lifecycle.
  5. Retrieve only task-relevant memories into the active context.

Explanation

Correct Answers

A:

The test to pinpoint which known workflow stage failed when the final artifact is incomplete is met because deterministic stages are operationally useful when their boundaries are observable; a final answer alone cannot reveal which step produced the fault; the remaining selection covers the separate need to inspect the result of a completed tool call before later model reasoning consumes it.

D:

The test to inspect the result of a completed tool call before later model reasoning consumes it is met because post-tool inspection can record or validate outcomes after execution, but it cannot retroactively prevent side effects from the completed call; the remaining selection covers the separate need to pinpoint which known workflow stage failed when the final artifact is incomplete.

Incorrect Answers

B:

The action is useful for the separate capability to have independent specialized reviewers inspect the same proposal from different perspectives because separating reviews allows conflicting evidence to surface before the supervisor combines findings; a single sequential review may miss independent critiques; however, the required test outcomes are to pinpoint which known workflow stage failed when the final artifact is incomplete and to inspect the result of a completed tool call before later model reasoning consumes it.

C:

The action is useful for the separate capability to plan another step only after inspecting the result of a requested external operation because the loop returns observations to the model so subsequent decisions are informed by actual tool output rather than imagined execution; however, the required test outcomes are to pinpoint which known workflow stage failed when the final artifact is incomplete and to inspect the result of a completed tool call before later model reasoning consumes it.

E:

The action is useful for the separate capability to stop old agent histories from burying the information needed for the current step because selective retrieval improves signal-to-noise and keeps token use bounded while retaining access to older information when required; however, the required test outcomes are to pinpoint which known workflow stage failed when the final artifact is incomplete and to inspect the result of a completed tool call before later model reasoning consumes it.

Question 304

For a model-family migration plan, the missing capability is to invite stylistic variety during noncritical brainstorming. What should the developers implement?

  1. Measure or count input and output tokens with the supported tokenizer or API.
  2. Provide one accurate input-output demonstration.
  3. Use more exploratory sampling where supported and measure quality.
  4. Design for stochastic output and evaluate behavior over representative repeats.

Explanation

Correct Answer

C:

To invite stylistic variety during noncritical brainstorming in this model-family migration plan, higher sampling randomness broadens candidate phrasing but can reduce predictability, so it suits ideation better than strict extraction; the proposed implementation directly supplies that capability.

Incorrect Answers

A:

The proposed alternative helps to estimate model usage from encoded text rather than counting words because billing and context consumption track tokens, which do not map one-to-one to English words or characters; that mechanism does not meet the different requirement to invite stylistic variety during noncritical brainstorming.

B:

The proposed alternative helps to teach a distinctive output format with one representative example because a single example illustrates structure and conventions, but it may not reveal how to handle difficult edge cases; that mechanism does not meet the different requirement to invite stylistic variety during noncritical brainstorming.

D:

The proposed alternative helps to account for different plausible answers from the same input on repeated runs because sampling and model execution can produce variation; important correctness must be checked rather than assumed identical on every call; that mechanism does not meet the different requirement to invite stylistic variety during noncritical brainstorming.

Question 305

While planning a business workflow that calls Claude, the product owner specifies that it must avoid assuming a structured SDK response is a plain string. Which solution fulfills the requirement?

  1. Detect transport interruption and mark incomplete generated content.
  2. Submit independent requests through the Message Batches API.
  3. Inspect response.content blocks and metadata through the SDK's typed representation.
  4. Include a typed image content block in the message.

Explanation

Correct Answer

C:

To avoid assuming a structured SDK response is a plain string in this business workflow that calls Claude, the SDK exposes block types, stop reason, and usage separately; naïve string concatenation can lose tool requests or other content; the proposed implementation directly supplies that capability.

Incorrect Answers

A:

The proposed alternative helps 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; that mechanism does not meet the different requirement to avoid assuming a structured SDK response is a plain string.

B:

The proposed alternative helps to process a large queue of independent, noninteractive requests at a lower-cost asynchronous pace because batch processing is suited to deferred work with eventual result collection and is not a substitute for an interactive low-latency chat endpoint; that mechanism does not meet the different requirement to avoid assuming a structured SDK response is a plain string.

D:

The proposed alternative helps to ask Claude to interpret a supported image supplied as part of a request because multimodal input must use the API's image representation and supported sourcing; merely writing a filename in text does not transfer pixels; that mechanism does not meet the different requirement to avoid assuming a structured SDK response is a plain string.

Question 306

In a context-rich document assistant, a release requirement is to identify when a long agent discussion begins solving a different problem than the user approved. Which implementation addresses that specific requirement?

  1. Map or reject values not in the approved enumeration.
  2. Recheck current plans against a stored objective and constraints.
  3. Summarize prior decisions and preserve unresolved constraints.
  4. State explicit priority and conflict resolution for the task constraints.

Explanation

Correct Answer

B:

To identify when a long agent discussion begins solving a different problem than the user approved in this context-rich document assistant, explicit objective comparison detects drift before tool actions diverge from the original task; extra history alone cannot guarantee alignment; the proposed implementation directly supplies that capability.

Incorrect Answers

A:

The proposed alternative helps to prevent a generated status outside a database's accepted code set because controlled vocabularies need explicit allowed values; a plausible new status label can still break downstream contracts; that mechanism does not meet the different requirement to identify when a long agent discussion begins solving a different problem than the user approved.

C:

The proposed alternative helps to maintain the current task after older dialogue exceeds the active token budget because a faithful rolling summary carries forward objectives and commitments while avoiding a full-history replay on each call; that mechanism does not meet the different requirement to identify when a long agent discussion begins solving a different problem than the user approved.

D:

The proposed alternative helps to prioritize mandatory legal requirements over optional stylistic preferences because without a priority rule, competing directives can create ambiguous outputs; hard requirements should guide how optional preferences are applied; that mechanism does not meet the different requirement to identify when a long agent discussion begins solving a different problem than the user approved.

Question 307

A release check on a latency-sensitive model gateway found two unsatisfied conditions: the service must know why a long prompt plus a proposed response may exceed the model's accepted context, and it must favor more consistent word choices in a constrained transformation task when supported. Which complete engineering plan satisfies both?

  1. Perform both steps: (1) Budget total context for instructions, history, tools, and output; (2) measure input-token usage per request and track the prompt components.
  2. Perform both steps: (1) Budget total context for instructions, history, tools, and output; (2) tune sampling for lower variance while retaining output validation.
  3. Perform both steps: (1) Measure cache-write overhead against subsequent cache-read savings; (2) measure input-token usage per request and track the prompt components.
  4. Perform both steps: (1) Measure cache-write overhead against subsequent cache-read savings; (2) tune sampling for lower variance while retaining output validation.

Explanation

Correct Answer

B:

The first change enables the team to know why a long prompt plus a proposed response may exceed the model's accepted context because a context window bounds what can be processed in one request; large tool results consume it along with user messages; the second addresses the separate need to favor more consistent word choices in a constrained transformation task when supported because temperature influences token sampling; it cannot by itself guarantee truth, policy compliance, or reproducible structured output.

Incorrect Answers

A:

The first step is appropriate for the requirement to know why a long prompt plus a proposed response may exceed the model's accepted context because a context window bounds what can be processed in one request; large tool results consume it along with user messages; the other step instead aims to explain a billing increase after lengthy system instructions are added because repeated prefixes and conversation history consume billable input, so cost cannot be inferred from output length alone, which does not meet the second requirement to favor more consistent word choices in a constrained transformation task when supported.

C:

Both steps target different results—reduce repeated cost for a stable lengthy policy prefix reused many times and explain a billing increase after lengthy system instructions are added—because cache writes may cost extra while hits are cheaper; the reuse frequency determines whether the optimization saves money and repeated prefixes and conversation history consume billable input, so cost cannot be inferred from output length alone; the required capabilities are instead to know why a long prompt plus a proposed response may exceed the model's accepted context and to favor more consistent word choices in a constrained transformation task when supported.

D:

The second step meets the requirement to favor more consistent word choices in a constrained transformation task when supported because temperature influences token sampling; it cannot by itself guarantee truth, policy compliance, or reproducible structured output; the first step would only help to reduce repeated cost for a stable lengthy policy prefix reused many times because cache writes may cost extra while hits are cheaper; the reuse frequency determines whether the optimization saves money, leaving the separate requirement to know why a long prompt plus a proposed response may exceed the model's accepted context unmet.

Question 308

A planned upgrade to a codebase used by several Claude Code operators has two requirements that must both pass: introduce Claude Code to an unfamiliar codebase's conventions and commands; enforce a team-approved permission policy despite local developer preferences. Identify the two direct implementations. Choose TWO.

  1. Define policy in the appropriate managed or shared settings scope.
  2. Place a path-targeted rule in the repository's rules configuration.
  3. Invoke the supported noninteractive or print-mode command interface.
  4. Initialize project guidance and review the resulting CLAUDE.md content.
  5. Use the supported session continuation or resume mechanism.

Explanation

Correct Answers

A:

To enforce a team-approved permission policy despite local developer preferences as part of a design that must also introduce Claude Code to an unfamiliar codebase's conventions and commands, Claude Code has multiple configuration scopes; binding policy to the required scope matters more than placing a rule in an arbitrary JSON file; this is why the action is one of the two required selections.

D:

To introduce Claude Code to an unfamiliar codebase's conventions and commands as part of a design that must also enforce a team-approved permission policy despite local developer preferences, repository setup discovers useful project practices, but autogenerated guidance still needs a human check for accuracy and unnecessary detail; this is why the action is one of the two required selections.

Incorrect Answers

B:

This alternative serves the separate goal to apply a coding convention only when Claude Code edits a particular path because scoped rules keep specialized instructions close to their applicable files, avoiding global instructions that conflict with other modules; the required outcomes are instead to introduce Claude Code to an unfamiliar codebase's conventions and commands and to enforce a team-approved permission policy despite local developer preferences.

C:

This alternative serves the separate goal to run a Claude Code task from an automated CI job without an interactive terminal because headless operation outputs results for automation and requires explicit credential, permission, and failure handling in the CI environment; the required outcomes are instead to introduce Claude Code to an unfamiliar codebase's conventions and commands and to enforce a team-approved permission policy despite local developer preferences.

E:

This alternative serves the separate goal to continue a previously interrupted Claude Code work session because restoring session context reduces lost work while preserving continuity of prior tool activity; opening a new unrelated session does not do the same; the required outcomes are instead to introduce Claude Code to an unfamiliar codebase's conventions and commands and to enforce a team-approved permission policy despite local developer preferences.

Question 309

An end-to-end test for a multi-tenant support application checks whether it can enforce a caller-defined textual boundary on generation and explain why a previously cached prompt is now charged as new input. Which plan should be approved to satisfy both checks?

  1. Perform both steps: (1) Use stop_sequences and inspect the returned stop_sequence field; (2) inspect changes to content and ordering before the cache breakpoint.
  2. Perform both steps: (1) Use stop_sequences and inspect the returned stop_sequence field; (2) cache an eligible unchanged prefix with cache_control.
  3. Perform both steps: (1) Branch on stop_reason tool_use and dispatch the declared calls; (2) cache an eligible unchanged prefix with cache_control.
  4. Perform both steps: (1) Branch on stop_reason tool_use and dispatch the declared calls; (2) inspect changes to content and ordering before the cache breakpoint.

Explanation

Correct Answer

A:

The first change enables the team 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 second addresses the separate need 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.

Incorrect Answers

B:

The first step is appropriate for the requirement 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 other step instead aims 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, which does not meet the second requirement to explain why a previously cached prompt is now charged as new input.

C:

Both steps target different results—recognize that the model is asking the application to execute a client tool and reuse a long stable instruction or document prefix over repeated requests—because a tool-use stop requires host-side handling and a follow-up message containing results, not presenting the call as final prose and prompt caching reduces repeated input processing when the prefix matches; changes before the cache boundary can prevent a hit; the required capabilities are instead to enforce a caller-defined textual boundary on generation and to explain why a previously cached prompt is now charged as new input.

D:

The second step meets the requirement 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; the first step would only help 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, leaving the separate requirement to enforce a caller-defined textual boundary on generation unmet.

Question 310

A team maintaining a sensitive-data assistant must meet 2 separate acceptance criteria: (1) detect unauthorized modifications to a tool result before it reaches the model; (2) stop frontend users from receiving unrestricted backend tool credentials. Which two implementation actions directly satisfy the stated requirements? Choose TWO.

  1. Pause execution for explicit approval at the high-impact action boundary.
  2. Verify origin and integrity of sensitive external data where supported.
  3. Use a server-side workload identity or scoped service credential.
  4. Treat retrieved content as untrusted and prevent its instructions from controlling tools.
  5. Isolate external search results and validate any resulting tool action independently.

Explanation

Correct Answers

B:

The test to detect unauthorized modifications to a tool result before it reaches the model is met because trusted decisions require confidence that tool outputs were not altered; transport and signature checks complement content validation; the remaining selection covers the separate need to stop frontend users from receiving unrestricted backend tool credentials.

C:

The test to stop frontend users from receiving unrestricted backend tool credentials is met because service identities tie privileges to a runtime workload and avoid exposing long-lived secrets to browsers or untrusted users; the remaining selection covers the separate need to detect unauthorized modifications to a tool result before it reaches the model.

Incorrect Answers

A:

The action is useful for the separate capability to require a person to approve an irreversible administrative change because human approval is a policy-enforced transition, not a note written in the model's plan or a message displayed afterward; however, the required test outcomes are to detect unauthorized modifications to a tool result before it reaches the model and to stop frontend users from receiving unrestricted backend tool credentials.

D:

The action is useful for the separate capability to resist instructions embedded in a retrieved support ticket that demand secret disclosure because source material is data rather than authority; enforcing tool permissions and separating roles limits an attacker's ability to redirect execution; however, the required test outcomes are to detect unauthorized modifications to a tool result before it reaches the model and to stop frontend users from receiving unrestricted backend tool credentials.

E:

The action is useful for the separate capability to reject a malicious instruction inserted into a web-search result rather than the user's direct request because indirect attacks exploit lower-trust retrieval surfaces, so trusting search snippets as operational directives crosses a security boundary; however, the required test outcomes are to detect unauthorized modifications to a tool result before it reaches the model and to stop frontend users from receiving unrestricted backend tool credentials.

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