Question 170
A JSON result is incomplete because generation stopped at the requested token ceiling. Which of the following would work as specified?
- Handle context overflow before submission
- Bound total cost across agent turns
- Count the complete request against context limits
- Handle output truncation explicitly
Explanation
Correct Answer
D:Stop-reason inspection catches the partial response before parsing or persistence; notably, an arbitrary string closure should not be treated as a validated complete JSON object.
Incorrect Answers
A:Chunking, retrieval, or compaction reduces input size while retaining decision-relevant evidence, whereas the requirement calls for another behavior: stop-reason inspection catches the partial response before parsing or persistence; increasing output max_tokens cannot make an overlong input fit.
B:Aggregating tokens and actions by logical task reveals overall expenditure and quota needs; however, the critical mechanism here is that stop-reason inspection catches the partial response before parsing or persistence, and per-call estimates overlook the cumulative work of multi-turn orchestration.
C:The context budget encompasses the relevant input contents and model-specific output allowances; the requirement instead turns on this behavior: stop-reason inspection catches the partial response before parsing or persistence; counting only the latest user text understates true token pressure.
Question 171
A tool for updating customer profiles accepts only a narrow set of writable attributes. Which implementation mechanism is needed?
- Enforce upload-size caps
- Use typed deserialization for a structured result
- Reject unexpected fields in business actions
- Handle null and missing values distinctly
Explanation
Correct Answer
C:Application validation controls the allowed property set before any database mutation; notably, the model may produce syntactically valid extra keys that are unsafe to execute.
Incorrect Answers
A:Boundary checks reject overly large payloads before expensive parsing or API transfer; however, the critical mechanism here is that application validation controls the allowed property set before any database mutation, and relying on the model to refuse oversized data is too late for resource protection.
B:Typed parsing converts validated JSON into an explicit application data contract; the requirement instead turns on this behavior: application validation controls the allowed property set before any database mutation; free-form text parsing with ad hoc regular expressions is brittle under wording changes.
D:Type-aware validation preserves nullability and missing-field semantics for downstream logic; in contrast, application validation controls the allowed property set before any database mutation, while coercing every absent property to an empty value can distort business decisions.
Question 172
An authenticated retrieval agent can construct arbitrary search predicates and must be unable to read rows assigned to another tenant even if it omits a tenant filter. Which solution matches the actual constraint?
- Audit privileged changes with actor attribution
- Validate generated action arguments server-side
- Enforce tenant row-level security in the data store
- Protect confidentiality during evidence retrieval
Explanation
Correct Answer
C:Database-enforced row access rules restrict queries to the authorized tenant independently of model-generated predicates; a crucial qualification is that the application must still propagate the correct verified tenant identity to the database session.
Incorrect Answers
A:An audit trail connects the principal, approved operation, target, and result; this addresses a separate concern, not the fact that database-enforced row access rules restrict queries to the authorized tenant independently of model-generated predicates; a text summary by the model is not sufficient evidence of a committed security change.
B:Backend checks enforce type, range, scope, and approval before any mutation; here, the controlling capability is that database-enforced row access rules restrict queries to the authorized tenant independently of model-generated predicates, but the model's fluent output is not an authoritative business validation result.
D:Retrieval must filter documents by verified entitlement before adding snippets to context; by comparison, the intended solution relies on this: database-enforced row access rules restrict queries to the authorized tenant independently of model-generated predicates; asking Claude not to quote unauthorized documents does not prevent exposure upstream.
Question 173
A team wants a model-led agent with reusable tools and a simple agent construction interface. Which of the following would work as specified?
- Use a light direct API integration
- Observe a tool result before choosing the next action
- Use Strands-style model-driven agents
- Use LangGraph-style stateful orchestration
Explanation
Correct Answer
C:An agent framework coordinates tool selection while exposing configuration and observability hooks, although tool permission and termination policies remain the integrator's responsibility.
Incorrect Answers
A:A direct client minimizes abstraction and makes the request path easy to inspect; by comparison, the intended solution relies on this: an agent framework coordinates tool selection while exposing configuration and observability hooks; it will need explicit orchestration if tool calls and branching emerge later.
B:Alternating action and observation permits evidence-driven choices rather than a fully predetermined plan; the needed capability is different—an agent framework coordinates tool selection while exposing configuration and observability hooks—and every loop must check for stop conditions and tool failures.
D:A graph framework makes transitions and persisted workflow state first-class constructs; however, the critical mechanism here is that an agent framework coordinates tool selection while exposing configuration and observability hooks, and the framework does not eliminate the need to secure the nodes' tools.
Question 174
A short simple categorization task is wasting latency on excessive deliberation. How should the implementation handle this need?
- Choose a lower effort mode for routine requests
- Budget total latency for thinking and output
- Check model compatibility before changing thinking mode
- Choose a supported model identifier
Explanation
Correct Answer
A:A supported effort setting reduces unnecessary reasoning work for easy outputs; notably, a low effort budget can underperform on genuinely difficult analytical cases.
Incorrect Answers
B:Performance tests include model reasoning time as well as visible answer generation; in contrast, a supported effort setting reduces unnecessary reasoning work for easy outputs, while restricting just the final response length may not address total computation time.
C:A capability check and test run prevent invalid parameter combinations and behavioral regressions; this addresses a separate concern, not the fact that a supported effort setting reduces unnecessary reasoning work for easy outputs; assuming every family supports the same thinking configuration is unsafe.
D:The model field identifies the deployed model; production should verify current IDs and compatibility; here, the controlling capability is that a supported effort setting reduces unnecessary reasoning work for easy outputs, but guessing an informal nickname can yield an invalid-model error or unexpected alias changes.
Question 175
An API is receiving malformed, extremely large, and suspicious user payloads from the public internet. What is the most direct implementation choice?
- Canary a risky policy change
- Use constrained tool schemas and allowlists
- Keep a human review gate for high-impact operations
- Apply input validation at ingress
Explanation
Correct Answer
D:Input controls reject invalid types, excessive sizes, and disallowed patterns before expensive processing, subject to this requirement: content screening alone cannot establish the caller's resource permissions.
Incorrect Answers
A:A limited rollout measures refusal, error, and unauthorized action attempts before broad exposure; the requirement instead turns on this behavior: input controls reject invalid types, excessive sizes, and disallowed patterns before expensive processing; immediate all-user changes make regressions harder to contain.
B:Narrow tool capabilities reduce what even a manipulated model could attempt; this cannot substitute for the behavior that input controls reject invalid types, excessive sizes, and disallowed patterns before expensive processing, because a policy paragraph in system instructions is not a technical allowlist.
C:Mandatory human approval separates recommendations from irreversible execution; in contrast, input controls reject invalid types, excessive sizes, and disallowed patterns before expensive processing, while model confidence scores cannot replace the required authority of a reviewer.
Question 176
Many independent services should share one consistent quota and authentication policy for Claude calls. Which measure directly addresses the problem?
- Prefer API middleware for organization-wide policies
- Prefer one application-local function for a one-off feature
- Prefer MCP for cross-client discovery
- Use an MCP server for a reusable integration
Explanation
Correct Answer
A:Shared middleware or gateway controls enforce cross-cutting service rules centrally; the important constraint is that an MCP server would not by itself govern unrelated direct inference requests.
Incorrect Answers
B:A local function minimizes protocol, hosting, and dependency overhead; the requirement instead turns on this behavior: shared middleware or gateway controls enforce cross-cutting service rules centrally; reusability infrastructure should be justified by real multiple-client requirements.
C:MCP standardizes discovery and execution interfaces across participating clients; this cannot substitute for the behavior that shared middleware or gateway controls enforce cross-cutting service rules centrally, because standard interfaces do not automatically secure individual backends.
D:A protocol server exposes shared tools and resources with consistent discovery semantics; in contrast, shared middleware or gateway controls enforce cross-cutting service rules centrally, while it adds infrastructure and identity concerns compared with a single local function.
Question 177
A chat interface should display generated text without waiting for the entire completion. Which approach best meets this requirement?
- Use message_stop as a stream completion signal
- Budget total latency for thinking and output
- Enable streaming to show output progressively
- Aggregate content_block_delta events
Explanation
Correct Answer
C:Streaming yields server-sent events as content is produced, improving time to first visible text; a crucial qualification is that the client still needs to handle partial chunks and a final completion signal.
Incorrect Answers
A:The terminal event marks completion of the streamed message lifecycle; this addresses a separate concern, not the fact that streaming yields server-sent events as content is produced, improving time to first visible text; a ping or an individual content-block stop does not mean the entire response ended.
B:Performance tests include model reasoning time as well as visible answer generation; here, the controlling capability is that streaming yields server-sent events as content is produced, improving time to first visible text, but restricting just the final response length may not address total computation time.
D:Deltas update the current content block until its corresponding stop event arrives; by comparison, the intended solution relies on this: streaming yields server-sent events as content is produced, improving time to first visible text; individual fragments are not complete JSON messages or guaranteed sentence boundaries.
Question 178
A summarizer cannot get a valid completion after its approved attempts and still must respond accurately. Which approach best meets this requirement?
- Escalate a persistent authorization denial
- Treat 5xx as potential upstream service faults
- Quarantine malformed output for review
- Apply safe fallback when retries exhaust
Explanation
Correct Answer
D:Returning a clear incomplete status or known safe alternative avoids false success claims—with this limitation: inventing an answer to preserve a green status is operationally misleading.
Incorrect Answers
A:Operators investigate credentials and permissions through the proper access workflow; the needed capability is different—returning a clear incomplete status or known safe alternative avoids false success claims—and retries or prompt pressure must not be used to bypass access controls.
B:The client applies guarded retries and monitoring while preserving safe degraded behavior, whereas the requirement calls for another behavior: returning a clear incomplete status or known safe alternative avoids false success claims; treating an outage as a prompt defect misdirects investigation.
C:Failed artifacts are retained securely for diagnostics and excluded from the production write path; however, the critical mechanism here is that returning a clear incomplete status or known safe alternative avoids false success claims, and automatically coercing unknown fields risks corrupting downstream ledgers.
Question 179
An API-based support assistant must follow an application-level response policy across incoming customer messages. Which option best fits the described workflow?
- Use CLAUDE.md for repository guidance in Claude Code
- Use an explicit tool definition for callable business actions
- Use a direct API integration for a branded customer feature
- Use the Messages API system field for app-wide behavior
Explanation
Correct Answer
D:Server code supplies a governing system instruction separately from the user-message array, subject to this requirement: placing it inside user-supplied text exposes the rule to unintended editing and trust confusion.
Incorrect Answers
A:Repository instruction files provide persistent project context to the Claude Code environment; the requirement instead turns on this behavior: server code supplies a governing system instruction separately from the user-message array; they are not automatically loaded into unrelated Messages API clients.
B:Tool schemas advertise an available operation and define its structured inputs; this cannot substitute for the behavior that server code supplies a governing system instruction separately from the user-message array, because a prose instruction mentioning a function does not register it with the API.
C:The Messages API allows application code to own product behavior and its user experience; in contrast, server code supplies a governing system instruction separately from the user-message array, while consumer chat sessions are not an app's programmable backend contract.
Question 180
An unstable page may keep sending an assistant into repeated searches with little progress. What change is best aligned with the goal?
- Require explicit approval for irreversible actions
- Set a maximum tool iteration count
- Gate a write tool behind a transaction boundary
- Configure an allowlist of available tools
Explanation
Correct Answer
B:A harness enforces a fixed ceiling on action cycles and reports incomplete execution safely—with this limitation: model self-assessment is too probabilistic to serve as the only loop brake.
Incorrect Answers
A:The side-effect layer blocks execution until an authorization token or confirmation arrives; however, the critical mechanism here is that a harness enforces a fixed ceiling on action cycles and reports incomplete execution safely, and labeling a step dangerous in the prompt does not implement authorization.
C:The application coordinates the write with transactional or compensating logic outside the model; this cannot substitute for the behavior that a harness enforces a fixed ceiling on action cycles and reports incomplete execution safely, because language-model intent is not a database rollback guarantee.
D:Its registered and authorized tool set excludes mutating functions before Claude can request them; in contrast, a harness enforces a fixed ceiling on action cycles and reports incomplete execution safely, while an instruction not to delete data is insufficient if destructive tools remain callable.