Entity Types
Reference table of all 44 EntityType values supported by @secured-ai/core.
Overview
@secured-ai/core defines 44 entity types as a TypeScript string union. Every detected entity is assigned one of these types, and you use them when configuring replacement pools, writing custom patterns, and filtering results.
import type { EntityType } from '@secured-ai/core'The types are split into two groups:
- Sensitive types (29) — treated as PII by
obfuscate()and included insensitiveEntities - Informational types (15) — detected by
detect()but not automatically obfuscated
Sensitive types
These 29 types are classified as sensitive. obfuscate() will replace any entity of these types with a fake value.
| Type | Description | Example | Detecting engine(s) |
|---|---|---|---|
PERSON | Full name of a natural person | Jane Doe | NLP, ML |
EMAIL | Email address | jane@example.com | Regex |
PHONE | Phone number (various formats) | 555-867-5309 | Regex |
SSN | US Social Security Number | 123-45-6789 | Regex |
CREDIT_CARD | Credit or debit card number | 4111 1111 1111 1111 | Regex |
CVV | Card verification value | 427 | Regex |
ORG | Organisation or company name | Acme Corp | NLP, ML |
GPE | Geopolitical entity (city, country, state) | New York | NLP, ML |
LOC | Non-GPE location (building, landmark) | Golden Gate Bridge | NLP, ML |
ADDRESS | Street address | 123 Main St, Springfield | Regex |
ZIP_CODE | Postal code | 90210 | Regex |
DATE | Calendar date | January 15, 1985 | Regex, NLP |
TAX_ID | Tax identification number | 12-3456789 | Regex |
ACCOUNT_NUMBER | Bank account number | 000123456789 | Regex |
INVOICE_NUMBER | Invoice or billing reference | INV-2024-0042 | Regex |
REFERENCE_ID | Generic reference identifier | REF-US-1234 | Regex, Custom |
MEDICAL_ID | Medical record number | MRN-00123456 | Regex |
INSURANCE_ID | Insurance policy number | POL-4521-ABC | Regex |
CASE_NUMBER | Legal or support case number | CASE-2024-00789 | Regex |
LEGAL_CITATION | Legal case citation | Brown v. Board of Education | Regex |
DRIVER_LICENSE | Driver's license number | DL-1234567 | Regex |
PASSPORT | Passport number | A12345678 | Regex |
IP_ADDRESS | IPv4 or IPv6 address | 192.168.1.1 | Regex |
MAC_ADDRESS | Network hardware address | 00:1A:2B:3C:4D:5E | Regex |
URL | Web URL | https://example.com/user/123 | Regex |
ROUTING_NUMBER | US bank routing number | 021000021 | Regex |
IBAN | International Bank Account Number | GB29NWBK60161331926819 | Regex |
EIN | Employer Identification Number | 12-3456789 | Regex |
Informational types
These 15 types are detected by detect() and appear in result.entities, but are not in sensitiveEntities and are not replaced by obfuscate() by default.
| Type | Description | Example | Detecting engine(s) |
|---|---|---|---|
CREDIT_CARD_EXPIRY | Card expiry date | 12/28 | Regex |
TIME | Time of day | 3:45 PM | Regex |
NORP | Nationality, religion, or political group | American, Buddhist | NLP |
FAC | Facility name | JFK Airport | NLP |
PRODUCT | Product or service name | iPhone 15 Pro | NLP |
EVENT | Named event | World War II, Super Bowl | NLP |
WORK_OF_ART | Title of a creative work | The Great Gatsby | NLP |
LAW | Named law or regulation | GDPR, HIPAA | NLP |
LANGUAGE | Language name | Spanish, Mandarin | NLP |
QUANTITY | Measurement or quantity | 500 metres, 3 kilograms | NLP |
CARDINAL | Cardinal number | forty-two | NLP |
ORDINAL | Ordinal number | first, third | NLP |
PERCENT | Percentage | 87% | NLP |
MISC | Miscellaneous named entity | Various | ML |
CUSTOM | User-defined entity type | Domain-specific | Custom |
Using entity types in code
Filtering detection results
import type { EntityType } from '@secured-ai/core'
const result = await client.detect(text)
const namesOnly = result.entities.filter(
(e) => e.type === 'PERSON'
)
const financialPII = result.entities.filter(
(e): e is typeof e & { type: EntityType } =>
['CREDIT_CARD', 'IBAN', 'ROUTING_NUMBER', 'ACCOUNT_NUMBER'].includes(e.type)
)Custom replacement pools by type
const client = new PrivacyClient({
baseUrl: 'https://dev-api.securedai.com',
sdkAccessToken: import.meta.env.VITE_SECURED_SDK_ACCESS_TOKEN,
replacementPools: {
PERSON: ['Alex Taylor', 'Jordan Lee', 'Morgan Smith'],
EMAIL: ['user@redacted.example'],
PHONE: ['800-555-0100'],
SSN: ['000-00-0000'],
},
})Custom patterns with specific types
client.addPattern({
name: 'employee-id',
pattern: /\bEMP-\d{6}\b/,
entityType: 'REFERENCE_ID', // classify as a sensitive REFERENCE_ID
confidence: 0.97,
})Notes on CUSTOM
The CUSTOM type is a catch-all for user-defined patterns. Note that CUSTOM is not in the sensitive types list — entities matched with entityType: 'CUSTOM' will appear in detect() results but will not be replaced by obfuscate(). Use a built-in sensitive type (like REFERENCE_ID or CASE_NUMBER) if you want automatic obfuscation.