SnowPro Specialty: Gen AI Question 281
Single answerLoggingA data platform team has deployed a customer-support assistant in Snowflake using Cortex AISQL functions. The security team now requires an audit trail that helps investigate misuse, monitor quality issues, and support cost reviews. However, the team must minimize exposure of sensitive user content in logs. Which approach BEST meets these requirements?
- A
Enable event logging for the application and store full prompts and model responses for every request so investigators have complete context.
- B
Log structured metadata for each request, such as timestamp, user or service identity, model/function used, request ID, token or credit usage metrics when available, latency, and success or error status; avoid storing raw prompts and responses by default, and only capture redacted samples under controlled access when justified.
- C
Rely only on warehouse query history because it already contains everything needed for GenAI auditing, including safe business-level context and model output quality details.
- D
Disable most logging for GenAI workloads because prompts can contain sensitive data and any retained audit trail creates unacceptable compliance risk.
Show answer and explanation
Correct answer: B
Explanation
For GenAI applications in Snowflake, the strongest logging strategy is to capture structured operational and governance metadata while minimizing retention of raw prompt and completion text. In real deployments, teams typically need request identifiers, caller identity, function or model invoked, timing, status, and usage-related metrics for audit, incident response, and cost monitoring. At the same time, prompts and outputs may contain sensitive data, so storing them by default creates avoidable risk. Best practice is to apply data minimization, use redaction or sampling only when necessary, and restrict access to any sensitive diagnostic records. Snowflake observability sources such as query history can contribute useful information, but they do not replace application-level audit design for GenAI workloads. This question tests the candidate's ability to design logging that satisfies both governance and privacy requirements in a realistic enterprise scenario.
- A. Incorrect.
This is not the best approach because storing full prompts and model outputs for every request increases the risk of exposing sensitive or regulated data. While complete payload logging may seem helpful for investigations, it conflicts with the requirement to minimize sensitive data exposure. A common misconception is that more logging is always better for observability; in practice, GenAI logging should be privacy-aware and follow data minimization principles.
- B. Correct.
This is the best answer because it balances auditability, operational monitoring, and privacy. Structured logs with identity, timing, model/function, correlation IDs, usage, and status support troubleshooting, governance, and chargeback/cost analysis without unnecessarily retaining sensitive prompt or response content. Redacted or sampled content under strict controls is a practical compromise for quality investigations. This aligns with common security and observability best practices for AI workloads: log metadata broadly, restrict content logging, and apply least privilege to any sensitive records.
- C. Incorrect.
This is incorrect because query history is useful for operational visibility, but it is not sufficient by itself for a complete GenAI audit trail. It does not inherently provide all application-level details needed for misuse investigations, such as business request context, correlation IDs across services, prompt handling policy decisions, redaction outcomes, or qualitative issue tracking. Candidates may choose this option because Snowflake query history is powerful, but the scenario specifically requires a broader audit design.
- D. Incorrect.
This is incorrect because eliminating logging reduces the team's ability to investigate misuse, troubleshoot failures, assess quality problems, and review costs. The requirement is to support auditing while minimizing sensitive exposure, not to remove observability altogether. The misconception here is treating privacy and logging as mutually exclusive; in reality, privacy-preserving structured logging is the recommended pattern.