Prerequisites
- Control Plane
- YAML
- Golf Control Plane account with Admin role
- MCP server registered in Control Plane
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
Enable PII scrubbing
- Control Plane
- YAML
Organization defaults:
- Go to Settings > Policies
- Find the PII Protection section
- Enable PII Scrubbing
- Configure default sensitive field names
- Click Save
- Go to Gateways > select a gateway > Policies
- Find the PII Protection section
- Add gateway-specific sensitive fields
- Click Save
- Go to MCP Servers > select a server
- Open the Policies tab > PII
- Enable PII Protection
- Add custom sensitive field names
- 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:- Control Plane
- YAML
- Go to the appropriate level (Settings, Gateway, or Server > Policies)
- Find the PII Protection section
- Click Add Custom Rule
- Enter the regex pattern and select the masking method
- Click Save
Configure per-server scrubbing
Different servers can have different scrubbing settings:- Control Plane
- YAML
Configure each server individually through MCP Servers > server > Policies > PII.
Verify scrubbing is active
- In Admin Portal, go to Logs
- Select a session and find a request containing PII
- In the security pipeline, look for the PII Scrubbed step
- 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_idtimestamp,event_type,methoduser.email,user.sub(for compliance)
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
Related guides
- Set Up Server RBAC - Access control
- Golf Gateway Overview - Policy engine architecture