Question 360
A customer-record tool should return names and case statuses, but its generic database query also exposes tax IDs and internal notes. How should its output contract change?
- Return every database column and tell Claude to avoid mentioning the sensitive ones.
- Project only approved fields in the backend and apply caller-specific authorization before returning rows.
- Place tax identifiers into the system prompt so the model can recognize them reliably.
- Rename the secret fields to generic keys while keeping their original values.
Explanation
Correct Answer
B:A narrow data-transfer contract prevents the model from ever receiving unrelated sensitive columns. Server-side projection and authorization are stronger than relying on the prompt to ignore excess fields already retrieved.
Incorrect Answers
A:A text instruction cannot undo sensitive data exposure to the model or its logs. The tool must restrict data before returning the payload to the conversation.
C:Elevating unneeded customer data to high-priority context increases disclosure risk. The application should omit unauthorized or irrelevant fields at the source instead.
D:Obscuring column names does not remove personal information or enforce least privilege. The sensitive values remain accessible and could be copied into another output.
Question 361
A client-executed inventory tool fails with a permission error. Which API result detail should the caller use to identify it as a failed execution rather than a valid empty inventory?
- Return an empty array with no error indication and claim there are no products.
- Change the prior assistant tool_use block into a final end_turn response.
- Include the database administrator password in the error message to aid debugging.
- Return a tool_result with is_error set to true and a sanitized explanation.
Explanation
Correct Answer
D:The tool_result block can explicitly signal execution failure while preserving the original tool_use_id. A safe error payload lets Claude recover or report the problem without confusing denied access with a legitimate empty result.
Incorrect Answers
A:An empty successful result states that the inventory query ran and found nothing. It would hide the actual authorization failure and lead to a false business conclusion.
B:Rewriting the generated history does not represent the tool’s failure correctly. The application should continue the tool exchange with a properly typed result block.
C:Credential disclosure through a model-visible error expands risk without helping the agent recover. The result should contain a safe failure category and any actionable nonsecret context.
Question 362
Claude requests three parallel client tools, but the application cannot execute the third because the first mutation failed. What should the next user message contain?
- Replay the failed mutation without a retry budget before sending any tool results.
- Return only the successful tool result and omit IDs for operations that were not run.
- Convert the failed request into an unrelated final answer and discard the assistant tool-use turn.
- Report a tool_result for each requested call, including an is_error result for the skipped operation.
Explanation
Correct Answer
D:Parallel tool-use turns require a corresponding result for every requested call. The host may stop unsafe dependent work, but it should preserve result correlation and explain the skipped action rather than omit it.
Incorrect Answers
A:An unbounded replay can repeat side effects or prolong failure. Recovery and retry rules belong to the host, and nonexecuted calls still need a correlated error outcome.
B:Dropping requested results leaves the model without a complete accounting of its prior tool-use turn. A skipped call should be represented explicitly, not silently deleted.
C:A fabricated completion message loses traceability and hides pending operations. A structured failure result maintains the conversation’s execution history.
Question 363
A database tool returns an exception that includes the database password. What should the executor return to the model?
- Sanitize the error and provide a safe failure category with recovery context.
- Employ distinguishable structured success and error results.
- Distinguish each tool's description by purpose, constraints, and examples.
- Mandate authenticated authorization and explicit approval before executing the charge.
Explanation
Correct Answer
A:Tool errors must be actionable without leaking credentials or internals through model-visible content. Preserve the detailed exception in restricted server logs and return only a safe failure code and troubleshooting context to Claude.
Incorrect Answers
B:Explicit result types let the model and host reason about absence without mistaking it for an empty successful record; this may help tool not found error semantics but cannot by itself deliver safe tool error payload.
C:Selection depends heavily on tool descriptions; clear intent boundaries improve routing more than adding more synonyms; when the goal is safe tool error payload, optimizing discriminating tool descriptions misses that operational boundary.
D:A valid generated tool input is not proof of user consent; business side effects need a separate execution gate; because mutation tool approval is its concern, safe tool error payload remains outside its effect here.
Question 364
An agent proposes a charge with a price copied from a customer email, but the merchant catalog is the authoritative source of product prices. What must the payment tool do?
- Recalculate the charge from trusted catalog and order records before accepting the payment request.
- Raise the model’s output-token allowance to encourage more detailed payment reasoning.
- Trust the email price whenever Claude includes it in a valid JSON argument.
- Place the complete email thread into the payment processor’s administrator field.
Explanation
Correct Answer
A:User content and model-generated arguments are proposals, not financial authority. The transaction backend must verify item IDs, quantities and approved prices before it commits a charge.
Incorrect Answers
B:Longer reasoning does not authenticate amounts or replace the merchant’s price ledger. The failure is a missing business validation in the mutating tool.
C:Schema validity says nothing about a quoted price’s truth or authorization. An attacker-controlled email can contain arbitrary amounts even when the JSON parses correctly.
D:Passing untrusted free text into a privileged transaction path increases injection and data-exposure risks. The payment operation should accept validated structured order data.
Question 365
A tool schema accepts any free-form command string for a deployment system. What change reduces unintended operations?
- Expose typed, allowlisted deployment operations and validated parameters.
- Regard tool output as data and independently authorize any proposed follow-up calls.
- Provide only relevant tools for the current task or stage.
- Offer read-only tools without a delete capability to that agent.
Explanation
Correct Answer
A:Narrow contracts prevent arbitrary commands and make permissions auditable at the action level. Prefer operations such as deploy_staging or get_status with explicit fields rather than a general shell-command argument.
Incorrect Answers
B:Tool results may contain adversarial instructions; they cannot grant a new capability or override the original user's intent; for restrict tool input contract, this instead manages injection in tool results; the requested decision remains unresolved.
C:A smaller, distinct tool set reduces ambiguous choices and unnecessary authority in the model's decision space; this targets context-specific tool catalog, while the system must demonstrate restrict tool input contract.
D:Removing the side-effect permission is stronger than telling the model not to call a dangerous tool; a remedy for toolset least privilege is not a substitute for restrict tool input contract.
Question 366
Claude often supplies an imaginary field name to a search tool. What should the tool definition improve?
- Differentiate where each tool runs and which layer authorizes its side effects.
- As an alternative, sanitize the error and provide a safe failure category with recovery context.
- Offer typed, allowlisted deployment operations and validated parameters.
- Give exact input property names, required fields, and clear parameter descriptions.
- Separate each tool's description by purpose, constraints, and examples.
Explanation
Correct Answer
D:Precise schema descriptions guide argument generation, while runtime validation catches remaining mismatches. A concrete schema constrains argument construction but the dispatcher must still reject unknown or missing properties at runtime.
Incorrect Answers
A:Server-executed and client-executed tools have different control points; the application must enforce approvals at its actual execution boundary; this targets client versus server tool boundary, while the system must demonstrate tool parameter clarity.
B:Tool errors must be actionable without leaking credentials or internals through model-visible content; it changes safe tool error payload; it does not prove tool parameter clarity in this case.
C:Narrow contracts prevent arbitrary commands and make permissions auditable at the action level; because restrict tool input contract is its concern, tool parameter clarity remains outside its effect here.
E:Selection depends heavily on tool descriptions; clear intent boundaries improve routing more than adding more synonyms; the consequence is improved discriminating tool descriptions, not verified tool parameter clarity.
Question 367
A large toolbox contains dozens of rarely used operations and the model makes frequent selection mistakes. What optimization should be tested?
- Provide exact input property names, required fields, and clear parameter descriptions.
- Return a factual, structured failure result and allow bounded recovery.
- Publish typed, allowlisted deployment operations and validated parameters.
- Expose only relevant tools for the current task or stage.
Explanation
Correct Answer
D:A smaller, distinct tool set reduces ambiguous choices and unnecessary authority in the model's decision space.
Incorrect Answers
A:Precise schema descriptions guide argument generation, while runtime validation catches remaining mismatches; the consequence is improved tool parameter clarity, not verified context-specific tool catalog.
B:Concealing execution failure encourages incorrect assumptions; an explicit observation enables reasoning about retry or fallback; because multi-criterion integration is its concern, context-specific tool catalog remains outside its effect here.
C:Narrow contracts prevent arbitrary commands and make permissions auditable at the action level; even if restrict tool input contract succeeds, context-specific tool catalog still needs separate verification.
Question 368
A service's read tool may return either a record or a 'not found' status. What output contract should it implement?
- Use distinguishable structured success and error results.
- Use a timeout with bounded retries or a clear failure response.
- For this workflow, sanitize the error and provide a safe failure category with recovery context.
- Verify required input fields and return a structured tool error.
Explanation
Correct Answer
A:Explicit result types let the model and host reason about absence without mistaking it for an empty successful record.
Incorrect Answers
B:Tool execution is an external dependency; operational budgets prevent a hung tool from stalling the entire agent indefinitely; it improves bounded tool request duration only, leaving tool not found error semantics unproven.
C:Tool errors must be actionable without leaking credentials or internals through model-visible content; this may help safe tool error payload but cannot by itself deliver tool not found error semantics.
D:Executing malformed arguments risks downstream failure; a precise error lets the harness recover without fabricating weather; testing tool not found error semantics would still fail after improving missing tool input field.
Question 369
A query tool is slow and sometimes times out. What should its adapter enforce?
- Apply a timeout with bounded retries or a clear failure response.
- Adopt distinguishable structured success and error results.
- Match each tool_result to its associated tool_use identifier.
- Wait indefinitely for the slow query because the agent will decide when to stop.
Explanation
Correct Answer
A:Tool execution is an external dependency; operational budgets prevent a hung tool from stalling the entire agent indefinitely.
Incorrect Answers
B:Explicit result types let the model and host reason about absence without mistaking it for an empty successful record; a remedy for tool not found error semantics is not a substitute for bounded tool request duration.
C:Parallel or grouped calls need explicit correlation; merging results into unlabelled text loses the mapping; this implements tool ID result correlation rather than the demanded bounded tool request duration.
D:The model cannot enforce a network operation’s wall-clock deadline after dispatch. The adapter needs its own timeout and bounded recovery policy rather than an open-ended wait.
Question 370
A prompt asks the model to update a row but the tool's schema lacks a primary key. What is the required design change?
- Add an explicit validated record identifier to the tool input.
- Send a factual, structured failure result and allow bounded recovery.
- Make available typed, allowlisted deployment operations and validated parameters.
- Mandate an actual successful tool receipt before reporting the action as completed.
Explanation
Correct Answer
A:Mutations must identify the target unambiguously; guessing from free text risks modifying the wrong record. Require a validated record identifier in the tool input and verify the caller's authority over the selected row.
Incorrect Answers
B:Concealing execution failure encourages incorrect assumptions; an explicit observation enables reasoning about retry or fallback; testing unambiguous mutation target would still fail after improving multi-criterion integration.
C:Narrow contracts prevent arbitrary commands and make permissions auditable at the action level; the unambiguous mutation target criterion differs from restrict tool input contract; the gap persists.
D:Fluent intent text is not proof of external state; the host should correlate user-visible confirmations with authoritative execution results; because tool execution confirmation is its concern, unambiguous mutation target remains outside its effect here.