What you will be able to do
- Identify the paths where source-table masks no longer protect data
- Choose between redacting and blocking sensitive data in model requests
- Arrange PII guardrails so they add as little latency as possible
1.Masks protect queries, not copies
A column mask only works when a query reads the protected table. Once data moves into another store, the mask doesn't go with it. A GenAI pipeline creates such copies all the time. Assume a column mask protects the PII in a source table. This page covers the places that mask no longer reaches.
The vector index is the first gap. It syncs every row from the source table, ignoring both filters and masks. The fix happens at build time: leave the masked columns out of the index with the columns-to-sync setting, so the sensitive values never reach it. Index setup itself belongs to creating a Vector Search index.
Exempt principals are the second gap. An identity listed in a policy's EXCEPT clause sees unfiltered, unmasked data, and ETL service principals are usually the ones exempted. Anything such a principal writes out, such as a cloned table, a chunked copy for RAG or a feature table, holds raw values with no policy attached. Exempt only trusted pipeline identities, and treat their outputs as sensitive data that needs its own controls. Cloning is a concrete case. Deep and shallow clones of ABAC-protected tables only work for a principal that is exempt from every policy on the table.
CREATE POLICY mask_pii
ON CATALOG prod
COLUMN MASK prod.governance.mask_value
TO `account users`
EXCEPT `etl_service_principal`
FOR TABLES
MATCH COLUMNS
has_tag_value('pii', 'ssn') AS ssn
ON COLUMN ssn;LLM requests are the third gap, and the widest. Users type contact details straight into a chat, and those never touch a governed table. Here the mask has to run in the gateway, on the request and response themselves.
Checkpoint 1 of 6· Fill the gap
This policy has to mask SSN-tagged columns for analysts while letting the ETL service principal clone the table. Which keyword completes it?
CREATE POLICY mask_pii
ON CATALOG prod
COLUMN MASK prod.governance.mask_value
TO `account users`
? `etl_service_principal`
FOR TABLES
MATCH COLUMNS
has_tag_value('pii', 'ssn') AS ssn
ON COLUMN ssn;EXCEPT exempts the ETL principal from the policy, so it sees unmasked data and can clone the table. That also means anything it writes out holds raw SSNs and needs its own controls.
Source: docs.databricks.comCheckpoint 2 of 6· Check yourself
A RAG retriever will query a Vector Search index built from a table whose email column has an ABAC column mask. How do you keep emails out of the retriever's results?
The index syncs every source row and applies no row filters or column masks, so the only safeguard is to keep the masked column out of the index when you build it.
“For tables with column masks, you can exclude masked columns from the index using the columns to sync setting.”Source: docs.databricks.com
Sources1
2.Sanitizing versus blocking PII in model traffic
AI Gateway PII guardrails offer two actions, and the choice decides whether the request goes through. The legacy endpoint setting is literally "Block or Mask". Newer Unity Catalog service policies call the masking action redact, and exam questions call it a sanitizing guardrail.
| Action | What happens on a match | Use when |
|---|---|---|
| Redact (sanitize / mask) | Each matched value is replaced with a placeholder such as [US_SSN]; the model gets the redacted request and the caller gets the redacted response | The request is legitimate and should still be answered, just without the sensitive value |
| Block | The interaction is denied; on a model service the caller gets an HTTP 200 whose assistant turn names the blocking policy, plus a databricks_service_policy object with the reason | Any appearance of the data means the request must not be served |
Take a support chatbot where a customer writes "call me back on my mobile, the order never arrived". Blocking would refuse a valid ticket. Redacting sends the model "call me back on [PHONE_NUMBER]…" and the conversation carries on. Two lookalike options don't meet the goal. A hallucination check runs on the response, so it never stops the user's number from reaching the model. A prompt telling the model not to repeat contact details still hands it those details. Prompt injection and jailbreak defences are separate guardrails, covered in guarding against malicious inputs.
The two actions are tuned in opposite directions. Redaction is optimized for recall, because a missed value is worse than an over-redaction. Blocking is optimized for precision, so for bare digit runs such as SSNs it requires a checksum or a nearby context word before it fires.
Checkpoint 3 of 6· Check yourself
Your model serving endpoint has a PII guardrail set to Block. A user sends: "My SSN is 123-45-6789, why was my claim denied?" What happens to this request?
Block denies the whole interaction. Instead of an error, the caller gets an HTTP 200 whose assistant turn names the blocking policy. Swapping the value for a placeholder and forwarding the request is what Redact does, not Block.
“Block (all services): Databricks denies the interaction. On a model or model provider service, instead of an error the caller receives a successful (HTTP 200)”Source: docs.databricks.com
Checkpoint 4 of 6· Exam question
A customer-support chatbot serving latency-sensitive users occasionally receives inputs containing phone numbers or email addresses that must never reach the underlying LLM. The team also does not want legitimate support requests to fail outright just because they mention contact details. Which AI Gateway guardrail configuration meets this objective?
Correct answer: A — Enable the PII guardrail on incoming requests in masking mode; detected phone numbers and email addresses are replaced with placeholder tokens before the model call.
- A. Masking mode on the input side swaps the detected phone numbers and email addresses for placeholders before the request is forwarded. The raw values never reach the LLM, and the support request still completes.
- B. Blocking mode does keep the raw values away from the model, but it ends the request with an HTTP 400 error. Support requests that merely mention contact details would then fail outright, which the team wants to avoid.
- C. A PII guardrail on the response side only cleans what the model returns. The user's original phone number or email address has already been sent to the LLM by then, so the main requirement is not met.
- D. A custom prompt asks the model to behave, but the raw phone numbers and email addresses are still sent to it. It also depends on the model complying, so it does not guarantee the data stays away from the LLM.
3.Keeping PII guardrails off the latency budget
Guardrails come in two kinds with very different costs. Built-in sensitive data detection is deterministic: it uses regex, checksums and context keywords, with no evaluator model, and adds well under 50 ms even on a 100-turn conversation. Unsafe-content, jailbreak, hallucination and custom LLM-judge checks are model-backed and slow. Databricks runs those model-backed blocking checks in parallel, so stacking several doesn't multiply their latency.
The blocking checks already run in parallel, so changing their order doesn't shorten the wait. A longer timeout only lets a slow check run longer. One prompt over the whole history is still a model-backed check, and it now has more content to judge. What actually lowers latency is a faster evaluator model behind each check and fewer checks in the phase.
Pattern detection can't recognize names, locations or organizations. Those need a model. The usual pattern layers the two kinds: run deterministic detection at a lower rank to redact structured identifiers cheaply, then run an LLM judge at a higher rank on the already-redacted content, telling it to ignore placeholders such as [US_SSN]. Rank sets the order. The lowest rank runs first on the request and last on the response.
Checkpoint 5 of 6· Check yourself
For a support assistant, the gateway has to catch SSNs, phone numbers and customers' first names in requests while adding as little latency as possible. Which guardrail setup fits?
Deterministic detection deals with structured identifiers in well under 50 ms but can't recognize names, so only the names need the slower model-backed judge. Running the judge after the redaction means it sees placeholders such as [US_SSN] instead of the raw values.
“Keep Sensitive Data Detection at a lower rank to redact structured data.”Source: docs.databricks.com
Checkpoint 6 of 6· Exam question
An engineering team notices that adding several custom guardrails to a single execution phase of their AI Gateway route adds significant latency to every request. Which combination of changes would reduce that latency while keeping the necessary guardrails in place?
Correct answer: A — Select a low-latency evaluator endpoint for the guardrail checks and keep the phase within three blocking guardrails plus one sanitizing guardrail.
- A. A faster evaluator endpoint lowers the time each guardrail call takes. Staying within the per-phase maximum of three blocking guardrails plus one sanitizing guardrail limits how many checks add to the phase's latency. The necessary guardrails stay in place, so both changes meet the goal.
- B. Sequencing the sanitizing step ahead of the blocking guardrails does not make any individual check faster, and the blocking guardrails no longer evaluate every request. Content the sanitizing step does not flag would skip the blocking checks, so the necessary protections are no longer reliably in place.
- C. A longer timeout only raises the maximum time a slow guardrail call may take before it fails. It does not shorten the calls, and leaving the guardrail set unchanged keeps the same number of checks in the phase. Latency is not reduced.
- D. Folding the blocking guardrails into one prompt-based guardrail that reads the full conversation history increases the content evaluated per call, which tends to add latency rather than remove it. It also replaces the specific detection each blocking guardrail provided, so the necessary guardrails are not kept.
Sources
(5)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“ABAC policies on a source table don't apply to AI Search indexes created from that table.”
↩︎ Masks protect queries, not copies“Exempted principals see unfiltered, unmasked data.”
↩︎ Masks protect queries, not copies“Only exempt trusted identities such as service principals used for ETL or pipeline workloads.”
↩︎ Masks protect queries, not copies“For tables with column masks, you can exclude masked columns from the index using the columns to sync setting.”
↩︎ Exam trap 1“For tables with column masks, you can exclude masked columns from the index using the columns to sync setting.”
↩︎ Checkpoint - 2.
“Select to Block or Mask PII data such as names, addresses, credit card numbers”
↩︎ Sanitizing versus blocking PII in model traffic - 3.https://docs.databricks.com/aws/en/data-governance/unity-catalog/service-policies/detect-sensitive-dataOfficial docs
“the model receives the redacted request and the caller receives the redacted response.”
↩︎ Sanitizing versus blocking PII in model traffic“instead of an error the caller receives a successful (HTTP 200) response whose assistant turn names the service policy that blocked”
↩︎ Sanitizing versus blocking PII in model traffic“since a missed value is worse than an over-redaction, so it is optimized for recall.”
↩︎ Sanitizing versus blocking PII in model traffic“It adds well under 50 ms to a request, even on a large (100-turn) conversation.”
↩︎ Keeping PII guardrails off the latency budget“Free-text entities such as names, locations, or organizations are not supported.”
↩︎ Keeping PII guardrails off the latency budget“Add the LLM judge at a higher rank so it evaluates the already-redacted content.”
↩︎ Keeping PII guardrails off the latency budget“Databricks replaces each matched value with a placeholder token, such as [US_SSN], and forwards the rewritten content.”
↩︎ Exam trap 2“Block (all services): Databricks denies the interaction. On a model or model provider service, instead of an error the caller receives a successful (HTTP 200)”
↩︎ Checkpoint“Keep Sensitive Data Detection at a lower rank to redact structured data.”
↩︎ Checkpoint - 4.
“system.ai.block_hallucination: denies responses that contain hallucinated content.”
↩︎ Sanitizing versus blocking PII in model traffic“Because Databricks parallelizes the slow model-backed checks, stacking several blocking guardrails on a service doesn't multiply their latency.”
↩︎ Keeping PII guardrails off the latency budget“Unlike the others, it's deterministic (pattern-based, no evaluator model) and can redact rather than only block.”
↩︎ Keeping PII guardrails off the latency budget - 5.https://docs.databricks.com/aws/en/data-governance/unity-catalog/service-policies/create-service-policyOfficial docs
“The lowest rank runs first on the request and last on the response.”
↩︎ Keeping PII guardrails off the latency budget