Skip to main content
Version: Next

Data Sanitation Flow

The Data Sanitation Flow scrubs sensitive information from certain fields in an API request. It provides two approaches for configuration: either by specifying entities to inspect (whitelist-style) or entities to exclude (blacklist-style). This processor is ideal for ensuring that sensitive data such as credit card numbers, phone numbers, and email addresses are not passed downstream.

Flow Diagram


Scenarios

  1. Sensitive Data Removal: Remove sensitive data from API requests before they are sent to the provider.

Flow Components


Flow Example

This is an example of a fully configured Data Sanitation Flow removes credit card and email information from requests to OpenAI.

/etc/lunar-proxy/flows/flow.yaml
name: DataSanitationFlow

filter:
url: "api.openai.com/*"

processors:
DataSanitation:
processor: DataSanitation
parameters:
- key: blocklisted_entities
value:
- CreditCard
- Email

flow:
request:
- from:
stream:
name: globalStream
at: start
to:
processor:
name: DataSanitation
- from:
processor:
name: DataSanitation
to:
stream:
name: globalStream
at: end
response:
- from:
stream:
name: globalStream
at: start
to:
stream:
name: globalStream
at: end