GCP Professional ML Engineer Practice Question 20: Model Armor Prompt Screening
Google Cloud Professional Machine Learning Engineer · Test 2 · question 10 of 10
A gen AI assistant built on Gemini is about to be opened to external customers. Two risks are blocking launch: testers have made the assistant ignore its system instructions with crafted inputs, and on several occasions it echoed internal identifiers back into a reply. Security wants both the incoming prompts and the generated responses screened, with one consistently enforced policy rather than checks scattered through the application code.
Which Google Cloud service should you put in front of the model?
Show answer and explanation
Answer:
Model Armor is the Google Cloud service for exactly this: it proactively screens LLM prompts and responses, and its documented use cases include protecting against prompt injection and jailbreak attacks and mitigating the risk of leaking sensitive intellectual property and PII in prompts or responses. It sits between the application and the model, inspecting the incoming prompt before it reaches the LLM and the generated response before it reaches the user, and the filters are configured as a policy that is enforced consistently across applications, instead of ad hoc checks in code (option B).
- A is wrong because a service perimeter governs where data may move between Google Cloud services. It cannot inspect the text of a prompt or a response, so it stops neither the injection nor an identifier appearing in a reply the customer is entitled to receive. - C is wrong because Model Monitoring tracks statistical deviation such as drift and skew in a model's inputs and outputs over time. It raises no per-request decision and has no concept of a malicious prompt. - D is wrong because a discovery scan over logs is after the fact. It can tell you an identifier was disclosed yesterday, but by then it has already been returned to the customer, and it never sees the prompt before the model does.
Reference: Model Armor overview