Claude Certified Developer - Foundations CCDV-F Practice Test 17
Question 160
A developer encounters this situation: An AI product has no per-feature token accounting and cannot explain a billing spike. What is the MOST appropriate technical response?
- Benchmark suitable Claude model tiers for quality, latency and price on the application's actual tasks.
- Apply supported prompt caching or reuse patterns for stable prefix content and monitor cache hits.
- Evaluate stochastic model output with repeated trials and constrain tasks through validation and clear requirements.
- Track input/output tokens and model, cache and batch usage per operation with privacy-safe reporting.
Explanation
Correct Answer
D:Track input/output tokens and model, cache and batch usage per operation with privacy-safe reporting. This directly addresses the situation: An AI product has no per-feature token accounting and cannot explain a billing spike. The technical reason is that cost attribution requires measured usage and explicit prices rather than assumptions about response length. Without it, a chat feature can exceed budget without an owner or per-route cost alert. A concrete acceptance check is: A controlled usage sample yields predictable accounting and an actionable budget alert.
Incorrect Answers
A:Benchmark suitable Claude model tiers for quality, latency and price on the application's actual tasks. This does not repair the current workflow because cost attribution requires measured usage and explicit prices rather than assumptions about response length. The targeted change is track input/output tokens and model, cache and batch usage per operation with privacy-safe reporting.
B:Apply supported prompt caching or reuse patterns for stable prefix content and monitor cache hits. This does not repair the current workflow because cost attribution requires measured usage and explicit prices rather than assumptions about response length. The targeted change is track input/output tokens and model, cache and batch usage per operation with privacy-safe reporting.
C:Evaluate stochastic model output with repeated trials and constrain tasks through validation and clear requirements. This does not repair the current workflow because cost attribution requires measured usage and explicit prices rather than assumptions about response length. The targeted change is track input/output tokens and model, cache and batch usage per operation with privacy-safe reporting.
Question 161
This engineering control is missing: "Pass tool results as lower-trust data and enforce tool authorization in the application layer". The reported condition is: A developer allows a tool result to be appended as a new instruction with elevated authority. What is the most direct failure risk?
- Prompt injection in retrieved results may redirect the agent into unauthorized execution.
- Safety requirements expressed only as prose can be ignored or reinterpreted by the model.
- An unnecessary agent can introduce variable actions, cost and approval gaps into a fixed business process.
- Tool failures can leave an agent stuck, silently incomplete or repeatedly calling services.
Explanation
Correct Answer
A:Prompt injection in retrieved results may redirect the agent into unauthorized execution. This follows from the reported condition: A developer allows a tool result to be appended as a new instruction with elevated authority. The reason is that tool outputs are untrusted observations, not elevated user or system instructions. The appropriate mitigation is: Pass tool results as lower-trust data and enforce tool authorization in the application layer. Evidence of success would be: A malicious tool-result fixture cannot gain permissions or override the declared control policy.
Incorrect Answers
B:Safety requirements expressed only as prose can be ignored or reinterpreted by the model. That exposure calls for use agent or Claude Code hooks for deterministic validations and approvals at supported execution boundaries. The scenario here instead risks prompt injection in retrieved results may redirect the agent into unauthorized execution.
C:An unnecessary agent can introduce variable actions, cost and approval gaps into a fixed business process. That exposure calls for use a deterministic workflow for fixed tasks and reserve autonomous agent loops for genuinely dynamic decisions. The scenario here instead risks prompt injection in retrieved results may redirect the agent into unauthorized execution.
D:Tool failures can leave an agent stuck, silently incomplete or repeatedly calling services. That exposure calls for implement explicit tool-loop controls, errors, iteration limits and observable state in the agent harness. The scenario here instead risks prompt injection in retrieved results may redirect the agent into unauthorized execution.
Question 162
This engineering control is missing: "Log bounded structured request IDs, latency and failure categories while redacting secrets and sensitive content". The reported condition is: Incident responders cannot correlate a failed model call because request identifiers were discarded. What is the most direct failure risk?
- Tool requests and multi-part results may be lost or misinterpreted by a text-only parser.
- Credentials or personal data can be exposed in log storage, or incidents can be impossible to trace.
- The UI or tool handler can assemble malformed content and act on partial arguments.
- Unreviewed configuration drift can expose keys or create inconsistent model behavior.
Explanation
Correct Answer
B:Credentials or personal data can be exposed in log storage, or incidents can be impossible to trace. This follows from the reported condition: Incident responders cannot correlate a failed model call because request identifiers were discarded. The reason is that observability must preserve operational diagnostics without turning logs into a data-leak channel. The appropriate mitigation is: Log bounded structured request IDs, latency and failure categories while redacting secrets and sensitive content. Evidence of success would be: Sample traces correlate request IDs and error types without including keys or protected prompt content.
Incorrect Answers
A:Tool requests and multi-part results may be lost or misinterpreted by a text-only parser. That exposure calls for parse documented typed content blocks and stop reasons rather than flattening responses into text. The scenario here instead risks credentials or personal data can be exposed in log storage, or incidents can be impossible to trace.
C:The UI or tool handler can assemble malformed content and act on partial arguments. That exposure calls for process the documented streaming event sequence by event type and finalize only on completion. The scenario here instead risks credentials or personal data can be exposed in log storage, or incidents can be impossible to trace.
D:Unreviewed configuration drift can expose keys or create inconsistent model behavior. That exposure calls for centralize versioned configuration, protected secrets and environment-specific deployment settings. The scenario here instead risks credentials or personal data can be exposed in log storage, or incidents can be impossible to trace.
Question 163
This engineering control is missing: "Layer input, tool-execution and output checks with human approval for sensitive side effects". The reported condition is: A regulated assistant has only a final-output filter and no validation before high-risk tools run. What is the most direct failure risk?
- A leaked key can enable unauthorized API usage and uncontrolled cost or data access.
- A malicious document could induce data exfiltration or unauthorized tool calls.
- Unsafe actions can occur before a downstream moderation filter sees the result.
- Compromised or confused agents may modify unrelated production records.
Explanation
Correct Answer
C:Unsafe actions can occur before a downstream moderation filter sees the result. This follows from the reported condition: A regulated assistant has only a final-output filter and no validation before high-risk tools run. The reason is that safety controls must protect every consequential boundary, not merely the final generated text. The appropriate mitigation is: Layer input, tool-execution and output checks with human approval for sensitive side effects. Evidence of success would be: Adversarial prompts fail authorization at the tool boundary and produce reviewable audit records.
Incorrect Answers
A:A leaked key can enable unauthorized API usage and uncontrolled cost or data access. That exposure calls for store Claude credentials in a managed secret store, rotate them, and scope access per deployment or tenant. The scenario here instead risks unsafe actions can occur before a downstream moderation filter sees the result.
B:A malicious document could induce data exfiltration or unauthorized tool calls. That exposure calls for treat retrieved and user-supplied content as untrusted data and enforce tool permissions separately. The scenario here instead risks unsafe actions can occur before a downstream moderation filter sees the result.
D:Compromised or confused agents may modify unrelated production records. That exposure calls for enforce least-privilege tool permissions and distinct identities scoped to each workflow. The scenario here instead risks unsafe actions can occur before a downstream moderation filter sees the result.
Question 164
In this situation: A long-running coding task forgets completed decisions each time the conversation is summarized. The developer proposes: Use structured task checkpoints with completed actions, constraints and verified external state. Which principle BEST justifies the approach?
- Context engineering must prioritize decision-relevant state over unbounded transcripts and retrieved noise.
- Context boundaries reduce distraction and unauthorized exposure between independent workstreams.
- Specific, noncontradictory instructions reduce interpretation ambiguity and make validation possible.
- Compaction should preserve durable task state rather than treating a short summary as the entire truth.
Explanation
Correct Answer
D:Compaction should preserve durable task state rather than treating a short summary as the entire truth. In the given situation, a long-running coding task forgets completed decisions each time the conversation is summarized. That consideration supports the measure: Use structured task checkpoints with completed actions, constraints and verified external state. Ignoring it creates this exposure: The agent can duplicate work or violate earlier requirements after losing context. Verify the implementation by checking: A resumed task honors the documented checkpoint and does not rerun completed side effects.
Incorrect Answers
A:Context engineering must prioritize decision-relevant state over unbounded transcripts and retrieved noise. This principle relates to prune low-value tool outputs and preserve a compact summary of goals, decisions and remaining work. The observed failure instead depends on compaction should preserve durable task state rather than treating a short summary as the entire truth. The appropriate choice is compaction should preserve durable task state rather than treating a short summary as the entire truth.
B:Context boundaries reduce distraction and unauthorized exposure between independent workstreams. This principle relates to isolate contexts by user and task, passing only necessary evidence to each subagent. The observed failure instead depends on compaction should preserve durable task state rather than treating a short summary as the entire truth. The appropriate choice is compaction should preserve durable task state rather than treating a short summary as the entire truth.
C:Specific, noncontradictory instructions reduce interpretation ambiguity and make validation possible. This principle relates to give clear role, task, constraints and explicit output contract with consistent examples where helpful. The observed failure instead depends on compaction should preserve durable task state rather than treating a short summary as the entire truth. The appropriate choice is compaction should preserve durable task state rather than treating a short summary as the entire truth.
Question 165
In this situation: An investigation agent retries the same failed action without a budget or user escalation path. The developer proposes: Bound agent iterations, tool budgets and stop conditions with a safe fallback or human escalation. Which principle BEST justifies the approach?
- Autonomous tool loops require termination criteria and explicit limits for predictable operational cost and safety.
- The agent's model output is a proposal; the hosting system must validate and enforce authorized actions.
- Workflows provide predictable control flow while autonomous agents trade flexibility for added uncertainty and oversight needs.
- Agent memory should preserve decision-relevant state rather than an unbounded history of low-value observations.
Explanation
Correct Answer
A:Autonomous tool loops require termination criteria and explicit limits for predictable operational cost and safety. In the given situation, an investigation agent retries the same failed action without a budget or user escalation path. That consideration supports the measure: Bound agent iterations, tool budgets and stop conditions with a safe fallback or human escalation. Ignoring it creates this exposure: Runaway iterations can consume tokens, spam APIs and repeat harmful or useless operations. Verify the implementation by checking: A simulated unresolvable task stops within limits and creates a clear escalation record.
Incorrect Answers
B:The agent's model output is a proposal; the hosting system must validate and enforce authorized actions. This principle relates to keep tool execution and approval policy in deterministic application code rather than relying on model self-restraint. The observed failure instead depends on autonomous tool loops require termination criteria and explicit limits for predictable operational cost and safety. The appropriate choice is autonomous tool loops require termination criteria and explicit limits for predictable operational cost and safety.
C:Workflows provide predictable control flow while autonomous agents trade flexibility for added uncertainty and oversight needs. This principle relates to use a deterministic workflow for fixed tasks and reserve autonomous agent loops for genuinely dynamic decisions. The observed failure instead depends on autonomous tool loops require termination criteria and explicit limits for predictable operational cost and safety. The appropriate choice is autonomous tool loops require termination criteria and explicit limits for predictable operational cost and safety.
D:Agent memory should preserve decision-relevant state rather than an unbounded history of low-value observations. This principle relates to prune tool outputs and maintain concise task state or checkpoints to keep context useful. The observed failure instead depends on autonomous tool loops require termination criteria and explicit limits for predictable operational cost and safety. The appropriate choice is autonomous tool loops require termination criteria and explicit limits for predictable operational cost and safety.
Question 166
In this situation: A knowledge assistant's latency spikes because unchanged system context is reprocessed on every turn. The developer proposes: Apply supported prompt caching or reuse patterns for stable prefix content and monitor cache hits. Which principle BEST justifies the approach?
- Generative models can vary their output even for similar inputs; application correctness needs explicit checks.
- Caching can reduce repeated processing of identical eligible context while requiring correct cache boundaries.
- Examples and instruction clarity improve task alignment but must be consistent with each other.
- Cost attribution requires measured usage and explicit prices rather than assumptions about response length.
Explanation
Correct Answer
B:Caching can reduce repeated processing of identical eligible context while requiring correct cache boundaries. In the given situation, a knowledge assistant's latency spikes because unchanged system context is reprocessed on every turn. That consideration supports the measure: Apply supported prompt caching or reuse patterns for stable prefix content and monitor cache hits. Ignoring it creates this exposure: Unnecessary repeated context processing raises token cost and time to first response. Verify the implementation by checking: Usage metrics show cache reads or reduced eligible prefix processing without mixing user-specific data.
Incorrect Answers
A:Generative models can vary their output even for similar inputs; application correctness needs explicit checks. This principle relates to evaluate stochastic model output with repeated trials and constrain tasks through validation and clear requirements. The observed failure instead depends on caching can reduce repeated processing of identical eligible context while requiring correct cache boundaries. The appropriate choice is caching can reduce repeated processing of identical eligible context while requiring correct cache boundaries.
C:Examples and instruction clarity improve task alignment but must be consistent with each other. This principle relates to use clear task instructions and targeted examples when the required schema or decision boundary is non-obvious. The observed failure instead depends on caching can reduce repeated processing of identical eligible context while requiring correct cache boundaries. The appropriate choice is caching can reduce repeated processing of identical eligible context while requiring correct cache boundaries.
D:Cost attribution requires measured usage and explicit prices rather than assumptions about response length. This principle relates to track input/output tokens and model, cache and batch usage per operation with privacy-safe reporting. The observed failure instead depends on caching can reduce repeated processing of identical eligible context while requiring correct cache boundaries. The appropriate choice is caching can reduce repeated processing of identical eligible context while requiring correct cache boundaries.
Question 167
To address the situation: A system mixes unrelated customer cases in one agent conversation memory. The team implements: "Isolate contexts by user and task, passing only necessary evidence to each subagent". Which evidence BEST demonstrates success?
- A resumed task honors the documented checkpoint and does not rerun completed side effects.
- A malicious embedded instruction is treated as data, not an executable task directive.
- Cross-user and subagent tests confirm no unauthorized context appears in model input or outputs.
- Segmented evaluation shows improved performance without regressions on unseen formats.
Explanation
Correct Answer
C:Cross-user and subagent tests confirm no unauthorized context appears in model input or outputs. This directly tests the outcome of isolate contexts by user and task, passing only necessary evidence to each subagent. in the described case: A system mixes unrelated customer cases in one agent conversation memory. The underlying principle is that context boundaries reduce distraction and unauthorized exposure between independent workstreams. If the change is ineffective, unrelated user data may contaminate answers or leak into another task. A configuration checkbox alone is insufficient proof.
Incorrect Answers
A:A resumed task honors the documented checkpoint and does not rerun completed side effects. This outcome would validate use structured task checkpoints with completed actions, constraints and verified external state, not the requested intervention. The required test result is cross-user and subagent tests confirm no unauthorized context appears in model input or outputs.
B:A malicious embedded instruction is treated as data, not an executable task directive. This outcome would validate separate trusted instruction layers from untrusted task data, and mark data boundaries explicitly, not the requested intervention. The required test result is cross-user and subagent tests confirm no unauthorized context appears in model input or outputs.
D:Segmented evaluation shows improved performance without regressions on unseen formats. This outcome would validate curate representative, consistent few-shot examples and evaluate against held-out cases, not the requested intervention. The required test result is cross-user and subagent tests confirm no unauthorized context appears in model input or outputs.
Question 168
A developer encounters this situation: A developer sets max_tokens too low and truncates a JSON response mid-object. What is the MOST appropriate technical response?
- Maintain a registered allowlist of tool schemas and validate returned names and arguments before execution.
- Use status-aware retry policies with exponential backoff, jitter and bounded attempts for transient errors.
- Use idempotency keys or a verified deduplication record around side-effecting operations.
- Validate output length and stop reason; retry or redesign output constraints when truncation occurs.
Explanation
Correct Answer
D:Validate output length and stop reason; retry or redesign output constraints when truncation occurs. This directly addresses the situation: A developer sets max_tokens too low and truncates a JSON response mid-object. The technical reason is that token limits can terminate generation before a logically complete response. Without it, a partial or invalid answer can corrupt downstream parsing or display. A concrete acceptance check is: A constrained-output test detects truncation and prevents accepting incomplete JSON.
Incorrect Answers
A:Maintain a registered allowlist of tool schemas and validate returned names and arguments before execution. This does not repair the current workflow because token limits can terminate generation before a logically complete response. The targeted change is validate output length and stop reason; retry or redesign output constraints when truncation occurs.
B:Use status-aware retry policies with exponential backoff, jitter and bounded attempts for transient errors. This does not repair the current workflow because token limits can terminate generation before a logically complete response. The targeted change is validate output length and stop reason; retry or redesign output constraints when truncation occurs.
C:Use idempotency keys or a verified deduplication record around side-effecting operations. This does not repair the current workflow because token limits can terminate generation before a logically complete response. The targeted change is validate output length and stop reason; retry or redesign output constraints when truncation occurs.
Question 169
In this situation: A Claude Agent SDK application has hooks but required audit and approval logic lives only in prompt text. The developer proposes: Use agent or Claude Code hooks for deterministic validations and approvals at supported execution boundaries. Which principle BEST justifies the approach?
- Hooks can apply nonprobabilistic policy checks around tool use when installed in the correct execution lifecycle.
- Agent hosting models change who controls execution state, logs and network or data access.
- Tool outputs are untrusted observations, not elevated user or system instructions.
- Autonomous tool loops require termination criteria and explicit limits for predictable operational cost and safety.
Explanation
Correct Answer
A:Hooks can apply nonprobabilistic policy checks around tool use when installed in the correct execution lifecycle. In the given situation, a Claude Agent SDK application has hooks but required audit and approval logic lives only in prompt text. That consideration supports the measure: Use agent or Claude Code hooks for deterministic validations and approvals at supported execution boundaries. Ignoring it creates this exposure: Safety requirements expressed only as prose can be ignored or reinterpreted by the model. Verify the implementation by checking: An intentional risky tool call is blocked by a hook while authorized benign actions continue.
Incorrect Answers
B:Agent hosting models change who controls execution state, logs and network or data access. This principle relates to choose managed versus self-hosted agent execution by evaluating residency, observability, permissions and operational responsibility. The observed failure instead depends on hooks can apply nonprobabilistic policy checks around tool use when installed in the correct execution lifecycle. The appropriate choice is hooks can apply nonprobabilistic policy checks around tool use when installed in the correct execution lifecycle.
C:Tool outputs are untrusted observations, not elevated user or system instructions. This principle relates to pass tool results as lower-trust data and enforce tool authorization in the application layer. The observed failure instead depends on hooks can apply nonprobabilistic policy checks around tool use when installed in the correct execution lifecycle. The appropriate choice is hooks can apply nonprobabilistic policy checks around tool use when installed in the correct execution lifecycle.
D:Autonomous tool loops require termination criteria and explicit limits for predictable operational cost and safety. This principle relates to bound agent iterations, tool budgets and stop conditions with a safe fallback or human escalation. The observed failure instead depends on hooks can apply nonprobabilistic policy checks around tool use when installed in the correct execution lifecycle. The appropriate choice is hooks can apply nonprobabilistic policy checks around tool use when installed in the correct execution lifecycle.
Question 170
This engineering control is missing: "Process the documented streaming event sequence by event type and finalize only on completion". The reported condition is: A service opens streaming responses but cannot distinguish message start, content delta and final usage events. What is the most direct failure risk?
- Unvalidated tool calls may execute unauthorized operations or crash an integration.
- The UI or tool handler can assemble malformed content and act on partial arguments.
- Transient errors can be misinterpreted as valid model data or corrupt application state.
- The model may answer without critical prior constraints or invent missing context.
Explanation
Correct Answer
B:The UI or tool handler can assemble malformed content and act on partial arguments. This follows from the reported condition: A service opens streaming responses but cannot distinguish message start, content delta and final usage events. The reason is that streaming requires preserving event structure and ordering, including tool and usage metadata. The appropriate mitigation is: Process the documented streaming event sequence by event type and finalize only on completion. Evidence of success would be: Recorded event fixtures reconstruct the same final message as the nonstreaming response.
Incorrect Answers
A:Unvalidated tool calls may execute unauthorized operations or crash an integration. That exposure calls for maintain a registered allowlist of tool schemas and validate returned names and arguments before execution. The scenario here instead risks the UI or tool handler can assemble malformed content and act on partial arguments.
C:Transient errors can be misinterpreted as valid model data or corrupt application state. That exposure calls for validate HTTP status, content types and JSON response contracts before processing API results. The scenario here instead risks the UI or tool handler can assemble malformed content and act on partial arguments.
D:The model may answer without critical prior constraints or invent missing context. That exposure calls for persist and re-supply required prior message context explicitly according to the stateless Messages API pattern. The scenario here instead risks the UI or tool handler can assemble malformed content and act on partial arguments.