Skip to main content
Configure PII scrubbing to automatically redact sensitive information from MCP responses before they’re logged or returned to clients.

Prerequisites

Understanding the 3-layer policy hierarchy

PII scrubbing follows the same 3-layer hierarchy as other Golf Gateway policies: Policy Merge Rules:
  • Sensitive fields: Combined from ALL layers (union)
  • Whitelist fields: Combined from ALL layers (union)
  • Custom rules: Combined from ALL layers (union)
  • Custom entities: Combined from ALL layers (union)
  • Enabled flag: True if ANY layer enables scrubbing
Set organization-wide defaults for common PII types, then add server-specific rules for domain-specific data.

Enable PII scrubbing

Organization defaults:
  1. Go to Settings > Policies
  2. Find the PII Protection section
  3. Enable PII Scrubbing
  4. Configure default sensitive field names
  5. Click Save
Gateway overrides:
  1. Go to Gateways > select a gateway > Policies
  2. Find the PII Protection section
  3. Add gateway-specific sensitive fields
  4. Click Save
Server-level configuration:
  1. Go to MCP Servers > select a server
  2. Open the Policies tab > PII
  3. Enable PII Protection
  4. Add custom sensitive field names
  5. Click Save

Built-in PII detection

Golf Gateway detects many entity types by default. Common examples include: Additional supported types include PERSON, LOCATION, ORGANIZATION (via GLiNER), US_DRIVER_LICENSE, US_PASSPORT, JWT_TOKEN, and more.

Add custom scrubbing rules

For patterns not covered by built-in detection, add custom rules:
  1. Go to the appropriate level (Settings, Gateway, or Server > Policies)
  2. Find the PII Protection section
  3. Click Add Custom Rule
  4. Enter the regex pattern and select the masking method
  5. Click Save
Masking methods:

Configure per-server scrubbing

Different servers can have different scrubbing settings:
Configure each server individually through MCP Servers > server > Policies > PII.

Verify scrubbing is active

  1. In Admin Portal, go to Logs
  2. Select a session and find a request containing PII
  3. In the security pipeline, look for the PII Scrubbed step
  4. Verify sensitive data shows entity-specific placeholders like [EMAIL], [SSN], or [MASKED]

Fields never scrubbed

These fields are preserved for audit purposes and are never scrubbed regardless of configuration:
  • connection_id, session_id, correlation_id
  • timestamp, event_type, method
  • user.email, user.sub (for compliance)
You can also configure additional fields to be excluded from scrubbing using whitelist_fields at the gateway or server level. This is useful for protecting operational data like file paths, tool names, or cursor tokens from accidental scrubbing.

Troubleshooting

  • PII not being detected: Verify scrubbing is enabled at all policy levels (org, gateway, server)
  • Custom pattern not matching: Test your regex pattern - Golf Gateway uses Python regex syntax
  • Too much data being scrubbed: Check if multiple layers are adding overlapping rules