[REDACTED]. A request-stage rewrite can redact SSNs in LLM messages.
1. Classify sensitive columns
Deploy a Data Discovery Satellite and schedule scans for each resource. Discovery applies label matchers during scans. Editing a matcher alone does not reclassify columns. Built-in labels includesocial_security_number and password.
Prompt labels use column metadata and up to 10 sampled values. To generate them, you need an LLM classification backend and a native user with SELECT permission.
Review labels in Data Inventory, then lock columns you classified manually.
2. Mask columns by label
This response-stage policy replaces labeled SSNs and passwords with[REDACTED]:
3. Test, then activate
Create the policy in Draft while you review the Rego. Set it to Dry-run to log matches. Review Logs for the expected policy and labeled columns. Then set the policy to Active and verify a test query returns masked values. Dry-run does not enforce policy actions, so use an active test query to confirm masking.4. Redact SSNs from LLM requests
For LLM resources, use a request-stage rewrite. This example replaces dashed US SSNs in text and tool results:input.http.body before forwarding the request.
The example matches dashed SSNs only. Adjust the pattern for your formats.
Start the policy in Dry-run, review the logs, and then activate it.
Next Steps
Mask Action
Review supported types and subtypes
Policy Examples
Explore label-based and request-stage policies