Question 240 A prompt template includes raw user-controlled text inside a developer-role instruction block, allowing role confusion. Which test best verifies the intended result in this case? Inject a harmless markup canary and verify it is rendered as text rather than executed. Replay direct and indirect injection fixtures and verify tool policy still blocks malicious requests. Submit malformed output cases and require schema rejection rather than silent defaults. Insert role delimiter strings and verify the model and tools retain original role authority. ExplanationCorrect Answer D:Insert role delimiter strings and verify the model and tools retain original role authority. Text concatenation can give attacker content the appearance of privileged instructions. Other Answers A:“Inject a harmless markup canary and verify it is rendered as text rather than executed” does not establish the required result because text concatenation can give attacker content the appearance of privileged instructions. B:“Replay direct and indirect injection fixtures and verify tool policy still blocks malicious requests” does not establish the required result because text concatenation can give attacker content the appearance of privileged instructions. C:“Submit malformed output cases and require schema rejection rather than silent defaults” does not establish the required result because text concatenation can give attacker content the appearance of privileged instructions.
Question 241 A prompt template includes raw user-controlled text inside a developer-role instruction block, allowing role confusion. Which ongoing safeguard best prevents this problem or keeps the requirement satisfied? Use typed prompt templates and reject role-boundary injection in testing. Use defense-in-depth; never treat a prompt firewall as a sole enforcement boundary. Version output schemas and run contract regression tests before each model switch. Require output-context encoding tests for all UI integrations. ExplanationCorrect Answer A:Text concatenation can give attacker content the appearance of privileged instructions. Verification: Insert role delimiter strings and verify the model and tools retain original role authority. Other Answers B:“Use defense-in-depth; never treat a prompt firewall as a sole enforcement boundary” does not adequately prevent recurrence because text concatenation can give attacker content the appearance of privileged instructions. C:“Version output schemas and run contract regression tests before each model switch” does not adequately prevent recurrence because text concatenation can give attacker content the appearance of privileged instructions. D:“Require output-context encoding tests for all UI integrations” does not adequately prevent recurrence because text concatenation can give attacker content the appearance of privileged instructions.
Question 242 A chatbot automatically retries every refused response until the provider generates an unrestricted answer. Which response most directly addresses the stated need or control weakness? Apply gateway input-token caps, output-token budgets and quota-aware error responses. Preserve policy refusals as non-success and route to a controlled review rather than retrying around guardrails. Define scoped model behavior guardrails and an out-of-scope response policy with adversarial testing. Benchmark optimized guardrail placement while retaining critical policy checks and documented exceptions. ExplanationCorrect Answer B:Unbounded refusal retries can bypass intended safety handling and increase cost. To verify, simulate provider refusal codes and verify retry budgets and safe terminal status. Other Answers A:“Apply gateway input-token caps, output-token budgets and quota-aware error responses” would not correct the underlying issue because unbounded refusal retries can bypass intended safety handling and increase cost. C:“Define scoped model behavior guardrails and an out-of-scope response policy with adversarial testing” would not correct the underlying issue because unbounded refusal retries can bypass intended safety handling and increase cost. D:“Benchmark optimized guardrail placement while retaining critical policy checks and documented exceptions” would not correct the underlying issue because unbounded refusal retries can bypass intended safety handling and increase cost.
Question 243 A chatbot automatically retries every refused response until the provider generates an unrestricted answer. Which underlying principle best explains the situation? A generic generation endpoint can respond beyond its authorized business use when no policy gate exists. Removing an enforcement step can lower latency while expanding unauthorized output or action risk. Unbounded refusal retries can bypass intended safety handling and increase cost. Tokens consume inference compute and billing even if the request body is otherwise valid. ExplanationCorrect Answer C:Unbounded refusal retries can bypass intended safety handling and increase cost. The corresponding corrective action is Preserve policy refusals as non-success and route to a controlled review rather than retrying around guardrails. Other Answers A:“A generic generation endpoint can respond beyond its authorized business use when no policy gate exists” does not explain what happened because unbounded refusal retries can bypass intended safety handling and increase cost. B:“Removing an enforcement step can lower latency while expanding unauthorized output or action risk” does not explain what happened because unbounded refusal retries can bypass intended safety handling and increase cost. D:“Tokens consume inference compute and billing even if the request body is otherwise valid” does not explain what happened because unbounded refusal retries can bypass intended safety handling and increase cost.
Question 244 A chatbot automatically retries every refused response until the provider generates an unrestricted answer. Which test best verifies the intended result in this case? Measure p95 latency and adversarial false-allow rates under the same load profile. Send oversized and near-limit requests and verify deterministic rejection plus budget telemetry. Test a diverse out-of-scope set and verify refusal or a permitted handoff without fabricated advice. Simulate provider refusal codes and verify retry budgets and safe terminal status. ExplanationCorrect Answer D:Simulate provider refusal codes and verify retry budgets and safe terminal status. Unbounded refusal retries can bypass intended safety handling and increase cost. Other Answers A:“Measure p95 latency and adversarial false-allow rates under the same load profile” does not establish the required result because unbounded refusal retries can bypass intended safety handling and increase cost. B:“Send oversized and near-limit requests and verify deterministic rejection plus budget telemetry” does not establish the required result because unbounded refusal retries can bypass intended safety handling and increase cost. C:“Test a diverse out-of-scope set and verify refusal or a permitted handoff without fabricated advice” does not establish the required result because unbounded refusal retries can bypass intended safety handling and increase cost.
Question 245 A chatbot automatically retries every refused response until the provider generates an unrestricted answer. Which ongoing safeguard best prevents this problem or keeps the requirement satisfied? Specify refusal outcomes and bounded retry logic in the API client contract. Establish per-service token and spending ceilings with alert thresholds. Version use-case constraints and fail-open/fail-closed decisions in the guardrail contract. Use performance budgets that cannot waive mandatory security checks without risk approval. ExplanationCorrect Answer A:Unbounded refusal retries can bypass intended safety handling and increase cost. To verify, simulate provider refusal codes and verify retry budgets and safe terminal status. Other Answers B:“Establish per-service token and spending ceilings with alert thresholds” does not adequately prevent recurrence because unbounded refusal retries can bypass intended safety handling and increase cost. C:“Version use-case constraints and fail-open/fail-closed decisions in the guardrail contract” does not adequately prevent recurrence because unbounded refusal retries can bypass intended safety handling and increase cost. D:“Use performance budgets that cannot waive mandatory security checks without risk approval” does not adequately prevent recurrence because unbounded refusal retries can bypass intended safety handling and increase cost.
Question 246 An LLM gateway validates user requests but forwards model output directly into a web page as raw HTML. Which response most directly addresses the stated need or control weakness? Require authenticated endpoint access with explicit network restrictions before accepting requests. Encode or sanitize output at the browser sink and restrict downstream rendering formats. Separate developer instructions from untrusted user fields using structured role boundaries and escaping. Define a typed structured-output contract and validate parsed response fields before downstream use. ExplanationCorrect Answer B:Model-generated strings remain untrusted output and can become cross-site scripting payloads. Verification: Inject a harmless markup canary and verify it is rendered as text rather than executed. Other Answers A:“Require authenticated endpoint access with explicit network restrictions before accepting requests” would not correct the underlying issue because model-generated strings remain untrusted output and can become cross-site scripting payloads. C:“Separate developer instructions from untrusted user fields using structured role boundaries and escaping” would not correct the underlying issue because model-generated strings remain untrusted output and can become cross-site scripting payloads. D:“Define a typed structured-output contract and validate parsed response fields before downstream use” would not correct the underlying issue because model-generated strings remain untrusted output and can become cross-site scripting payloads.
Question 247 An LLM gateway validates user requests but forwards model output directly into a web page as raw HTML. Which underlying principle best explains the situation? Text concatenation can give attacker content the appearance of privileged instructions. A request to write JSON in prose does not guarantee all required keys or enum values. Model-generated strings remain untrusted output and can become cross-site scripting payloads. Network reachability is not authorization, and a raw inference endpoint may leak model capability or data. ExplanationCorrect Answer C:Model-generated strings remain untrusted output and can become cross-site scripting payloads. The corresponding corrective action is Encode or sanitize output at the browser sink and restrict downstream rendering formats. Other Answers A:“Text concatenation can give attacker content the appearance of privileged instructions” does not explain what happened because model-generated strings remain untrusted output and can become cross-site scripting payloads. B:“A request to write JSON in prose does not guarantee all required keys or enum values” does not explain what happened because model-generated strings remain untrusted output and can become cross-site scripting payloads. D:“Network reachability is not authorization, and a raw inference endpoint may leak model capability or data” does not explain what happened because model-generated strings remain untrusted output and can become cross-site scripting payloads.
Question 248 An LLM gateway validates user requests but forwards model output directly into a web page as raw HTML. Which test best verifies the intended result in this case? Submit malformed output cases and require schema rejection rather than silent defaults. Attempt anonymous external inference and verify denial while approved service identity succeeds. Insert role delimiter strings and verify the model and tools retain original role authority. Inject a harmless markup canary and verify it is rendered as text rather than executed. ExplanationCorrect Answer D:Inject a harmless markup canary and verify it is rendered as text rather than executed. Model-generated strings remain untrusted output and can become cross-site scripting payloads. Other Answers A:“Submit malformed output cases and require schema rejection rather than silent defaults” does not establish the required result because model-generated strings remain untrusted output and can become cross-site scripting payloads. B:“Attempt anonymous external inference and verify denial while approved service identity succeeds” does not establish the required result because model-generated strings remain untrusted output and can become cross-site scripting payloads. C:“Insert role delimiter strings and verify the model and tools retain original role authority” does not establish the required result because model-generated strings remain untrusted output and can become cross-site scripting payloads.
Question 249 An LLM gateway validates user requests but forwards model output directly into a web page as raw HTML. Which ongoing safeguard best prevents this problem or keeps the requirement satisfied? Require output-context encoding tests for all UI integrations. Default AI endpoints to private network and authenticated API access by policy. Use typed prompt templates and reject role-boundary injection in testing. Version output schemas and run contract regression tests before each model switch. ExplanationCorrect Answer A:Model-generated strings remain untrusted output and can become cross-site scripting payloads. Verification: Inject a harmless markup canary and verify it is rendered as text rather than executed. Other Answers B:“Default AI endpoints to private network and authenticated API access by policy” does not adequately prevent recurrence because model-generated strings remain untrusted output and can become cross-site scripting payloads. C:“Use typed prompt templates and reject role-boundary injection in testing” does not adequately prevent recurrence because model-generated strings remain untrusted output and can become cross-site scripting payloads. D:“Version output schemas and run contract regression tests before each model switch” does not adequately prevent recurrence because model-generated strings remain untrusted output and can become cross-site scripting payloads.
Question 250 A manager orders production guardrails disabled temporarily to reduce response latency without a compensating review. Which response most directly addresses the stated need or control weakness? Define scoped model behavior guardrails and an out-of-scope response policy with adversarial testing. Benchmark optimized guardrail placement while retaining critical policy checks and documented exceptions. Re-run adversarial and task-quality regression cases on the new guardrail/model combination. Preserve policy refusals as non-success and route to a controlled review rather than retrying around guardrails. ExplanationCorrect Answer B:Removing an enforcement step can lower latency while expanding unauthorized output or action risk. To verify, measure p95 latency and adversarial false-allow rates under the same load profile. Other Answers A:“Define scoped model behavior guardrails and an out-of-scope response policy with adversarial testing” would not correct the underlying issue because removing an enforcement step can lower latency while expanding unauthorized output or action risk. C:“Re-run adversarial and task-quality regression cases on the new guardrail/model combination” would not correct the underlying issue because removing an enforcement step can lower latency while expanding unauthorized output or action risk. D:“Preserve policy refusals as non-success and route to a controlled review rather than retrying around guardrails” would not correct the underlying issue because removing an enforcement step can lower latency while expanding unauthorized output or action risk.