PII scrubbing removes or masks personally identifiable information from generated or transmitted content. In an AI assistant, it belongs at the output boundary: the system filters the model response before forwarding it to users or other audiences. section 10.7 section 6.9
Treat scrubbing as an execution policy rather than a standalone moderation feature. Output guardrails form one inspection point in a broader flow that also validates inputs, tool arguments, external responses, and actions. section 6.9
A production integration should make the filtering decision visible:
- Run an output filter against the raw assistant response before returning content. section 10.7
- Return the filtered content instead of the unmodified response. section 10.7
- Record applied filters in a safety-flags field so the frontend can indicate that safety modifications occurred. section 10.7
- Keep safety constraints declarative where possible, allowing compliance teams to edit policies while developers handle violation errors. section 6.9
Preventing accidental email disclosure
An assistant generates a response containing a user's email address, and that response is forwarded to a broader audience. The PII redaction policy catches the address, modifies the response, and exposes the applied filter so the interface can display a safety indicator rather than silently changing the text. section 10.7
Figure 10.7 Adding guardrails. Safety policies validate inputs, tool arguments, and outputs at multiple points in the request flow.

Use the guardrail-flow diagram to locate PII scrubbing at the output boundary alongside input and tool-action checks. section 10.7

