#
Unify AI
Logo
Guardrails
Logo
PII Masking

PII Masking

Logo

3 mins READ

PII Masking in AI Agent allows you to filter out sensitive data from both user inputs and LLM responses based on defined patterns. This feature is crucial for maintaining data privacy and compliance, especially when dealing with personal identifiers such as Social Security numbers, phone numbers, or employee IDs.

By configuring PII Masking rules, you can choose whether the sensitive data should be blocked entirely or masked, protecting confidential information while allowing the AI agent to continue operating smoothly.

Consider the following example of a Banking Agent for better understanding.

Reference Content: Payment due for Credit card number 4111-1111-1111-1111 is $1000
While accessing the knowledge for user query regarding the bill amount,
Agent sees: "Payment due for Credit card number 4111-****-****-1111 is $1000" 

How to Configure PII Masking in your AI Agent?

  1. From the Guardrails section in your AI Agents Dashboard, click “PII Masking”.

    Image
    Image
  2. Click the “+ Add Pattern” button to define a new regex pattern for identifying specific types of sensitive information such as Social Security Numbers, phone numbers, or other data unique to your use case.

    Image
    Image

  3. Choose the appropriate guardrail behavior for each pattern:

    • Block: Prevents the sensitive information from being processed or displayed entirely. 

    • Mask: Replaces the sensitive data with asterisks or other placeholders to ensure privacy without blocking the flow of conversation.

      Image
      Image

  4. You can view and manage your defined patterns under the Regex Pattern section. You can edit or remove patterns as needed by clicking on the three-dot menu.

    Image
    Image

By configuring PII Masking, your AI agent helps maintain privacy and compliance while ensuring that sensitive data is not exposed during interactions.