PII
PII rule for guardrails
The pii
rule is used to detect and prevent the exposure of Personally Identifiable Information (PII) in the content generated by the LLM. This rule helps protect sensitive personal data and maintain privacy compliance.
Parameters:
- type:
pii
(specifies the rule type) - value: A string specifying the type(s) of PII to detect, separated by commas (e.g,
person, organization, phone, address
) - expected: Usually set to
fail
to flag when PII is detected in the content - threshold: A number between 0 and 1 representing the confidence level for PII detection (e.g., 0.9 for 90% confidence)
For a practical example of how to implement this rule in a policy, see our Prevent PII Exposure policy example.
Supported PII Types
PII Type | Description |
---|---|
person | Individual’s name |
organization | Company or entity name |
phone_number | Telephone contact information |
address | Physical location details |
passport_number | Unique identifier for travel documents |
email | Electronic mail address |
credit_card_number | Payment card identifier |
social_security_number | Government-issued identification number |
health_insurance_id_number | Medical insurance identifier |
date_of_birth | Individual’s birth date |
mobile_phone_number | Cellular contact information |
bank_account_number | Financial account identifier |
medication | Prescribed drug information |
cpf | Brazilian tax identification number |
driver_license_number | Driving permit identifier |
tax_identification_number | Government-issued tax ID |
medical_condition | Health status information |
identity_card_number | National ID card identifier |
national_id_number | Government-issued personal identifier |
ip_address | Internet Protocol address |
iban | International Bank Account Number |
credit_card_expiration_date | Payment card validity period |
username | Online account identifier |
registration_number | Various registration identifiers |
student_id_number | Educational institution identifier |
insurance_number | Various insurance policy identifiers |
flight_number | Air travel identifier |
landline_phone_number | Fixed-line telephone number |
blood_type | Medical blood classification |
cvv | Card Verification Value for payments |
reservation_number | Booking identifier |
digital_signature | Electronic authentication method |
social_media_handle | Online platform username |
license_plate_number | Vehicle registration identifier |
cnpj | Brazilian company tax identifier |
postal_code | Mailing address identifier |
serial_number | Product or device identifier |
vehicle_registration_number | Car registration identifier |
credit_card_brand | Payment card issuer |
fax_number | Facsimile contact information |
visa_number | Travel authorization identifier |
insurance_company | Name of insurance provider |
identity_document_number | Various official ID numbers |
transaction_number | Financial or business operation identifier |
national_health_insurance_number | Healthcare system identifier |
cvc | Card Verification Code for payments |
birth_certificate_number | Birth record identifier |
train_ticket_number | Rail travel booking identifier |
passport_expiration_date | Travel document validity period |