SnowPro Specialty: Gen AI Question 239
Single answerCortex GuardA financial services company is building a customer-support assistant in Snowflake using Cortex AI functions. During testing, the team discovers two risks: some user prompts attempt to override system instructions to exfiltrate internal policy text, and some generated responses could include regulated financial guidance that must be blocked before reaching end users. The architect wants a control that can inspect both incoming prompts and outgoing model responses as part of the application flow, without relying only on prompt engineering. Which approach best addresses this requirement?
- A
Configure Cortex Guard to evaluate both prompts and completions so unsafe or policy-violating content can be detected and blocked in the application workflow.
- B
Increase the maximum token limit for the model so the system prompt has more space to dominate malicious user input.
- C
Store all prompts and responses in a Snowflake table and review them later with SQL queries to identify violations after users have already seen the output.
- D
Use a larger foundation model because stronger models do not require additional safeguards against prompt injection or unsafe output.
Show answer and explanation
Correct answer: A
Explanation
The best answer is to use Cortex Guard as a runtime safety layer for both inputs and outputs. In real-world GenAI applications, prompt engineering and model selection help, but they are not complete controls. Organizations commonly need defense-in-depth: screen user prompts for abuse or injection patterns, and screen generated completions for harmful, restricted, or policy-violating content before returning them to the user. This aligns with Snowflake best practices for building governed AI applications: apply controls in the application path, not just through prompt design or after-the-fact monitoring. Audit logging can complement guardrails, but it does not replace preventive enforcement.
- A. Correct.
Correct. Cortex Guard is intended to provide safety controls for generative AI interactions by screening content in the request/response flow. In this scenario, the key requirement is to inspect both inbound user prompts and outbound model completions for policy or safety issues such as prompt injection attempts and disallowed generated content. This is the most direct and practical mitigation because it adds runtime guardrails rather than relying solely on the model or prompt wording.
- B. Incorrect.
Incorrect. Expanding the token limit does not meaningfully solve prompt injection or output safety risks. A longer system prompt may provide more instructions, but malicious or adversarial user content can still create unsafe behavior. This option reflects the common misconception that prompt engineering alone is a sufficient security control.
- C. Incorrect.
Incorrect. Logging prompts and responses for later analysis may help with auditing and post-incident review, but it does not prevent unsafe responses from reaching users. The scenario explicitly requires blocking risky prompts and responses before they are delivered, so retrospective analysis is not enough.
- D. Incorrect.
Incorrect. Model quality can improve instruction following, but no model should be assumed immune to prompt injection, policy bypass attempts, or unsafe generations. Best practice is to add explicit guardrails and safety screening rather than depending on model size or capability alone.