Question 350
An organization needs a record of which sensitive tools were invoked successfully. Which hook role fits?
- Use tool lifecycle hooks to capture approved execution metadata into audit logs.
- As an alternative, reject the tool call based on normalized path and allowlisted boundaries.
- Relocate enforcement to a pre-execution permission check that can block the operation.
- As an alternative, intercept the command in a PreToolUse-style hook before execution.
Explanation
Correct Answer
A:Hook callbacks can supply deterministic telemetry independently of the content Claude chooses to write to the user.
Incorrect Answers
B:Validating the actual execution target prevents path-based escapes; a human-readable prompt instruction is insufficient enforcement; it changes multi-criterion integration; it does not prove hook-driven audit telemetry in this case.
C:Post-execution observation is too late to prevent a destructive side effect; enforcement belongs ahead of dispatch; this implements hook timing for prevention rather than the demanded hook-driven audit telemetry.
D:A pre-tool hook can inspect inputs and deny a command before side effects occur; later logging cannot undo an execution; when the goal is hook-driven audit telemetry, optimizing preventive hook placement misses that operational boundary.
Question 351
A customer-data agent may draft changes but must not export confidential information or delete accounts unauthorised. Which TWO security controls are strongest? Choose TWO.
- Enforce object-level authorization and data minimization before retrieval.
- Render untrusted HTML directly in the customer browser.
- Put broad administrator credentials into the prompt.
- Remove or tightly gate high-impact export and deletion capabilities.
- Assume the model will recognize all malicious instructions.
Explanation
Correct Answers
A:The agent should receive only information that the verified principal may access. A query must filter by the verified principal and permitted records before any confidential text reaches Claude.
D:Least-privilege tools and explicit approvals prevent unauthorized side effects even if an injection succeeds. The executor should require a verified actor, target, and approval for export or deletion calls.
Incorrect Answers
B:Unsafe rendering adds client-side execution risk rather than protecting the account. Unsafe markup rendering creates a distinct browser injection vulnerability rather than a control on model actions.
C:Exposing privileged secrets to the model increases potential data leakage. Privileged credentials can leak through output, tracing, or compromised tool contexts if placed inside prompts.
E:Injection defenses must not rely solely on the model classifying every unsafe request. A single missed injection could otherwise exercise an overly broad tool privilege against live customer records.
Question 352
A Claude API key is accidentally posted in a public issue. What is the first containment action?
- Isolate environment credentials with narrowly scoped access and rotation procedures.
- Withdraw the excess capability and issue a read-only or narrowly scoped credential.
- As an alternative, bind authorization to the specific action, target, and validity period.
- Revoke or rotate the credential immediately and inspect its recent use.
Explanation
Correct Answer
D:A disclosed key remains usable even if the post is removed; rapid invalidation limits further unauthorized requests.
Incorrect Answers
A:Distinct identities prevent a developer test credential from silently authorizing production operations; where compromised API key response matters, a control for environment-based secret scoping leaves that test unmet.
B:Reducing permissions at the source prevents accidental or injected deletion attempts even if tool routing is imperfect; this targets least privilege credential revision, while the system must demonstrate compromised API key response.
C:Approval for one operation should not become an open-ended capability; time- and scope-limited grants reduce unintended writes; it improves scoped temporary approval only, leaving compromised API key response unproven.
Question 353
A production app uses one all-powerful key shared across dev and production. What improvement reduces blast radius?
- For this workflow, bind authorization to the specific action, target, and validity period.
- Obtain tenant context from authenticated server-side claims and access policy.
- Withdraw or rotate the credential immediately and inspect its recent use.
- Separate environment credentials with narrowly scoped access and rotation procedures.
Explanation
Correct Answer
D:Distinct identities prevent a developer test credential from silently authorizing production operations. Give development and production separate credentials and independent rotation paths so one leak cannot compromise both environments.
Incorrect Answers
A:Approval for one operation should not become an open-ended capability; time- and scope-limited grants reduce unintended writes; changing scoped temporary approval does not establish environment-based secret scoping in this application.
B:User content is modifiable and cannot grant data permissions; verified identity must drive authorization; because authenticated tenant ownership is its concern, environment-based secret scoping remains outside its effect here.
C:A disclosed key remains usable even if the post is removed; rapid invalidation limits further unauthorized requests; it changes compromised API key response; it does not prove environment-based secret scoping in this case.
Question 354
An application trusts a tenant ID supplied in the user message when fetching data. What should establish identity instead?
- Invalidate or rotate the credential immediately and inspect its recent use.
- Derive tenant context from authenticated server-side claims and access policy.
- Supply credentials from a managed secret source during deployment.
- Partition environment credentials with narrowly scoped access and rotation procedures.
Explanation
Correct Answer
B:User content is modifiable and cannot grant data permissions; verified identity must drive authorization. Derive the tenant ID from server-verified session claims and filter data access using that identity throughout the tool call.
Incorrect Answers
A:A disclosed key remains usable even if the post is removed; rapid invalidation limits further unauthorized requests; for authenticated tenant ownership, a control centered on compromised API key response is not the appropriate substitute.
C:External secret storage supports rotation and access auditing without exposing keys to every code reader; the consequence is improved secrets at deployment boundary, not verified authenticated tenant ownership.
D:Distinct identities prevent a developer test credential from silently authorizing production operations; the authenticated tenant ownership criterion differs from environment-based secret scoping; the gap persists.
Question 355
A service stores API keys in a repository to make setup convenient. Which provisioning approach is safer?
- Inject credentials from a managed secret source during deployment.
- Determine tenant context from authenticated server-side claims and access policy.
- At the application layer, bind authorization to the specific action, target, and validity period.
- Distinguish environment credentials with narrowly scoped access and rotation procedures.
- Invalidate the excess capability and issue a read-only or narrowly scoped credential.
Explanation
Correct Answer
A:External secret storage supports rotation and access auditing without exposing keys to every code reader. Retrieve secret values only at runtime and support access logging and rotation when a credential is suspected of exposure.
Incorrect Answers
B:User content is modifiable and cannot grant data permissions; verified identity must drive authorization; where secrets at deployment boundary matters, a control for authenticated tenant ownership leaves that test unmet.
C:Approval for one operation should not become an open-ended capability; time- and scope-limited grants reduce unintended writes; this targets scoped temporary approval, while the system must demonstrate secrets at deployment boundary.
D:Distinct identities prevent a developer test credential from silently authorizing production operations; it follows environment-based secret scoping constraints but leaves secrets at deployment boundary unspecified.
E:Reducing permissions at the source prevents accidental or injected deletion attempts even if tool routing is imperfect; the scenario's controlling requirement is secrets at deployment boundary, not the related least privilege credential revision concern.
Question 356
A tool integration no longer needs permission to delete resources, but its credential still allows deletion. What should be done?
- Split environment credentials with narrowly scoped access and rotation procedures.
- In this design, bind authorization to the specific action, target, and validity period.
- Revoke the excess capability and issue a read-only or narrowly scoped credential.
- Pass credentials from a managed secret source during deployment.
Explanation
Correct Answer
C:Reducing permissions at the source prevents accidental or injected deletion attempts even if tool routing is imperfect.
Incorrect Answers
A:Distinct identities prevent a developer test credential from silently authorizing production operations; it changes environment-based secret scoping; it does not prove least privilege credential revision in this case.
B:Approval for one operation should not become an open-ended capability; time- and scope-limited grants reduce unintended writes; a remedy for scoped temporary approval is not a substitute for least privilege credential revision.
D:External secret storage supports rotation and access auditing without exposing keys to every code reader; because secrets at deployment boundary is its concern, least privilege credential revision remains outside its effect here.
Question 357
A user approves a one-time account update, but an agent reuses that approval for later changes. What access rule is missing?
- Cancel the excess capability and issue a read-only or narrowly scoped credential.
- Introduce credentials from a managed secret source during deployment.
- Calculate tenant context from authenticated server-side claims and access policy.
- Bind authorization to the specific action, target, and validity period.
Explanation
Correct Answer
D:Approval for one operation should not become an open-ended capability; time- and scope-limited grants reduce unintended writes.
Incorrect Answers
A:Reducing permissions at the source prevents accidental or injected deletion attempts even if tool routing is imperfect; the consequence is improved least privilege credential revision, not verified scoped temporary approval.
B:External secret storage supports rotation and access auditing without exposing keys to every code reader; even if secrets at deployment boundary succeeds, scoped temporary approval still needs separate verification.
C:User content is modifiable and cannot grant data permissions; verified identity must drive authorization; the scoped temporary approval criterion differs from authenticated tenant ownership; the gap persists.
Question 358
A model calls a weather tool with a city argument missing from the JSON object. What should the tool executor do?
- Differentiate each tool's description by purpose, constraints, and examples.
- Require authenticated authorization and explicit approval before executing the charge.
- Validate required input fields and return a structured tool error.
- Provide typed, allowlisted deployment operations and validated parameters.
Explanation
Correct Answer
C:Executing malformed arguments risks downstream failure; a precise error lets the harness recover without fabricating weather.
Incorrect Answers
A:Selection depends heavily on tool descriptions; clear intent boundaries improve routing more than adding more synonyms; it improves discriminating tool descriptions only, leaving missing tool input field unproven.
B:A valid generated tool input is not proof of user consent; business side effects need a separate execution gate; when the goal is missing tool input field, optimizing mutation tool approval misses that operational boundary.
D:Narrow contracts prevent arbitrary commands and make permissions auditable at the action level; this implements restrict tool input contract rather than the demanded missing tool input field.
Question 359
A tool catalog exposes one operation named manage_customer that can both read accounts and erase them, and the model sometimes deletes when it only meant to inspect. What design change most directly improves selection safety?
- Split the broad operation into narrowly scoped read and delete tools with separate authorization requirements.
- Make the combined description longer without changing its delete privileges.
- Give the shared operation a permanent administrator token so its behavior never fails.
- Keep the combined operation and rely on the assistant to infer which hidden behavior is harmless.
Explanation
Correct Answer
A:Distinct capabilities let the application offer safe reads without implicitly granting deletion. Explicit schemas and permission checks reduce accidental side effects when the model chooses among similarly named operations.
Incorrect Answers
B:Better words may help tool selection but cannot remove hazardous authority from a catch-all function. The same callable endpoint could still delete a record after a mistaken argument.
C:Broad credentials increase blast radius and undermine least privilege. A successful privileged call is not evidence that the selected action matched the user’s authorized intent.
D:A broad tool surface makes permission boundaries ambiguous. The execution layer should expose the minimum needed operation rather than depend on the model to infer its side effects.
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.