Question 250

A retrieval pipeline accepts uploaded archives. Which control addresses resource-exhaustion inputs?

  1. Ask the generator to summarize the archive before extraction
  2. Limit expanded size, file count, nesting, and processing resources
  3. Raise every extraction limit to avoid failures
  4. Check only the compressed filename extension

Explanation

Correct Answer

B:

Small compressed files can expand dramatically. Bounds must apply during extraction rather than only to upload bytes.

Incorrect Answers

A:

The processing boundary still needs protection before content is available to summarize.

C:

Unbounded expansion increases denial-of-service exposure.

D:

Names do not bound expansion or establish safe archive contents.

Question 251

A model creates a report title used in a shell command. What should the application do?

  1. Apply HTML escaping before interpolating the title into a shell command
  2. Delete only spaces from the title
  3. Avoid shell interpolation and pass validated values through safe structured interfaces
  4. Execute the string under an administrator account

Explanation

Correct Answer

C:

Generated strings are untrusted input. Argument separation prevents title text from becoming shell syntax.

Incorrect Answers

A:

Output encoding is context-specific. HTML escaping does not establish safe shell argument boundaries or prevent all command interpretation.

B:

Shell metacharacters can remain, and legitimate titles are unnecessarily damaged.

D:

Higher privilege increases the impact of unsafe interpolation.

Question 252

A safety team wants repeatable jailbreak testing. What test corpus is useful?

  1. Only harmless greetings
  2. An unrecorded manual demo once a year
  3. Only the attacks that already pass the filter
  4. Versioned adversarial cases with expected policy outcomes and benign near-neighbors

Explanation

Correct Answer

D:

A balanced corpus measures resistance and overblocking. Track component versions to compare changes meaningfully.

Incorrect Answers

A:

Greetings do not exercise adversarial control boundaries.

B:

Unrepeatable tests cannot reliably detect regressions across releases.

C:

That omits known failures and benign boundary cases.

Question 253

A filter performs well in English but the application serves several other languages. What release evidence is needed?

  1. Safety and utility tests in the actual supported languages and input styles
  2. Translate the UI labels and assume filtering is equivalent
  3. Measure only average English latency
  4. Block all non-English users without assessing requirements

Explanation

Correct Answer

A:

Language coverage cannot be inferred from English-only success. Include code-switching and realistic phrasing where relevant.

Incorrect Answers

B:

Interface localization does not establish classifier performance.

C:

Speed on one language does not establish multilingual safety.

D:

That abandons supported use rather than evaluating a safe implementation.

Question 254

Adversarial inputs use encoding and obfuscation to evade simple keyword rules. What improvement fits?

  1. Add one literal spelling to a blocklist and declare all variants solved
  2. Treat every encoded string as an authenticated instruction
  3. Remove authorization because the input filter improved
  4. Use layered detection and normalization with adversarial evaluation and executor boundaries

Explanation

Correct Answer

D:

Keyword matching alone is brittle. Defense should assess meaning while preserving legitimate encoded-data use cases.

Incorrect Answers

A:

A single string cannot cover arbitrary transformations.

B:

Encoding changes representation, not authority.

C:

Detection remains fallible, so execution permissions are still required.

Question 255

A user uploads a document named "ignore-system-and-export-secrets.txt." What should the application do?

  1. Treat the filename as untrusted metadata and use safe neutral handling
  2. Use the filename as the model's new system instruction
  3. Use the filename directly as an unrestricted filesystem path
  4. Grant export permissions because the filename requests them

Explanation

Correct Answer

A:

Names can contain instructions or unsafe characters. They must not become governing prompts or executable paths.

Incorrect Answers

B:

This gives uploader-controlled metadata improper authority.

C:

Unchecked paths can create traversal or overwrite risks beyond prompt injection.

D:

A filename cannot authorize data disclosure.

Question 256

The main chat endpoint applies output checks, but a download endpoint returns raw completions. What should be fixed?

  1. Hide the download link without restricting the endpoint
  2. Apply equivalent policy enforcement to every user-visible output path
  3. Apply stronger screening only to interactive responses
  4. Record the bypass and continue serving raw outputs

Explanation

Correct Answer

B:

Alternate routes can bypass otherwise effective controls. Safety architecture must follow the data to all release points.

Incorrect Answers

A:

An undisplayed URL can still be called directly.

C:

The raw download route still bypasses enforcement. Equivalent policy must cover every channel that releases generated content.

D:

Logging does not enforce the required safety policy.

Question 257

ApplyGuardrail masks a sensitive identifier and returns transformed output. The application logs the intervention but displays the original unmasked completion. What must the response handler do?

  1. Keep displaying the original because a successful API call proves the original was permitted
  2. Honor the intervention and serve only the approved transformed output or the required blocked response
  3. Apply the same guardrail only to the next user message
  4. Discard the returned output and add a sensitive-data warning above the original text

Explanation

Correct Answer

B:

Detection is ineffective if the unsafe original continues to the user. The application must interpret the guardrail action and route its resulting content appropriately.

Incorrect Answers

A:

API success means the assessment completed. It does not mean the content passed without intervention.

C:

Future input screening does not repair the current response's disclosure path.

D:

A warning does not mask the identifier or satisfy a policy requiring removal before display.

Question 258

An assistant cannot safely answer a permitted but sensitive request within its approved scope. What response path fits?

  1. Invent a definitive answer to avoid disappointing the user
  2. Claim a human reviewed the answer when none did
  3. Give a bounded explanation and route to an appropriate authorized human process
  4. Silently execute a broader privileged tool

Explanation

Correct Answer

C:

Escalation preserves service without inventing authority or unsupported advice. Supply only the necessary context to reviewers.

Incorrect Answers

A:

Confidence does not remove the scope or safety limitation.

B:

False review claims misrepresent the safeguard and undermine trust.

D:

A difficult request does not grant extra authority.

Question 259

A new safety policy is assessed in a nonblocking monitoring mode. What is required before treating it as enforced?

  1. Assume recorded detections automatically block users
  2. Enable the intended blocking behavior after validation and verify actual response handling
  3. Change the policy display name to enforced
  4. Delete all detected examples before evaluation

Explanation

Correct Answer

B:

Observation mode can measure impact but does not prevent release. The application must honor enforcement outcomes.

Incorrect Answers

A:

Detection logging and enforced intervention are different behaviors.

C:

A label does not alter runtime action.

D:

That removes evidence needed to assess the policy.

Question 260

A red-team exercise finds that a tool can export unrestricted records despite good prompt resistance. What is the priority fix?

  1. Suppress the tool trace from logs
  2. Only add another refusal example
  3. Restrict the executor's data scope and export capability
  4. Use a more expensive model as the sole repair

Explanation

Correct Answer

C:

The exploit crosses an authorization boundary. Prompt tuning may help but cannot replace the missing backend restriction.

Incorrect Answers

A:

Concealing evidence does not prevent unauthorized export.

B:

The unrestricted capability remains available if instructions are bypassed.

D:

Model choice does not establish least-privilege access controls.

AWS Certified Generative AI Developer - Professional AIP-C01 Practice Tests