Databricks Generative AI Engineer Associate · Section 5 · 8% of the exam
Select guardrail techniques to protect against malicious user inputs to a Gen AI application
One of the objectives of the Databricks Certified Generative AI Engineer Associate exam, in the section “Governance”. Here is what it covers, the points to remember and a question to try.
What it covers
Governance for a GenAI application means controlling what goes into the knowledge base, what reaches the model and what comes back out. This lesson covers PII masking at ingestion, in Unity Catalog and in AI Gateway; guardrails against prompt injection and abuse; checking the licenses of data sources; and better ways to deal with toxic or sensitive text than asking the model to ignore it.
Points to remember
- Masking replaces sensitive values and lets the request continue; blocking fails the request. Choose Mask when the app must keep answering.
- To meet a latency objective, mask PII once at ingestion (
ai_mask, regex) instead of scanning retrieved context on every request. ai_mask(content, array('person','email',…))is a Public Preview AI Function that returns the text with[MASKED]placeholders.- Unity Catalog column masks (
ALTER TABLE … ALTER COLUMN … SET MASK fn) and ABAC policies mask structured data at query time for every caller, agents included. - AI Gateway (legacy) guardrails (Public Preview): a safety filter (Llama Guard 2-8b) and PII detection with Block, Mask or None, set separately for input and output. Topic moderation and keyword filtering are no longer supported.
Try a question
A team deployed a LangGraph agent with agents.deploy(). The agent calls the pay-per-token endpoint databricks-meta-llama-3-3-70b-instruct. Security requires the AI Gateway (legacy) safety filter and PII masking on every model call, so the team opens the agent endpoint's AI Gateway settings to turn them on. What should they do instead?
- ARedeploy the agent as a custom pyfunc model endpoint, which supports AI Gateway guardrails
- BTurn on topic moderation on the agent endpoint, which replaces the safety filter for agents
- CEnable inference tables on the agent endpoint and remove unsafe responses from the table each night
- DConfigure the safety filter and PII Mask on the Foundation Model APIs endpoint the agent calls, and add input checks inside the agent
Show the answer
D. On the legacy AI Gateway, agent endpoints support payload logging (inference tables) but not AI Guardrails, and custom model endpoints don't support guardrails either. Guardrails are available on Foundation Model APIs and external-model endpoints, so apply them to the LLM endpoint the agent calls, and build checks such as input validation and tool permissions into the agent itself.
Written for practice in the style of the exam: never a question from the real exam.
In the course
The lesson Governing GenAI Apps: Masking, Malicious Input, Licensing and Problematic Text teaches this objective (about 55 minutes), and 23 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.