Data Sanitation Flow
The Data Sanitation Flow scrubs values from certain fields in an API request.
Scenarios
- Sensitive Data Removal: Remove sensitive data from API requests before they are sent to the provider.
Flow Configuration Template
/etc/lunar-proxy/flows/flow.yaml
name: DataSanitationFlow
filter:
url: <URLPattern>
processors:
DataSanitation:
processor: DataSanitation
- key: blocklisted_entities # Set the list of fields for scrubbing
value:
- <FieldToInspect>
- <FieldToInspect>
- key: ignored_entities # Set the list of fields to be excluded from scrubbing
value:
- <FieldToExclude>
- <FieldToExclude>
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
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