Question 310
An API conversation replay bug promotes a past customer message to the system-instruction field and unexpectedly overrides the product policy. Which technical control is appropriate?
- Restart with a concise summary when context is exhausted
- Supply alternating conversation turns in messages
- Resubmit relevant history for a follow-up
- Preserve message roles when reconstructing API conversation history
Explanation
Correct Answer
D:Role-preserving serialization separates historical user content from trusted system instructions and assistant turns; in production, resubmitting raw text without trusted role metadata can change instruction authority across requests.
Incorrect Answers
A:Compaction retains goals, commitments, and key evidence in less context before the next call; this addresses a separate concern, not the fact that role-preserving serialization separates historical user content from trusted system instructions and assistant turns; summarization can lose details, so critical structured state remains in application storage.
B:Request messages carry explicit user and assistant roles because the API does not automatically retain prior chat state; here, the controlling capability is that role-preserving serialization separates historical user content from trusted system instructions and assistant turns, but omitting history makes follow-up references ambiguous unless reintroduced elsewhere.
C:The stateless API needs the prior context supplied again or reconstructed by the app; the missing capability is more specific: role-preserving serialization separates historical user content from trusted system instructions and assistant turns; separate requests do not automatically share private conversational state.
Question 311
A repository team needs common allow and deny rules for Claude Code commands across contributors, while enterprise-wide mandatory restrictions remain centrally managed. Which approach best meets this requirement?
- Review plugin permissions before activation
- Commit shared .claude/settings.json tool permissions to the repository
- Use user-level guidance for personal defaults
- Use organization-managed policy for enforced restrictions
Explanation
Correct Answer
B:Versioned shared project settings distribute a baseline of tool permission rules and hooks to that repository—with this limitation: local settings and stronger centrally managed policies still affect the effective permission set.
Incorrect Answers
A:Least-privilege permission review limits what installed integrations can access; however, the critical mechanism here is that versioned shared project settings distribute a baseline of tool permission rules and hooks to that repository, and a friendly plugin description is not a security audit.
C:Personal configuration scopes recurring individual preferences independently of shared project rules; this cannot substitute for the behavior that versioned shared project settings distribute a baseline of tool permission rules and hooks to that repository, because private defaults should not override necessary repository safety requirements.
D:Managed settings supply centrally governed guardrails rather than relying on voluntary user configuration; in contrast, versioned shared project settings distribute a baseline of tool permission rules and hooks to that repository, while ordinary project instructions are not equivalent to an enforced corporate security policy.
Question 312
Test code must access only sandbox tools and a lower-risk model budget, not production customer records. Which mechanism should the team prioritize?
- Use connection reuse for frequent calls
- Authenticate with a server-managed API credential
- Separate environments and credentials
- Use scoped application credentials for downstream tools
Explanation
Correct Answer
C:Independent configuration and secrets reduce accidental cross-environment side effects, subject to this requirement: sharing powerful production credentials with tests defeats environmental isolation.
Incorrect Answers
A:Persistent connections reduce repeated connection setup overhead; this cannot substitute for the behavior that independent configuration and secrets reduce accidental cross-environment side effects, because pool sizing still has to respect concurrency and upstream rate limits.
B:A trusted backend injects and safeguards the credential when making requests; in contrast, independent configuration and secrets reduce accidental cross-environment side effects, while embedding the key in front-end JavaScript makes it available to site visitors.
D:The tool's runtime identity is granted only the resources its operation needs; here, the controlling capability is that independent configuration and secrets reduce accidental cross-environment side effects, but model instruction hierarchy cannot replace actual access-control checks.
Question 313
A hosted product serves different organizations through shared infrastructure and one organization's history must not leak. Which measure directly addresses the problem?
- Persist conversation history in application storage
- Use an account-scoped history key
- Separate tenant-specific conversation state
- Invalidate session privileges after role changes
Explanation
Correct Answer
C:Tenant isolation is enforced in storage queries, tools, and context assembly; notably, merely instructing the model not to mix tenants is an inadequate barrier.
Incorrect Answers
A:The application saves and reconstructs relevant turns because Messages requests are stateless; however, the critical mechanism here is that tenant isolation is enforced in storage queries, tools, and context assembly, and assuming the API remembers every prior independent call will break continuity.
B:Session storage is keyed to authenticated identity and checked on every retrieval; the requirement instead turns on this behavior: tenant isolation is enforced in storage queries, tools, and context assembly; a client-supplied chat ID alone is not sufficient authorization.
D:Authorization checks must reflect current permissions rather than those cached at session creation; in contrast, tenant isolation is enforced in storage queries, tools, and context assembly, while prior approval of one request does not authorize later actions forever.
Question 314
A complex multi-constraint plan needs additional deliberate reasoning and the selected model supports thinking controls. What should the team do at this decision point?
- Check model compatibility before changing thinking mode
- Use supported thinking controls for a reasoning task
- Use a supported file or document input method
- Choose a lower effort mode for routine requests
Explanation
Correct Answer
B:Request settings trade token consumption and latency against potential reasoning performance, subject to this requirement: thinking support and parameter syntax depend on the particular model and API revision.
Incorrect Answers
A:A capability check and test run prevent invalid parameter combinations and behavioral regressions; in contrast, request settings trade token consumption and latency against potential reasoning performance, while assuming every family supports the same thinking configuration is unsafe.
C:The integration supplies supported document content using the relevant API capability and access rules; here, the controlling capability is that request settings trade token consumption and latency against potential reasoning performance, but an arbitrary URL or filename does not automatically become readable source material.
D:A supported effort setting reduces unnecessary reasoning work for easy outputs; the missing capability is more specific: request settings trade token consumption and latency against potential reasoning performance; a low effort budget can underperform on genuinely difficult analytical cases.
Question 315
An agent requests dozens of independent product-status calls but its supplier API accepts no more than four simultaneous operations before returning rate-limit errors. What is the best fit for the described situation?
- Cap concurrent tool executions with a bounded scheduler
- Dispatch every read-only call immediately without a concurrency limit
- Reconcile all returned tool results before synthesis
- Allowlist tools per agent role
Explanation
Correct Answer
A:A dispatch semaphore limits active calls to the provider concurrency allowance while queuing additional requests; its operational boundary is that blindly parallelizing all available calls can overwhelm the upstream quota even when operations are independent.
Incorrect Answers
B:Unbounded fan-out starts all requested reads without regard to supplier throughput; this addresses a separate concern, not the fact that a dispatch semaphore limits active calls to the provider concurrency allowance while queuing additional requests; independent requests can still trigger quotas or upstream overload when no concurrency ceiling is enforced.
C:The harness maps all available results to their calls before requesting a comparative answer; here, the controlling capability is that a dispatch semaphore limits active calls to the provider concurrency allowance while queuing additional requests, but ignoring a pending result can produce an unsupported recommendation.
D:Restricting registered capabilities limits possible operations at the dispatch boundary; the missing capability is more specific: a dispatch semaphore limits active calls to the provider concurrency allowance while queuing additional requests; a polite instruction cannot fully constrain a tool whose credentials are overprivileged.
Question 316
Users complain that careful reasoning takes too long even when the final answer is short. Which implementation mechanism is needed?
- Budget total latency for thinking and output
- Choose a lower effort mode for routine requests
- Use supported thinking controls for a reasoning task
- Inspect stop_reason before returning output
Explanation
Correct Answer
A:Performance tests include model reasoning time as well as visible answer generation; the important constraint is that restricting just the final response length may not address total computation time.
Incorrect Answers
B:A supported effort setting reduces unnecessary reasoning work for easy outputs; the requirement instead turns on this behavior: performance tests include model reasoning time as well as visible answer generation; a low effort budget can underperform on genuinely difficult analytical cases.
C:Request settings trade token consumption and latency against potential reasoning performance; this cannot substitute for the behavior that performance tests include model reasoning time as well as visible answer generation, because thinking support and parameter syntax depend on the particular model and API revision.
D:The completion reason tells the client whether to deliver, dispatch, or handle truncation; in contrast, performance tests include model reasoning time as well as visible answer generation, while treating all returned content as a complete final answer can hide partial results.
Question 317
An internal lookup returns fields containing a note that appears to command the model to change behavior. Which solution should the engineer adopt?
- Use the Messages API system field for app-wide behavior
- Separate code execution from generated text
- Use tool results as data to be interpreted
- Treat retrieved pages as untrusted evidence
Explanation
Correct Answer
C:Result content is evidence from an external subsystem and must not become a system instruction; in production, even trusted services can carry attacker-controlled record values.
Incorrect Answers
A:Server code supplies a governing system instruction separately from the user-message array; here, the controlling capability is that result content is evidence from an external subsystem and must not become a system instruction, but placing it inside user-supplied text exposes the rule to unintended editing and trust confusion.
B:Text suggestions remain inert until authorized application logic validates and runs an approved operation; the missing capability is more specific: result content is evidence from an external subsystem and must not become a system instruction; rendering a command in the answer is not an execution authorization.
D:External page text should be handled as data, not as new operational authority; the needed capability is different—result content is evidence from an external subsystem and must not become a system instruction—and a page author cannot legitimately override the application's system policy.
Question 318
Old tool plugins are still present after the workflow that required them has been retired. Which implementation mechanism is needed?
- Pin and test MCP server compatibility
- Declare integration dependencies explicitly
- Record prompt version in traces
- Remove unused integrations
Explanation
Correct Answer
D:Decommissioning unneeded capabilities reduces the exposed attack surface and maintenance burden, although merely hiding a tool from a menu may not revoke its underlying credential.
Incorrect Answers
A:Version tracking and integration tests preserve compatibility at the tool boundary; the missing capability is more specific: decommissioning unneeded capabilities reduces the exposed attack surface and maintenance burden; automatically adopting an untested update can break dispatch or authorization.
B:Configuration and onboarding document required tool integrations and supported versions; by comparison, the intended solution relies on this: decommissioning unneeded capabilities reduces the exposed attack surface and maintenance burden; assuming every client has identical external tools makes behavior unpredictable.
C:Trace metadata connects outcomes to the actual deployed instruction set; the needed capability is different—decommissioning unneeded capabilities reduces the exposed attack surface and maintenance burden—and a model name by itself does not explain prompt-specific behavior changes.
Question 319
A server-side tool loop has paused before its expected completion and the stop reason indicates a pause. Which change would satisfy the constraint?
- Handle max_tokens as an incomplete completion
- Handle pause_turn as a resumable server operation
- Treat 5xx as potential upstream service faults
- Handle end_turn as normal completion
Explanation
Correct Answer
B:The client follows the documented continuation flow for that intermediate condition—with this limitation: a paused operation is not necessarily a finished user answer.
Incorrect Answers
A:The client detects truncation and adjusts or continues the generation under controlled rules; however, the critical mechanism here is that the client follows the documented continuation flow for that intermediate condition, and a partially formed response should not be stored as complete structured data.
C:The client applies guarded retries and monitoring while preserving safe degraded behavior; this cannot substitute for the behavior that the client follows the documented continuation flow for that intermediate condition, because treating an outage as a prompt defect misdirects investigation.
D:The caller can finalize the output without fabricating further tool actions; in contrast, the client follows the documented continuation flow for that intermediate condition, while additional automatic continuations risk duplicating the answer.
Question 320
A model requests a payment lookup but sends a string where a bounded integer is required. What would best address the stated failure mode?
- Retry transient failures with backoff
- Check tool arguments against a schema
- Record tool-call arguments and outcomes safely
- Return structured tool errors to the model
Explanation
Correct Answer
B:Typed validation rejects malformed or out-of-policy arguments before backend execution; notably, a model-generated JSON object can be syntactically valid while still violating business rules.
Incorrect Answers
A:A bounded retry policy handles intermittent service errors without indefinitely hammering the dependency; the requirement instead turns on this behavior: typed validation rejects malformed or out-of-policy arguments before backend execution; repeating a rejected unauthorized request cannot repair missing permission.
C:Structured traces capture call names, sanitized inputs, responses, timing, and error classification; in contrast, typed validation rejects malformed or out-of-policy arguments before backend execution, while logging must redact secrets and sensitive payload fields before persistence.
D:A clear error result tells the agent what failed and whether it can try an alternative; this addresses a separate concern, not the fact that typed validation rejects malformed or out-of-policy arguments before backend execution; swallowing the error as an empty success invites fabricated conclusions.