Skip to main content
Feedback

Data sanitation policy

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

Prerequisites

  • Active LLM Gateway instance. Refer to Installation.
  • Familiarity with Gateway policy structure and configuration template.

Scenarios

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

Gateway policy components

Data Sanitation Processor

Gateway policy example

This is an example of a fully configured Data Sanitation Gateway policy that 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

On this Page