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 TypeDescription
personIndividual’s name
organizationCompany or entity name
phone_numberTelephone contact information
addressPhysical location details
passport_numberUnique identifier for travel documents
emailElectronic mail address
credit_card_numberPayment card identifier
social_security_numberGovernment-issued identification number
health_insurance_id_numberMedical insurance identifier
date_of_birthIndividual’s birth date
mobile_phone_numberCellular contact information
bank_account_numberFinancial account identifier
medicationPrescribed drug information
cpfBrazilian tax identification number
driver_license_numberDriving permit identifier
tax_identification_numberGovernment-issued tax ID
medical_conditionHealth status information
identity_card_numberNational ID card identifier
national_id_numberGovernment-issued personal identifier
ip_addressInternet Protocol address
ibanInternational Bank Account Number
credit_card_expiration_datePayment card validity period
usernameOnline account identifier
registration_numberVarious registration identifiers
student_id_numberEducational institution identifier
insurance_numberVarious insurance policy identifiers
flight_numberAir travel identifier
landline_phone_numberFixed-line telephone number
blood_typeMedical blood classification
cvvCard Verification Value for payments
reservation_numberBooking identifier
digital_signatureElectronic authentication method
social_media_handleOnline platform username
license_plate_numberVehicle registration identifier
cnpjBrazilian company tax identifier
postal_codeMailing address identifier
serial_numberProduct or device identifier
vehicle_registration_numberCar registration identifier
credit_card_brandPayment card issuer
fax_numberFacsimile contact information
visa_numberTravel authorization identifier
insurance_companyName of insurance provider
identity_document_numberVarious official ID numbers
transaction_numberFinancial or business operation identifier
national_health_insurance_numberHealthcare system identifier
cvcCard Verification Code for payments
birth_certificate_numberBirth record identifier
train_ticket_numberRail travel booking identifier
passport_expiration_dateTravel document validity period