PII Leakage

Stopping personally identifiable information from entering or leaving your LLM application

Blocking personally identifiable information (PII) from flowing in and out of LLM systems is a common requirement. Limiting PII exposure is good practice in general, but the two scenarios that most often drive teams to enforce it are:

  1. PII in the prompt. If your application uses a public or externally hosted LLM, everything sent to that model may be retained, used for training, or exposed across contexts. You want to make sure users are not including their own or others' PII in prompts.
  2. PII in the response. Teams add data containing PII to LLMs as context (through retrieval or fine-tuning) so the model can answer more questions. But the end user may not have permission to see that PII, and the application should not return it to them.

Types of PII

PII is information that can identify an individual on its own or in combination with other data. It includes:

  • Direct identifiers that uniquely identify a person, such as an SSN, passport number, or phone number.
  • Quasi-identifiers that identify a person when combined, such as name and date of birth.

The GenAI Engine approach

The PII rule checks prompts and responses with predefined recognizers that combine named entity recognition, regular expressions, rule-based logic, and checksums where they apply (for example, credit card and IBAN validation). The engine uses Microsoft Presidio for pattern and checksum recognizers and the GLiNER PII model for entity recognition. Both run locally inside the engine; no external LLM is called.

The entities below are detected out of the box, with options to customize which ones are enforced.

Currently supported entities:

EntityAPI valueDescriptionExample
Credit card numberCREDIT_CARDUsually 15 or 16 digits, up to 19.378282246310005
Crypto wallet addressCRYPTOA Bitcoin address, typically 26 to 35 alphanumeric characters.1Lbcfr7sAHTD9CgdQo3HTMTkV8LK4ZnX71
Date or timeDATE_TIMEA specific date, past or present.March 5th, 2024, 03/05/2024
Email addressEMAIL_ADDRESSAn address used to send or receive email.[email protected]
IBANIBAN_CODEAn international bank account identifier. See iban.com.GB33BUKB20201555555555
IP addressIP_ADDRESSAn IPv4 or IPv6 address.138.137.11.243
NRPNRPA nationality, religious, or political group.Catholic, Democrat
LocationLOCATIONA politically or geographically defined place.New York, NY
PersonPERSONA person's full name.Jane Doe
Phone numberPHONE_NUMBERA telephone number.646-123-4567
Medical licenseMEDICAL_LICENSECommon medical license number formats.
URLURLA web address.https://www.arthur.ai/, google.com
US bank numberUS_BANK_NUMBERA US bank account number.23461679
US driver's licenseUS_DRIVER_LICENSEA US driver's license number. Formats at ntsi.com.A1234567
US ITINUS_ITINAn Individual Taxpayer Identification Number. Begins with 9 and has 7 or 8 in the fourth digit.9XX-7X-XXXX
US passportUS_PASSPORTA 9-digit US passport number.770022534
US SSNUS_SSNA 9-digit Social Security number. See the SSA.123-45-6789

Customization

On top of the out-of-the-box rule, you can configure:

  • disabled_pii_entities: entity types to leave out of evaluation
  • allow_list: specific string values that should never be flagged even if their entity type is enabled, such as your company's own domain

For identifiers unique to your organization, such as internal account IDs, create a regex rule. Contact Arthur Support if you need coverage for additional PII entity types.

Rule results

When PII is found, the result lists every matched span with its entity type and the recognizer's confidence.

{
  "id": "7a1c0b3e-5c2d-4f8e-9a1b-2c3d4e5f6a7b",
  "name": "PII",
  "rule_type": "PIIDataRule",
  "scope": "default",
  "result": "Fail",
  "latency_ms": 85,
  "details": {
    "message": "PII found in data: EMAIL_ADDRESS, US_SSN",
    "pii_entities": [
      { "entity": "EMAIL_ADDRESS", "span": "[email protected]", "confidence": 1.0 },
      { "entity": "US_SSN", "span": "123-45-6789", "confidence": 0.85 }
    ]
  }
}

Requirements

The PII rule runs on validate_prompt, validate_response, or both. We generally recommend checking both, though some use cases only need one.

PromptResponseContext needed?
PII✅✅

Governance

PII checks are usually the first rules teams enable when they adopt LLMs. Configuring them as default rules in the GenAI Engine gives you one place to see and manage which PII patterns are blocked across the organization, globally or per use case, rather than re-implementing the check in each application.

Configuration

No additional configuration is required for the default PII rule. The rule type is PIIDataRule, and apply_to_prompt and apply_to_response can each be true or false. See the Rule Configuration Guide for the request body, the optional disabled_pii_entities and allow_list settings, and enabling or disabling the rule by default or per task.


Did this page help you?