Skip to main content
Analyzes AI requests for personally identifiable information (PII) using Microsoft Presidio and blocks requests containing sensitive data.

Overview

The Detection Plugin scans incoming AI requests for PII entities and rejects requests when sensitive information is detected. It provides granular control over what types of PII to detect, confidence thresholds, and custom rejection messages.

Supported PII Types

The plugin can detect 30+ entity types across multiple regions:

Personal Information

  • PERSON - Person names
  • EMAIL_ADDRESS - Email addresses
  • PHONE_NUMBER - Phone numbers
  • DATE_TIME - Dates and times
  • LOCATION - Geographic locations
  • URL - Web addresses
  • IP_ADDRESS - IP addresses

Financial

  • CREDIT_CARD - Credit card numbers
  • CRYPTO - Cryptocurrency wallet addresses
  • IBAN_CODE - International bank account numbers

United States

  • US_SSN - Social Security Numbers
  • US_DRIVER_LICENSE - Driver’s license numbers
  • US_PASSPORT - Passport numbers
  • US_BANK_NUMBER - Bank account numbers
  • US_ITIN - Individual Taxpayer Identification Numbers

International

  • UK_NHS - UK National Health Service numbers
  • SG_NRIC_FIN - Singapore NRIC/FIN numbers
  • AU_ABN, AU_ACN, AU_TFN, AU_MEDICARE - Australian identifiers
  • IN_PAN, IN_AADHAAR, IN_VEHICLE_REGISTRATION - Indian identifiers
  • ES_NIF - Spanish tax identification
  • IT_FISCAL_CODE, IT_DRIVER_LICENSE, IT_VAT_CODE, IT_PASSPORT, IT_IDENTITY_CARD - Italian identifiers

Healthcare

  • MEDICAL_LICENSE - Medical license numbers
  • NRP - Medical prescriber numbers

Configuration

Basic Settings

entities (optional, array of strings) List of PII entity types to detect. If not specified, all supported entities are detected. language (string, default: "en") Language code for text analysis (e.g., "en", "es", "de"). score_threshold (number, default: 0.5) Minimum confidence score (0-1) required to flag text as PII. Lower values (e.g., 0.4) catch more PII but may increase false positives. Higher values (e.g., 0.7) reduce false positives but may miss some PII.

Rejection Behavior

reject_on_detection (boolean, default: true) Whether to reject requests when PII is detected. Set to false to allow requests but log PII detection for monitoring. rejection_message (string) Custom message returned when a request is rejected. Default: "Request contains personally identifiable information and cannot be processed."

Advanced Detection

allow_list (optional, array of strings) Terms/patterns that should NOT be flagged as PII, even if they match detection patterns (e.g., ["[email protected]", "555-0000"]). deny_list (optional, array of strings) Terms/patterns that should ALWAYS be flagged as PII, regardless of detection confidence (e.g., ["confidential", "internal-use-only"]). context (optional, array of strings) Additional context words to improve detection accuracy (e.g., ["patient", "medical", "doctor"]). return_decision_process (boolean, default: false) Include detailed analysis explanation in debug output to understand why text was flagged.

Example Configuration

Behavior

  • Fail-open: If the plugin encounters an error, requests are allowed to proceed
  • Multi-message support: Analyzes all messages in the request
  • Debug output: Returns detailed detection information when enabled in Gateway UI

Configuration Schema


Supported Phases

  • Request Phase: Supports processing during the REQUEST phase
  • Response Phase: Supports processing during the RESPONSE phase
  • Log Phase: Supports processing during the LOG phase