Claude Certified Developer - Foundations CCDV-F Practice Test 9
Question 80
A developer encounters this situation: A code-executing agent takes untrusted repository text as permission to run shell commands. What is the MOST appropriate technical response?
- Use agent or Claude Code hooks for deterministic validations and approvals at supported execution boundaries.
- Choose managed versus self-hosted agent execution by evaluating residency, observability, permissions and operational responsibility.
- Separate specialized subagents or phases and restrict high-impact actions behind explicit verified authorization.
- Pass tool results as lower-trust data and enforce tool authorization in the application layer.
Explanation
Correct Answer
D:Pass tool results as lower-trust data and enforce tool authorization in the application layer. This directly addresses the situation: A code-executing agent takes untrusted repository text as permission to run shell commands. The technical reason is that tool outputs are untrusted observations, not elevated user or system instructions. Without it, prompt injection in retrieved results may redirect the agent into unauthorized execution. A concrete acceptance check is: A malicious tool-result fixture cannot gain permissions or override the declared control policy.
Incorrect Answers
A:Use agent or Claude Code hooks for deterministic validations and approvals at supported execution boundaries. This does not repair the current workflow because tool outputs are untrusted observations, not elevated user or system instructions. The targeted change is pass tool results as lower-trust data and enforce tool authorization in the application layer.
B:Choose managed versus self-hosted agent execution by evaluating residency, observability, permissions and operational responsibility. This does not repair the current workflow because tool outputs are untrusted observations, not elevated user or system instructions. The targeted change is pass tool results as lower-trust data and enforce tool authorization in the application layer.
C:Separate specialized subagents or phases and restrict high-impact actions behind explicit verified authorization. This does not repair the current workflow because tool outputs are untrusted observations, not elevated user or system instructions. The targeted change is pass tool results as lower-trust data and enforce tool authorization in the application layer.
Question 81
This engineering control is missing: "Use a deterministic workflow for fixed tasks and reserve autonomous agent loops for genuinely dynamic decisions". The reported condition is: An invoice approval service has deterministic validation steps and no need to choose its own actions. What is the most direct failure risk?
- An unnecessary agent can introduce variable actions, cost and approval gaps into a fixed business process.
- A compromised research context could trigger unauthorized payment changes if tools share excessive authority.
- Context bloat can increase costs, truncation and inconsistent task completion.
- Runaway iterations can consume tokens, spam APIs and repeat harmful or useless operations.
Explanation
Correct Answer
A:An unnecessary agent can introduce variable actions, cost and approval gaps into a fixed business process. This follows from the reported condition: An invoice approval service has deterministic validation steps and no need to choose its own actions. The reason is that workflows provide predictable control flow while autonomous agents trade flexibility for added uncertainty and oversight needs. The appropriate mitigation is: Use a deterministic workflow for fixed tasks and reserve autonomous agent loops for genuinely dynamic decisions. Evidence of success would be: The workflow produces consistent step traces and enforces the required approval order on representative invoices.
Incorrect Answers
B:A compromised research context could trigger unauthorized payment changes if tools share excessive authority. That exposure calls for separate specialized subagents or phases and restrict high-impact actions behind explicit verified authorization. The scenario here instead risks an unnecessary agent can introduce variable actions, cost and approval gaps into a fixed business process.
C:Context bloat can increase costs, truncation and inconsistent task completion. That exposure calls for prune tool outputs and maintain concise task state or checkpoints to keep context useful. The scenario here instead risks an unnecessary agent can introduce variable actions, cost and approval gaps into a fixed business process.
D:Runaway iterations can consume tokens, spam APIs and repeat harmful or useless operations. That exposure calls for bound agent iterations, tool budgets and stop conditions with a safe fallback or human escalation. The scenario here instead risks an unnecessary agent can introduce variable actions, cost and approval gaps into a fixed business process.
Question 82
To address the situation: A planning agent relies on a prompt to prevent an unauthorized action but the harness never checks permissions. The team implements: "Keep tool execution and approval policy in deterministic application code rather than relying on model self-restraint". Which evidence BEST demonstrates success?
- A forced retry produces one intended side effect and a visible record of reconciliation.
- An unapproved tool request is rejected by code and logged even when the model asks to run it.
- An adversarial research input cannot invoke payment tools, while an authorized approval path still works.
- The workflow produces consistent step traces and enforces the required approval order on representative invoices.
Explanation
Correct Answer
B:An unapproved tool request is rejected by code and logged even when the model asks to run it. This directly tests the outcome of keep tool execution and approval policy in deterministic application code rather than relying on model self-restraint. in the described case: A planning agent relies on a prompt to prevent an unauthorized action but the harness never checks permissions. The underlying principle is that the agent's model output is a proposal; the hosting system must validate and enforce authorized actions. If the change is ineffective, a prompt-injected suggestion could cross a trust boundary if the app executes it without validation. A configuration checkbox alone is insufficient proof.
Incorrect Answers
A:A forced retry produces one intended side effect and a visible record of reconciliation. This outcome would validate add idempotency and completed-work tracking to subagent/tool handoffs, not the requested intervention. The required test result is an unapproved tool request is rejected by code and logged even when the model asks to run it.
C:An adversarial research input cannot invoke payment tools, while an authorized approval path still works. This outcome would validate separate specialized subagents or phases and restrict high-impact actions behind explicit verified authorization, not the requested intervention. The required test result is an unapproved tool request is rejected by code and logged even when the model asks to run it.
D:The workflow produces consistent step traces and enforces the required approval order on representative invoices. This outcome would validate use a deterministic workflow for fixed tasks and reserve autonomous agent loops for genuinely dynamic decisions, not the requested intervention. The required test result is an unapproved tool request is rejected by code and logged even when the model asks to run it.
Question 83
In this situation: A Claude Code session repeatedly changes files that the repository instructions explicitly prohibit editing. The developer proposes: Maintain concise project-level Claude Code instructions and scope file/tool permissions to the repository policy. Which principle BEST justifies the approach?
- Deterministic approval boundaries prevent autonomous coding suggestions from becoming unreviewed operational changes.
- AI-produced patches remain software changes requiring human or automated code-quality validation.
- Coding assistants require explicit repository context and tool boundaries, not assumptions about developer intent.
- Request context should contain only task-relevant content while respecting model context and token constraints.
Explanation
Correct Answer
C:Coding assistants require explicit repository context and tool boundaries, not assumptions about developer intent. In the given situation, a Claude Code session repeatedly changes files that the repository instructions explicitly prohibit editing. That consideration supports the measure: Maintain concise project-level Claude Code instructions and scope file/tool permissions to the repository policy. Ignoring it creates this exposure: The assistant may change protected files or ignore required tests during code generation. Verify the implementation by checking: A controlled coding task follows project instructions and avoids excluded files while producing a reviewable diff.
Incorrect Answers
A:Deterministic approval boundaries prevent autonomous coding suggestions from becoming unreviewed operational changes. This principle relates to use Claude Code permissions and supported pre-tool hooks to enforce command approval and safety checks. The observed failure instead depends on coding assistants require explicit repository context and tool boundaries, not assumptions about developer intent. The appropriate choice is coding assistants require explicit repository context and tool boundaries, not assumptions about developer intent.
B:AI-produced patches remain software changes requiring human or automated code-quality validation. This principle relates to review Claude Code changes as small diffs and run targeted tests before accepting or committing them. The observed failure instead depends on coding assistants require explicit repository context and tool boundaries, not assumptions about developer intent. The appropriate choice is coding assistants require explicit repository context and tool boundaries, not assumptions about developer intent.
D:Request context should contain only task-relevant content while respecting model context and token constraints. This principle relates to control prompt assembly with relevant retrieval, truncation rules and context-budget measurements. The observed failure instead depends on coding assistants require explicit repository context and tool boundaries, not assumptions about developer intent. The appropriate choice is coding assistants require explicit repository context and tool boundaries, not assumptions about developer intent.
Question 84
In this situation: An application sends every chat exchange and entire knowledge base on every turn regardless of task. The developer proposes: Control prompt assembly with relevant retrieval, truncation rules and context-budget measurements. Which principle BEST justifies the approach?
- Application-facing output must be parsed and validated against a contract, not inferred from unconstrained prose.
- REST clients must handle status codes and payload structure as separate error conditions.
- Data separation belongs in storage and tool access controls rather than relying on prompt instructions.
- Request context should contain only task-relevant content while respecting model context and token constraints.
Explanation
Correct Answer
D:Request context should contain only task-relevant content while respecting model context and token constraints. In the given situation, an application sends every chat exchange and entire knowledge base on every turn regardless of task. That consideration supports the measure: Control prompt assembly with relevant retrieval, truncation rules and context-budget measurements. Ignoring it creates this exposure: Excessive context raises costs, latency and the likelihood of truncating critical instructions. Verify the implementation by checking: A long-session test stays within target token usage while preserving necessary current constraints.
Incorrect Answers
A:Application-facing output must be parsed and validated against a contract, not inferred from unconstrained prose. This principle relates to require structured validated outputs or constrained tool schemas before business-side execution. The observed failure instead depends on request context should contain only task-relevant content while respecting model context and token constraints. The appropriate choice is request context should contain only task-relevant content while respecting model context and token constraints.
B:REST clients must handle status codes and payload structure as separate error conditions. This principle relates to validate HTTP status, content types and JSON response contracts before processing API results. The observed failure instead depends on request context should contain only task-relevant content while respecting model context and token constraints. The appropriate choice is request context should contain only task-relevant content while respecting model context and token constraints.
C:Data separation belongs in storage and tool access controls rather than relying on prompt instructions. This principle relates to enforce tenant identity, authorization and retrieval filtering before data is supplied to the model. The observed failure instead depends on request context should contain only task-relevant content while respecting model context and token constraints. The appropriate choice is request context should contain only task-relevant content while respecting model context and token constraints.
Question 85
A developer encounters this situation: A Python integration creates a new HTTP client for every model request and leaks sockets under load. What is the MOST appropriate technical response?
- Use reusable supported SDK or HTTP clients with connection management and nonblocking I/O.
- Centralize versioned configuration, protected secrets and environment-specific deployment settings.
- Validate HTTP status, content types and JSON response contracts before processing API results.
- Require structured validated outputs or constrained tool schemas before business-side execution.
Explanation
Correct Answer
A:Use reusable supported SDK or HTTP clients with connection management and nonblocking I/O. This directly addresses the situation: A Python integration creates a new HTTP client for every model request and leaks sockets under load. The technical reason is that resource-conscious client design prevents connection exhaustion and event-loop stalls in API services. Without it, throughput and reliability can collapse as concurrent requests increase. A concrete acceptance check is: A sustained load test shows bounded sockets and stable event-loop response latency.
Incorrect Answers
B:Centralize versioned configuration, protected secrets and environment-specific deployment settings. This does not repair the current workflow because resource-conscious client design prevents connection exhaustion and event-loop stalls in API services. The targeted change is use reusable supported SDK or HTTP clients with connection management and nonblocking I/O.
C:Validate HTTP status, content types and JSON response contracts before processing API results. This does not repair the current workflow because resource-conscious client design prevents connection exhaustion and event-loop stalls in API services. The targeted change is use reusable supported SDK or HTTP clients with connection management and nonblocking I/O.
D:Require structured validated outputs or constrained tool schemas before business-side execution. This does not repair the current workflow because resource-conscious client design prevents connection exhaustion and event-loop stalls in API services. The targeted change is use reusable supported SDK or HTTP clients with connection management and nonblocking I/O.
Question 86
A developer encounters this situation: An API gateway retries requests after client timeouts and creates duplicate downstream business records. What is the MOST appropriate technical response?
- Use documented Messages API request fields and supported client SDK methods with schema validation.
- Use idempotency keys or a verified deduplication record around side-effecting operations.
- Require structured validated outputs or constrained tool schemas before business-side execution.
- Separate trusted system/developer instructions from untrusted input and validate any requested tool execution.
Explanation
Correct Answer
B:Use idempotency keys or a verified deduplication record around side-effecting operations. This directly addresses the situation: An API gateway retries requests after client timeouts and creates duplicate downstream business records. The technical reason is that retries are necessary for reliability but should not repeat external mutations when a response is lost. Without it, one logical action can produce duplicated invoices, tickets or payments. A concrete acceptance check is: A simulated timeout/retry results in a single authorized record and a traceable request ID.
Incorrect Answers
A:Use documented Messages API request fields and supported client SDK methods with schema validation. This does not repair the current workflow because retries are necessary for reliability but should not repeat external mutations when a response is lost. The targeted change is use idempotency keys or a verified deduplication record around side-effecting operations.
C:Require structured validated outputs or constrained tool schemas before business-side execution. This does not repair the current workflow because retries are necessary for reliability but should not repeat external mutations when a response is lost. The targeted change is use idempotency keys or a verified deduplication record around side-effecting operations.
D:Separate trusted system/developer instructions from untrusted input and validate any requested tool execution. This does not repair the current workflow because retries are necessary for reliability but should not repeat external mutations when a response is lost. The targeted change is use idempotency keys or a verified deduplication record around side-effecting operations.
Question 87
To address the situation: An invoice approval service has deterministic validation steps and no need to choose its own actions. The team implements: "Use a deterministic workflow for fixed tasks and reserve autonomous agent loops for genuinely dynamic decisions". Which evidence BEST demonstrates success?
- A simulated unresolvable task stops within limits and creates a clear escalation record.
- An adversarial research input cannot invoke payment tools, while an authorized approval path still works.
- The workflow produces consistent step traces and enforces the required approval order on representative invoices.
- A fault-injection run terminates predictably and records the failed tool, recovery and final state.
Explanation
Correct Answer
C:The workflow produces consistent step traces and enforces the required approval order on representative invoices. This directly tests the outcome of use a deterministic workflow for fixed tasks and reserve autonomous agent loops for genuinely dynamic decisions. in the described case: An invoice approval service has deterministic validation steps and no need to choose its own actions. The underlying principle is that workflows provide predictable control flow while autonomous agents trade flexibility for added uncertainty and oversight needs. If the change is ineffective, an unnecessary agent can introduce variable actions, cost and approval gaps into a fixed business process. A configuration checkbox alone is insufficient proof.
Incorrect Answers
A:A simulated unresolvable task stops within limits and creates a clear escalation record. This outcome would validate bound agent iterations, tool budgets and stop conditions with a safe fallback or human escalation, not the requested intervention. The required test result is the workflow produces consistent step traces and enforces the required approval order on representative invoices.
B:An adversarial research input cannot invoke payment tools, while an authorized approval path still works. This outcome would validate separate specialized subagents or phases and restrict high-impact actions behind explicit verified authorization, not the requested intervention. The required test result is the workflow produces consistent step traces and enforces the required approval order on representative invoices.
D:A fault-injection run terminates predictably and records the failed tool, recovery and final state. This outcome would validate implement explicit tool-loop controls, errors, iteration limits and observable state in the agent harness, not the requested intervention. The required test result is the workflow produces consistent step traces and enforces the required approval order on representative invoices.
Question 88
In this situation: A chatbot loops through tools indefinitely when a web retrieval returns unhelpful content. The developer proposes: Bound agent iterations, tool budgets and stop conditions with a safe fallback or human escalation. Which principle BEST justifies the approach?
- Frameworks such as LangGraph or Strands add value when branching, persistence or coordination justify their overhead.
- The agent's model output is a proposal; the hosting system must validate and enforce authorized actions.
- Decomposing specialized responsibilities creates clear tool permissions and reduces cross-task privilege confusion.
- Autonomous tool loops require termination criteria and explicit limits for predictable operational cost and safety.
Explanation
Correct Answer
D:Autonomous tool loops require termination criteria and explicit limits for predictable operational cost and safety. In the given situation, a chatbot loops through tools indefinitely when a web retrieval returns unhelpful content. 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
A:Frameworks such as LangGraph or Strands add value when branching, persistence or coordination justify their overhead. This principle relates to match the orchestration framework to complexity, durable state and control-flow requirements rather than novelty. 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.
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:Decomposing specialized responsibilities creates clear tool permissions and reduces cross-task privilege confusion. This principle relates to separate specialized subagents or phases and restrict high-impact actions behind explicit verified authorization. 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 89
To address the situation: A tool integration implements an MCP method with undocumented argument names and untyped results. The team implements: "Implement the documented MCP capability contracts for tools, resources and prompts with restricted access". Which evidence BEST demonstrates success?
- A conforming MCP client discovers allowed capabilities and rejects restricted resource requests.
- A prototype meets functionality and authorization requirements with the smallest maintainable integration.
- A transport interoperability test exchanges valid requests with clean framing and no leaked log text.
- Cross-tenant negative requests are denied while appropriately scoped calls succeed.
Explanation
Correct Answer
A:A conforming MCP client discovers allowed capabilities and rejects restricted resource requests. This directly tests the outcome of implement the documented MCP capability contracts for tools, resources and prompts with restricted access. in the described case: A tool integration implements an MCP method with undocumented argument names and untyped results. The underlying principle is that mCP clients depend on explicit capability schemas and sensible authorization of exposed surfaces. If the change is ineffective, overbroad resources or malformed tool contracts can leak data or break clients. A configuration checkbox alone is insufficient proof.
Incorrect Answers
B:A prototype meets functionality and authorization requirements with the smallest maintainable integration. This outcome would validate choose built-in tools, Skills, custom functions or MCP integration based on reuse, ownership and capability requirements, not the requested intervention. The required test result is A conforming MCP client discovers allowed capabilities and rejects restricted resource requests.
C:A transport interoperability test exchanges valid requests with clean framing and no leaked log text. This outcome would validate choose and correctly configure supported MCP transports and keep protocol messages separate from diagnostic logs, not the requested intervention. The required test result is A conforming MCP client discovers allowed capabilities and rejects restricted resource requests.
D:Cross-tenant negative requests are denied while appropriately scoped calls succeed. This outcome would validate apply authentication, resource authorization and request validation to each MCP tool/resource operation, not the requested intervention. The required test result is A conforming MCP client discovers allowed capabilities and rejects restricted resource requests.
Question 90
To address the situation: A team adds examples from only one customer segment and fails on other document types. The team implements: "Curate representative, consistent few-shot examples and evaluate against held-out cases". Which evidence BEST demonstrates success?
- A held-out retrieval test refuses unsupported assertions and links only to actual evidence.
- Segmented evaluation shows improved performance without regressions on unseen formats.
- Unseen examples consistently satisfy the declared fields and constraints.
- A malicious embedded instruction is treated as data, not an executable task directive.
Explanation
Correct Answer
B:Segmented evaluation shows improved performance without regressions on unseen formats. This directly tests the outcome of curate representative, consistent few-shot examples and evaluate against held-out cases. in the described case: A team adds examples from only one customer segment and fails on other document types. The underlying principle is that examples shape model behavior, so coverage and label accuracy matter more than raw prompt length. If the change is ineffective, biased or contradictory examples can systematically misclassify unusual inputs. A configuration checkbox alone is insufficient proof.
Incorrect Answers
A:A held-out retrieval test refuses unsupported assertions and links only to actual evidence. This outcome would validate check factual claims and citations against accessible source evidence with an explicit uncertainty path, not the requested intervention. The required test result is segmented evaluation shows improved performance without regressions on unseen formats.
C:Unseen examples consistently satisfy the declared fields and constraints. This outcome would validate give clear role, task, constraints and explicit output contract with consistent examples where helpful, not the requested intervention. The required test result is segmented evaluation shows improved performance without regressions on unseen formats.
D: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 segmented evaluation shows improved performance without regressions on unseen formats.