Skip to content

Lightrun PII Redaction best practices🔗

To protect user privacy and improve data security, prevent Personally Identifiable Information (PII) from appearing in Snapshots or Dynamic Logs. PII can include names, email addresses, credit card data, passwords, phone numbers, and social security numbers.

When implementing PII redaction with Lightrun, we recommend using the following best practices to reduce the risk of exposing sensitive data through Lightrun.

Restrict administrative access🔗

Ensure that only trusted users in your organization have access to specific roles and permissions in Lightrun. Only users with role_manager or System administrator permissions can specify or remove PII redaction patterns from Lightrun. For more information on how to manage users and user permissions, see Manage Users and Roles.

Use layered redaction controls🔗

Use customer-configured PII patterns for organization-specific field names, identifiers, and deterministic data formats. If AI Privacy Filter is available for your deployment, enable it as an additional context-aware detection layer.

AI Privacy Filter does not replace explicit rules. Its detection is limited to the model's trained categories and can produce false positives or false negatives.

Apply case insensitivity🔗

Patterns are initially set as case-insensitive by default, and it is advisable to retain this default setting. Default code identifiers, such as variable names, classes, and packages, are inherently case-insensitive. Consequently, redaction will apply to all variations, whether uppercase or lowercase, of the identifier.

Update PII Redaction filters on existing agents🔗

Lightrun agents fetch updated PII filters during startup. To apply the new filters on your existing agents, simply restart them.

Use patterns from Lightrun's dedicated patterns library🔗

To reduce the risk of errors due to patterns containing incorrect syntax compared to the time consuming process of manual creation, Lightrun provides a dedicated Regex Patterns library containing a set of predefined common PII patterns that conform with RE2 Google-compliant Regex expressions. In the Patterns library, the patterns are grouped according to these main categories: Credit Cards, Financials, General, and Network. These categories help streamline the process of locating specific PII patterns based on their characteristics. For more information, see Configure PII Redaction using predefined patterns.

Test redaction with representative data🔗

Validate redaction against representative application data before relying on it in production. Test expected sensitive values, organization-specific identifiers, multiple languages, and values that must remain visible for debugging.

Review both missed detections and unnecessary redaction. A privacy filter is a data-minimization control, not an anonymization or compliance guarantee.


Last update: November 24, 2026