Question 340
An app uses prompt warnings but still lets Claude call a delete-account tool for any user. What is the most effective redesign?
- Mandate an appropriate domain review or deterministic eligibility check before consequential action.
- Restrict deletion to properly authorized roles with an explicit approval step.
- Enforce amount limits in the transaction service before committing the transfer.
- As an alternative, start from minimal tool permissions and expand through tested use cases.
Explanation
Correct Answer
B:Tool permissions and identity checks block forbidden actions; prompt warnings alone cannot enforce privilege. Make the delete endpoint verify the authenticated principal, required role, target account, and any explicit approval token.
Incorrect Answers
A:Generated advice is not a verified event; a separate authority must control high-impact downstream effects; testing layered authorization for destructive tools would still fail after improving human or rule-based safety gate.
C:Deterministic policy gates protect financial state independent of the model's textual self-restraint; this implements transaction limit enforcement rather than the demanded layered authorization for destructive tools.
D:Narrow capabilities limit the harm possible from unexpected outputs or malicious instructions during early operation; because minimum viable tool permissions is its concern, layered authorization for destructive tools remains outside its effect here.
Question 341
A deployment team wants to reduce unsafe generations but cannot rely on one classifier. Which architecture is most defensible?
- Layer input checks, model behavior, output validation, and tool execution controls.
- For this workflow, start from minimal tool permissions and expand through tested use cases.
- Maintain immutable security gates outside model-specific prompt configuration.
- Limit deletion to properly authorized roles with an explicit approval step.
Explanation
Correct Answer
A:Defenses at independent boundaries cover different failure modes rather than placing all trust in a single response filter.
Incorrect Answers
B:Narrow capabilities limit the harm possible from unexpected outputs or malicious instructions during early operation; even if minimum viable tool permissions succeeds, defense in depth still needs separate verification.
C:Separating hard controls from changeable inference settings prevents model migrations from silently weakening enforcement; for defense in depth, this instead manages model independent safety controls; the requested decision remains unresolved.
D:Tool permissions and identity checks block forbidden actions; prompt warnings alone cannot enforce privilege; it improves layered authorization for destructive tools only, leaving defense in depth unproven.
Question 342
A tool returns medical advice that would automatically trigger external notifications. What safeguard should be added?
- Record the policy decision and attempted action with safe metadata before terminating dispatch.
- Combine input checks, model behavior, output validation, and tool execution controls.
- At the application layer, start from minimal tool permissions and expand through tested use cases.
- Constrain deletion to properly authorized roles with an explicit approval step.
- Require an appropriate domain review or deterministic eligibility check before consequential action.
Explanation
Correct Answer
E:Generated advice is not a verified event; a separate authority must control high-impact downstream effects. Require an authorized human or deterministic safety workflow to review the proposed notification before triggering the external action.
Incorrect Answers
A:Auditable enforcement proves the execution gate operated, not merely that the model wrote a refusal; the scenario's controlling requirement is human or rule-based safety gate, not the related policy gate audit evidence concern.
B:Defenses at independent boundaries cover different failure modes rather than placing all trust in a single response filter; this may help defense in depth but cannot by itself deliver human or rule-based safety gate.
C:Narrow capabilities limit the harm possible from unexpected outputs or malicious instructions during early operation; where human or rule-based safety gate matters, a control for minimum viable tool permissions leaves that test unmet.
D:Tool permissions and identity checks block forbidden actions; prompt warnings alone cannot enforce privilege; changing layered authorization for destructive tools does not establish human or rule-based safety gate in this application.
Question 343
A public chatbot is being launched with unrestricted external integrations. What deployment principle should come first?
- Reject the privileged operation and direct the user to a verified access workflow.
- Start from minimal tool permissions and expand through tested use cases.
- Capture the policy decision and attempted action with safe metadata before terminating dispatch.
- Narrow deletion to properly authorized roles with an explicit approval step.
Explanation
Correct Answer
B:Narrow capabilities limit the harm possible from unexpected outputs or malicious instructions during early operation.
Incorrect Answers
A:Uncertain entitlement cannot be treated as permission; fail-closed authorization protects protected resources; a remedy for fail closed on access ambiguity is not a substitute for minimum viable tool permissions.
C:Auditable enforcement proves the execution gate operated, not merely that the model wrote a refusal; for this request, minimum viable tool permissions is the missing piece, not policy gate audit evidence.
D:Tool permissions and identity checks block forbidden actions; prompt warnings alone cannot enforce privilege; this implements layered authorization for destructive tools rather than the demanded minimum viable tool permissions.
Question 344
A developer includes a short-lived service bearer token in the model-visible tool_result for an otherwise permitted API query. Where should that credential actually be used?
- Keep the token in the server-side connector and attach it only to the outbound authenticated request.
- Ask the user to retype the service token whenever the assistant needs to read an account.
- Place the token in a system message and tell Claude never to repeat it.
- Append the token to every tool response to simplify later retries.
Explanation
Correct Answer
A:The agent needs the authorized data returned by the tool, not the credential that obtained it. Backend execution should handle authentication without placing bearer tokens in messages, tool outputs or generated answers.
Incorrect Answers
B:Collecting credentials through chat unnecessarily passes secrets through the model channel. The application should authenticate users and services through its controlled backend flow.
C:Instruction priority cannot make exposed secret bytes safe. Anyone with access to model-visible message content or logs may still encounter the bearer token.
D:Repeating the credential across model turns increases exposure and does not improve transport-layer authentication. The connector should reuse a protected credential store.
Question 345
A compliance team needs evidence that a blocked tool request did not execute. What should be recorded?
- Log the policy decision and attempted action with safe metadata before terminating dispatch.
- Apply amount limits in the transaction service before committing the transfer.
- Retain immutable security gates outside model-specific prompt configuration.
- Block the privileged operation and direct the user to a verified access workflow.
Explanation
Correct Answer
A:Auditable enforcement proves the execution gate operated, not merely that the model wrote a refusal. Record the requested action, authorization decision, enforcement component, and confirmation that execution was denied.
Incorrect Answers
B:Deterministic policy gates protect financial state independent of the model's textual self-restraint; for this request, policy gate audit evidence is the missing piece, not transaction limit enforcement.
C:Separating hard controls from changeable inference settings prevents model migrations from silently weakening enforcement; this targets model independent safety controls, while the system must demonstrate policy gate audit evidence.
D:Uncertain entitlement cannot be treated as permission; fail-closed authorization protects protected resources; the scenario's controlling requirement is policy gate audit evidence, not the related fail closed on access ambiguity concern.
Question 346
An internal assistant must offer a safe alternative when it cannot verify a user's entitlement. What should the app return?
- Stack input checks, model behavior, output validation, and tool execution controls.
- Audit the policy decision and attempted action with safe metadata before terminating dispatch.
- Move enforcement to a pre-execution permission check that can block the operation.
- Deny the privileged operation and direct the user to a verified access workflow.
Explanation
Correct Answer
D:Uncertain entitlement cannot be treated as permission; fail-closed authorization protects protected resources.
Incorrect Answers
A:Defenses at independent boundaries cover different failure modes rather than placing all trust in a single response filter; this implements defense in depth rather than the demanded fail closed on access ambiguity.
B:Auditable enforcement proves the execution gate operated, not merely that the model wrote a refusal; because policy gate audit evidence is its concern, fail closed on access ambiguity remains outside its effect here.
C:Post-execution observation is too late to prevent a destructive side effect; enforcement belongs ahead of dispatch; this may help hook timing for prevention but cannot by itself deliver fail closed on access ambiguity.
Question 347
A company wants to change model settings in production while security policies remain stable. What configuration strategy helps?
- Store the policy decision and attempted action with safe metadata before terminating dispatch.
- Apply input checks, model behavior, output validation, and tool execution controls.
- Keep immutable security gates outside model-specific prompt configuration.
- Require amount limits in the transaction service before committing the transfer.
- Keep secrets outside model-visible content and use restricted backend credentials.
Explanation
Correct Answer
C:Separating hard controls from changeable inference settings prevents model migrations from silently weakening enforcement.
Incorrect Answers
A:Auditable enforcement proves the execution gate operated, not merely that the model wrote a refusal; even if policy gate audit evidence succeeds, model independent safety controls still needs separate verification.
B:Defenses at independent boundaries cover different failure modes rather than placing all trust in a single response filter; this targets defense in depth, while the system must demonstrate model independent safety controls.
D:Deterministic policy gates protect financial state independent of the model's textual self-restraint; the effect concerns transaction limit enforcement; the success condition is model independent safety controls.
E:Sensitive values should be withheld where possible; text instructions do not transform model input into a secure secret store; the model independent safety controls criterion differs from avoid secret-bearing prompts; the gap persists.
Question 348
Claude Code is about to invoke a disallowed shell command. At what event should a blocking hook act?
- Reject the tool call based on normalized path and allowlisted boundaries.
- Employ tool lifecycle hooks to capture approved execution metadata into audit logs.
- Shift enforcement to a pre-execution permission check that can block the operation.
- Intercept the command in a PreToolUse-style hook before execution.
Explanation
Correct Answer
D:A pre-tool hook can inspect inputs and deny a command before side effects occur; later logging cannot undo an execution.
Incorrect Answers
A:Validating the actual execution target prevents path-based escapes; a human-readable prompt instruction is insufficient enforcement; the preventive hook placement criterion differs from multi-criterion integration; the gap persists.
B:Hook callbacks can supply deterministic telemetry independently of the content Claude chooses to write to the user; for preventive hook placement, a control centered on hook-driven audit telemetry is not the appropriate substitute.
C:Post-execution observation is too late to prevent a destructive side effect; enforcement belongs ahead of dispatch; it improves hook timing for prevention only, leaving preventive hook placement unproven.
Question 349
A Claude Code policy hook denies commands by checking only whether the command starts with "rm ". A tool request uses another utility to delete a protected directory. What should the policy review address?
- Move the same literal-string check to an after-tool notification hook.
- Keep the prefix filter and assume all other command names are read-only.
- Enforce protected-path permissions at the execution boundary and broaden command validation beyond a single string prefix.
- Put the forbidden command list into a Skill as the sole enforcement mechanism.
Explanation
Correct Answer
C:Literal prefix matching misses equivalent operations, chained commands and indirect file writes. Filesystem permissions and robust argument-aware checks provide a stronger boundary than searching one generated shell command string.
Incorrect Answers
A:A post-execution notification observes an action after its side effect may have occurred. It cannot prevent a protected directory from being modified during the operation.
B:Many commands can mutate files or invoke subprocesses. Restricting only one spelling of a destructive operation leaves alternative execution paths available to the agent.
D:Instruction content can guide the assistant but does not guarantee command rejection. The actual tool permissions and execution environment must enforce the restriction.
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.