AI PII Sanitizer

AI License Required

Anonymize high-risk PII categories with custom patternsv3.10+

Configure the plugin to anonymize high-risk PII categories (email, phone, SSN, and credit cards) along with custom patterns for sensitive tokens.

Prerequisites

Environment variables

  • SANITIZER_SERVICE_HOST: The sanitizer service’s host

  • SANITIZER_SERVICE_PORT: The sanitizer service’s port

Set up the plugin

Add this section to your kong.yaml configuration file:

kong.yaml
_format_version: "3.0"
plugins:
  - name: ai-sanitizer
    config:
      anonymize:
      - email
      - phone
      - ssn
      - creditcard
      - custom
      custom_patterns:
      - name: aws_api_key
        regex: AKIA[0-9A-Z]{16}
        score: 0.95
      - name: github_token
        regex: ghp_[A-Za-z0-9]{36}
        score: 0.9
      - name: jwt_token
        regex: eyJ[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+
        score: 0.85
      port: ${{ env "DECK_SANITIZER_SERVICE_PORT" }}
      host: ${{ env "DECK_SANITIZER_SERVICE_HOST" }}
      redact_type: placeholder
      stop_on_error: true
      recover_redacted: false

Did this doc help?

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!