Question 320
A safety refusal returns a successful HTTP response but not the requested JSON object. What must the parser support?
- Verify the received tool response contract and handle incompatible types explicitly.
- Check identifiers against an authoritative service before applying the result.
- Trim the schema to the supported constraint subset and retest.
- Detect the refusal state before applying the normal schema consumer.
Explanation
Correct Answer
D:Refusal is a valid model outcome and may override structured output shape; it needs a separate application branch.
Incorrect Answers
A:Tool outputs originate outside the model and can drift independently; blindly casting values risks silent failures; testing refusal-aware parsing would still fail after improving external result type validation.
B:Structure guarantees do not establish truth or referential integrity; lookup validation prevents invented IDs from driving actions; the refusal-aware parsing criterion differs from semantic identifier validation; the gap persists.
C:Constrained generation has compilation and feature limits; retrying the identical invalid schema will not resolve it; when the goal is refusal-aware parsing, optimizing schema compilation limits misses that operational boundary.
Question 321
A model returns an amount of -300 for a paid invoice, despite satisfying an integer schema. What must the application enforce?
- Check domain-specific numerical constraints before accepting or committing the amount.
- Check the received tool response contract and handle incompatible types explicitly.
- Find the refusal state before applying the normal schema consumer.
- Specify precise tool input schemas and validate arguments at runtime.
Explanation
Correct Answer
A:Type validation cannot establish the permitted business range; deterministic invariants are required. Validate signed values and state transitions against the invoice's payment state before updating any ledger records.
Incorrect Answers
B:Tool outputs originate outside the model and can drift independently; blindly casting values risks silent failures; the numeric business constraints criterion differs from external result type validation; the gap persists.
C:Refusal is a valid model outcome and may override structured output shape; it needs a separate application branch; it improves refusal-aware parsing only, leaving numeric business constraints unproven.
D:Structured tool inputs reduce ambiguity, while executor validation protects external systems from unsupported values; the effect concerns tool argument schema checks; the success condition is numeric business constraints.
Question 322
A tool result includes an optional field whose type unexpectedly changes. What should the downstream code do?
- Establish precise tool input schemas and validate arguments at runtime.
- Validate the received tool response contract and handle incompatible types explicitly.
- Inspect domain-specific numerical constraints before accepting or committing the amount.
- Recognize the refusal state before applying the normal schema consumer.
Explanation
Correct Answer
B:Tool outputs originate outside the model and can drift independently; blindly casting values risks silent failures.
Incorrect Answers
A:Structured tool inputs reduce ambiguity, while executor validation protects external systems from unsupported values; because tool argument schema checks is its concern, external result type validation remains outside its effect here.
C:Type validation cannot establish the permitted business range; deterministic invariants are required; this may help numeric business constraints but cannot by itself deliver external result type validation.
D:Refusal is a valid model outcome and may override structured output shape; it needs a separate application branch; changing refusal-aware parsing does not establish external result type validation in this application.
Question 323
A user wants CSV export, but the model invents line breaks and misplaced commas. What implementation is more robust?
- Flag the refusal state before applying the normal schema consumer.
- Link the output to an allowed enum and enforce rule-based notification eligibility.
- Generate validated structured rows and serialize CSV with a standard library.
- Interpret the output as incomplete and retry or continue with sufficient budget.
- Validate identifiers against an authoritative service before applying the result.
Explanation
Correct Answer
C:A dedicated serializer correctly handles quoting and delimiters, avoiding brittle manual text formatting. The model should produce structured data; the application should use tested CSV quoting rules to generate the downloadable file.
Incorrect Answers
A:Refusal is a valid model outcome and may override structured output shape; it needs a separate application branch; this implements refusal-aware parsing rather than the demanded safe CSV serialization.
B:Structured classification reduces parser ambiguity, but business authorization must still gate consequential actions; for this request, safe CSV serialization is the missing piece, not validated output to workflow boundary.
D:A generation limit can cut a structured document off before closure; a schema request is not proof of completion; when the goal is safe CSV serialization, optimizing truncated structured response misses that operational boundary.
E:Structure guarantees do not establish truth or referential integrity; lookup validation prevents invented IDs from driving actions; for safe CSV serialization, a control centered on semantic identifier validation is not the appropriate substitute.
Question 324
Claude returns a response containing several cited text segments and source references. A frontend concatenates the text but drops the citation metadata. What should the output adapter preserve?
- Replace every citation identifier with a new random number at display time.
- Embed citation metadata as executable browser script rather than structured data.
- Retain each citation’s source identity and association with its supported answer span.
- Treat the first text segment as authoritative and discard later cited segments.
Explanation
Correct Answer
C:Concatenating text without its references makes otherwise grounded claims unverifiable. The output adapter should carry supported source links and segment associations through rendering and any downstream export.
Incorrect Answers
A:Arbitrary identifiers sever the connection to the underlying document or retrieved item. The display layer must preserve a stable source mapping rather than invent evidence IDs.
B:Executable rendering is not needed to maintain provenance and introduces a separate client-security risk. Citations should be represented as validated display data.
D:The response can contain multiple relevant segments, and the first is not necessarily complete. Dropping later blocks can remove necessary qualifiers and their supporting references.
Question 325
An evaluator needs to verify a model-generated risk category before a workflow sends notifications. What should happen before side effects?
- Map the output to an allowed enum and enforce rule-based notification eligibility.
- Inspect identifiers against an authoritative service before applying the result.
- Interpret all applicable content blocks according to their types and order.
- Streamline the schema to the supported constraint subset and retest.
Explanation
Correct Answer
A:Structured classification reduces parser ambiguity, but business authorization must still gate consequential actions.
Incorrect Answers
B:Structure guarantees do not establish truth or referential integrity; lookup validation prevents invented IDs from driving actions; for validated output to workflow boundary, this instead manages semantic identifier validation; the requested decision remains unresolved.
C:Responses can contain multiple segments; a single-block assumption silently drops information or ignores tool requests; where validated output to workflow boundary matters, a control for complete content block processing leaves that test unmet.
D:Constrained generation has compilation and feature limits; retrying the identical invalid schema will not resolve it; because schema compilation limits is its concern, validated output to workflow boundary remains outside its effect here.
Question 326
A retrieved webpage tells a customer-service agent to transfer internal logs to an attacker URL. What is the underlying threat?
- Keep the text inside the untrusted document channel regardless of its claimed role.
- Treat the embedded command as prompt injection from lower-trust content.
- Reduce and redact sensitive telemetry under a defined retention and access policy.
- Generate narrowly scoped credentials and enforce tenant filters in the service.
Explanation
Correct Answer
B:External page text is evidence, not authorization; successful defense preserves the boundary between retrieved data and trusted instructions.
Incorrect Answers
A:Role labels in retrieved content do not confer system authority; source provenance determines trust; the scenario's controlling requirement is retrieved-content prompt injection, not the related multi-criterion integration concern.
C:Observability should not create a secondary uncontrolled store of personal or confidential content; where retrieved-content prompt injection matters, a control for prompt log data minimization leaves that test unmet.
D:Least privilege reduces the blast radius even if a malicious prompt induces an unexpected tool call; this targets cross-tenant credential scope, while the system must demonstrate retrieved-content prompt injection.
Question 327
A product lets user-entered text choose arbitrary tool URLs. What security control is needed regardless of model behavior?
- Screen records using the authenticated user's data permissions.
- Enforce an outbound destination allowlist and network isolation.
- Employ typed allowlisted operations or isolated execution with validation instead of raw shell interpolation.
- Maintain the text inside the untrusted document channel regardless of its claimed role.
Explanation
Correct Answer
B:A prompt cannot block server-side request forgery reliably; the executor must reject prohibited hosts and address ranges.
Incorrect Answers
A:Prompt-level requests to avoid sensitive material do not replace backend access control at the retrieval boundary; this implements data access filtering rather than the demanded tool-triggered SSRF prevention.
C:Structured parameters and sandboxed privileges reduce the chance that generated strings become arbitrary commands; because generated shell command hardening is its concern, tool-triggered SSRF prevention remains outside its effect here.
D:Role labels in retrieved content do not confer system authority; source provenance determines trust; for this request, tool-triggered SSRF prevention is the missing piece, not multi-criterion integration.
Question 328
An assistant summarizes files belonging to multiple departments. What must happen before text reaches the model?
- Use independent content and permission checks before file export.
- Repair search authorization and document filtering before response generation.
- Apply an outbound destination allowlist and network isolation.
- Evaluate direct jailbreaks, indirect injections, and unsafe tool-side effects separately.
- Filter records using the authenticated user's data permissions.
Explanation
Correct Answer
E:Prompt-level requests to avoid sensitive material do not replace backend access control at the retrieval boundary.
Incorrect Answers
A:Safety behavior is probabilistic and cannot replace deterministic authorization or data-loss controls for external writes; this implements external data exfiltration boundary rather than the demanded data access filtering.
B:Post-generation redaction is fragile when the wrong source was already supplied; secure retrieval prevents exposure earlier; it changes retrieval authorization leak; it does not prove data access filtering in this case.
C:A prompt cannot block server-side request forgery reliably; the executor must reject prohibited hosts and address ranges; the scenario's controlling requirement is data access filtering, not the related tool-triggered SSRF prevention concern.
D:Different attack entry points require different boundaries; a generic refusal-rate metric cannot cover tool misuse and data leakage; testing data access filtering would still fail after improving multi-entry threat modeling.
Question 329
A tool's response contains HTML script tags that a browser renders as markup. What security flaw is present?
- A missing CSRF token on an unrelated form caused the browser to parse script tags.
- The model’s internal tool selection is the only place that browser script execution can occur.
- TLS certificate validation determines whether returned HTML is safe to inject.
- Missing output encoding or sanitization for untrusted rendered content.
Explanation
Correct Answer
D:Tool output may be attacker controlled; contextual encoding protects users from active browser content. Encode text for its insertion context or sanitize rich HTML before it reaches a user's browser, regardless of the tool's origin.
Incorrect Answers
A:CSRF protection guards request origin and intent; it does not sanitize markup in untrusted response text. The rendering sink still requires context-appropriate output encoding.
B:Client-side script execution arises from unsafe HTML rendering even when the tool call itself was authorized. Sanitization is a separate browser-side trust boundary.
C:An authenticated transport does not make user-written or tool-returned markup safe for DOM rendering. The caller must still encode or sanitize dangerous returned content.
Question 330
A support agent receives a request to expose another customer's identity record. Which architecture response is required?
- Enforce object-level authorization before the record can be retrieved.
- Provide narrowly scoped credentials and enforce tenant filters in the service.
- Regard the embedded command as prompt injection from lower-trust content.
- Require an outbound destination allowlist and network isolation.
Explanation
Correct Answer
A:Preventing the data from entering model context is stronger than asking the model to conceal information it already received.
Incorrect Answers
B:Least privilege reduces the blast radius even if a malicious prompt induces an unexpected tool call; for this request, object-level identity access is the missing piece, not cross-tenant credential scope.
C:External page text is evidence, not authorization; successful defense preserves the boundary between retrieved data and trusted instructions; even if retrieved-content prompt injection succeeds, object-level identity access still needs separate verification.
D:A prompt cannot block server-side request forgery reliably; the executor must reject prohibited hosts and address ranges; the consequence is improved tool-triggered SSRF prevention, not verified object-level identity access.