Question 260
A repository assistant is limited to read-only operations and should never see a deployment-write capability. Which response is most defensible under these conditions?
- Use tool allowlists as a baseline defense
- Use a mandatory human approval mechanism
- Use a pre-tool hook for prohibited actions
- Use constrained tool schemas and allowlists
Explanation
Correct Answer
A:Tool availability and credential permissions restrict the reachable attack surface by design; in production, hooks are additional safeguards, not replacements for minimizing available power.
Incorrect Answers
B:An enforced approval boundary stops execution until confirmation is provided; the needed capability is different—tool availability and credential permissions restrict the reachable attack surface by design—and a model's promise to ask first is not itself a technical approval gate.
C:A pre-execution hook can inspect and block the operation before it reaches the shell, whereas the requirement calls for another behavior: tool availability and credential permissions restrict the reachable attack surface by design; the hook runs outside the model's judgment, but its own policy must be correctly implemented.
D:Narrow tool capabilities reduce what even a manipulated model could attempt; however, the critical mechanism here is that tool availability and credential permissions restrict the reachable attack surface by design, and a policy paragraph in system instructions is not a technical allowlist.
Question 261
A branching workflow needs explicit graph state, resumable nodes, and conditional edges across stages. What change is best aligned with the goal?
- Use ephemeral scratch context for one run
- Use a light direct API integration
- Use typed PydanticAI-style dependencies
- Use LangGraph-style stateful orchestration
Explanation
Correct Answer
D:A graph framework makes transitions and persisted workflow state first-class constructs; its operational boundary is that the framework does not eliminate the need to secure the nodes' tools.
Incorrect Answers
A:Transient context supports local reasoning without creating long-term customer state; however, the critical mechanism here is that a graph framework makes transitions and persisted workflow state first-class constructs, and it should not be mistaken for durable memory across new sessions.
B:A direct client minimizes abstraction and makes the request path easy to inspect; the requirement instead turns on this behavior: a graph framework makes transitions and persisted workflow state first-class constructs; it will need explicit orchestration if tool calls and branching emerge later.
C:A typed framework aligns model interactions with application data models and testable dependencies; this cannot substitute for the behavior that a graph framework makes transitions and persisted workflow state first-class constructs, because types validate shape, not the truth of every generated factual assertion.
Question 262
A backend must authorize its outgoing request to the Claude service without placing credentials in user content. Which solution should the engineer adopt?
- Use POST for a Messages generation request
- Use request headers for API authentication
- Set the requested API version header where required
- Escalate repeated unknown errors with trace context
Explanation
Correct Answer
B:The service authenticates the API credential through its designated HTTP headers; including a secret in model messages would expose it to prompt handling and logging.
Incorrect Answers
A:The endpoint creates a new inference result from a JSON request and is invoked as an HTTP POST; by comparison, the intended solution relies on this: the service authenticates the API credential through its designated HTTP headers; treating it as a cacheable read-only GET would not express the required request body.
C:Version negotiation constrains accepted fields and response behavior for an endpoint, whereas the requirement calls for another behavior: the service authenticates the API credential through its designated HTTP headers; omitting required version information or assuming an arbitrary revision can break compatibility.
D:Capturing sanitized request IDs and relevant version metadata makes specialist diagnosis possible; however, the critical mechanism here is that the service authenticates the API credential through its designated HTTP headers, and silently dropping the incident gives no route to correction.
Question 263
A purchasing assistant can draft a supplier order but must not submit a binding purchase without consent. Which of the following would work as specified?
- Use a model-directed agent loop
- Use a specialist subagent
- Use deterministic code for a known calculation
- Use a human approval checkpoint
Explanation
Correct Answer
D:Execution pauses before the consequential action and resumes only after an authorized reviewer agrees; notably, a natural-language promise to ask permission is weaker than an enforced approval gate.
Incorrect Answers
A:Claude selects an action after observing each result, with the application enforcing iteration and permission limits, whereas the requirement calls for another behavior: execution pauses before the consequential action and resumes only after an authorized reviewer agrees; the autonomy adds variability and demands hard budgets, logs, and a stopping policy.
B:An isolated worker handles a bounded analysis and returns a concise finding to the parent; however, the critical mechanism here is that execution pauses before the consequential action and resumes only after an authorized reviewer agrees, and the subagent still needs a scoped tool set and cannot silently inherit unlimited production privileges.
C:Ordinary code computes the numerical result repeatably rather than trusting text generation for arithmetic; the requirement instead turns on this behavior: execution pauses before the consequential action and resumes only after an authorized reviewer agrees; a language model may describe the calculation but should not be its financial source of truth.
Question 264
A temporary support chat should not persist indefinitely after its retention window ends. Which solution matches the actual constraint?
- Use an account-scoped history key
- Use tool results as data to be interpreted
- Invalidate session privileges after role changes
- Expire stale ephemeral sessions
Explanation
Correct Answer
D:Time-based cleanup limits unnecessary data retention and reduces exposure; the implementation must still recognize that persistent global memory is inappropriate for short-lived sensitive tasks.
Incorrect Answers
A:Session storage is keyed to authenticated identity and checked on every retrieval; this cannot substitute for the behavior that time-based cleanup limits unnecessary data retention and reduces exposure, because a client-supplied chat ID alone is not sufficient authorization.
B:Result content is evidence from an external subsystem and must not become a system instruction; in contrast, time-based cleanup limits unnecessary data retention and reduces exposure, while even trusted services can carry attacker-controlled record values.
C:Authorization checks must reflect current permissions rather than those cached at session creation; this addresses a separate concern, not the fact that time-based cleanup limits unnecessary data retention and reduces exposure; prior approval of one request does not authorize later actions forever.
Question 265
A prompt-injection attempt tries to send a confidential attachment to an attacker-controlled address. What change is best aligned with the goal?
- Filter outgoing sensitive data at the egress layer
- Record immutable provenance for sensitive decisions
- Verify tool permissions independently of text
- Isolate risky browsing from privileged tools
Explanation
Correct Answer
A:Deterministic output and action checks block unauthorized exfiltration before it leaves the trusted environment; a crucial qualification is that model self-policing alone cannot guarantee detection of every malicious instruction.
Incorrect Answers
B:Audit metadata preserves input references, applicable policy, actor, and versioned output; by comparison, the intended solution relies on this: deterministic output and action checks block unauthorized exfiltration before it leaves the trusted environment; a final answer without source history is not adequate for reconstructing the decision.
C:Server-side authorization checks bind each requested resource to the authenticated principal; the needed capability is different—deterministic output and action checks block unauthorized exfiltration before it leaves the trusted environment—and a system-prompt ban on disclosure cannot replace real access control.
D:Separate trust zones and scoped workers prevent public content from directly wielding private capabilities, whereas the requirement calls for another behavior: deterministic output and action checks block unauthorized exfiltration before it leaves the trusted environment; isolation fails if credentials or tool results leak back across the boundary.
Question 266
A billing assistant must add hundreds of amounts with currency rounding rules. What would best address the stated failure mode?
- Treat output as generated prediction, not a database read
- Use deterministic validation after generation
- Reserve enough output tokens for the desired result
- Use a computation tool for exact arithmetic
Explanation
Correct Answer
D:A trusted arithmetic implementation calculates the numeric result instead of relying on next-token prediction, subject to this requirement: the model can explain the calculation but should not be the authoritative calculator.
Incorrect Answers
A:The language model generates plausible text rather than querying a company's live inventory by itself; the requirement instead turns on this behavior: a trusted arithmetic implementation calculates the numeric result instead of relying on next-token prediction; it needs authorized retrieval to ground fast-changing private facts.
B:Business code checks numeric bounds independently of the model's prose; this cannot substitute for the behavior that a trusted arithmetic implementation calculates the numeric result instead of relying on next-token prediction, because fluent explanations cannot override a failed validation rule.
C:The configured generation maximum must be consistent with the required output length; in contrast, a trusted arithmetic implementation calculates the numeric result instead of relying on next-token prediction, while raising it arbitrarily can increase possible cost without improving content accuracy.
Question 267
A nightly job must summarize tens of thousands of archived feedback records with no interactive SLA. Which development approach should be selected?
- Handle partial failures inside a batch
- Submit independent offline jobs to Message Batches
- Send tool_result in a following user message
- Use the real-time Messages API for chat
Explanation
Correct Answer
B:Batch submission processes asynchronous independent requests efficiently and can reduce input/output processing cost; the important constraint is that it does not provide a synchronous final message for a user awaiting an immediate reply.
Incorrect Answers
A:Per-item result handling records and retries appropriate failures without duplicating successful work, whereas the requirement calls for another behavior: batch submission processes asynchronous independent requests efficiently and can reduce input/output processing cost; a batch-level completion event does not imply every included request succeeded.
C:The reply associates content with the tool_use identifier in the continued message history; the requirement instead turns on this behavior: batch submission processes asynchronous independent requests efficiently and can reduce input/output processing cost; a standalone text string is not the protocol-level tool result envelope.
D:Direct Messages calls match interactive latency and incremental display requirements; this cannot substitute for the behavior that batch submission processes asynchronous independent requests efficiently and can reduce input/output processing cost, because batch jobs complete later and are inappropriate for a tightly coupled request-response interface.
Question 268
A lookup returns not_found or forbidden and the agent needs to distinguish absence from missing rights. What is the appropriate next design choice?
- Return only the fields necessary for a decision
- Report tool failures explicitly
- Limit untrusted text in tool outputs
- Preserve tool error codes separately from text
Explanation
Correct Answer
D:Typed errors guide safe retries, clarification, or escalation without inventing data; notably, free-form error prose can be misread or stripped by downstream clients.
Incorrect Answers
A:Structured filtering reduces context load and unnecessary data disclosure, whereas the requirement calls for another behavior: typed errors guide safe retries, clarification, or escalation without inventing data; the model should not receive personal or unrelated fields merely because they exist upstream.
B:A structured error result communicates the failed operation and supports safe recovery; however, the critical mechanism here is that typed errors guide safe retries, clarification, or escalation without inventing data, and silently replacing an error with an empty success encourages false completion claims.
C:Treating tool output as low-trust evidence and trimming unnecessary text reduces injection surfaces; the requirement instead turns on this behavior: typed errors guide safe retries, clarification, or escalation without inventing data; a tool result is not an application-level system command.
Question 269
An authorized database query fails because the requested customer ID does not exist. Which capability is necessary for this outcome?
- Return structured tool errors to the model
- Return a tool_result with the matching tool_use_id
- Avoid returning unnecessary raw records
- Retry transient failures with backoff
Explanation
Correct Answer
A:A clear error result tells the agent what failed and whether it can try an alternative; the important constraint is that swallowing the error as an empty success invites fabricated conclusions.
Incorrect Answers
B:The caller adds a user-side tool_result block tied to the earlier tool use identifier; the requirement instead turns on this behavior: a clear error result tells the agent what failed and whether it can try an alternative; an unrelated message cannot reliably bind a result to the invocation it completes.
C:The tool should return task-relevant, minimized structured data instead of dumping unneeded sensitive details; this cannot substitute for the behavior that a clear error result tells the agent what failed and whether it can try an alternative, because excessive outputs increase context costs and exposure while burying the useful evidence.
D:A bounded retry policy handles intermittent service errors without indefinitely hammering the dependency; in contrast, a clear error result tells the agent what failed and whether it can try an alternative, while repeating a rejected unauthorized request cannot repair missing permission.
Question 270
A customer-facing chat feature must render an initial response inside an agreed performance budget. What should be implemented to solve this problem?
- Capture explicit nonfunctional latency targets
- Write testable functional acceptance criteria
- Benchmark baseline latency and cost
- Define the authority of each tool action
Explanation
Correct Answer
A:A latency requirement defines measurable service-level timing and informs streaming and model selection; the important constraint is that correct semantic output does not prove the product meets a response-time constraint.
Incorrect Answers
B:Requirements should specify observable inputs, citation fields, and acceptance tests for the behavior; the requirement instead turns on this behavior: a latency requirement defines measurable service-level timing and informs streaming and model selection; a statement that the system should be helpful is not independently verifiable.
C:Capturing tokens, response times, failure rate, and quality before changes makes comparisons meaningful; this cannot substitute for the behavior that a latency requirement defines measurable service-level timing and informs streaming and model selection, because subjective demos cannot quantify a regression from the original system.
D:Access requirements tie each permitted side effect to identity, scope, and approval evidence; in contrast, a latency requirement defines measurable service-level timing and informs streaming and model selection, while a model's confidence in a request is not proof of caller authority.