Skip to content

Commit 122b452

Browse files
committed
Update version number, typing, md comment
1 parent 7ad9d85 commit 122b452

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

docs/ref/checks/pii.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,19 @@ Detects personally identifiable information (PII) such as SSNs, phone numbers, c
3030

3131
### Important: NRP and PERSON Entity Deprecation
3232

33-
**As of v0.1.8**, the `NRP` and `PERSON` entities have been **removed from the default entity list** due to their high false positive rates. These patterns are overly broad and cause issues in production:
33+
**As of v0.2.0**, the `NRP` and `PERSON` entities have been **removed from the default entity list** due to their high false positive rates. These patterns are overly broad and cause issues in production:
3434

3535
- **`NRP`** matches any two consecutive words (e.g., "nuevo cliente", "crea un", "the user")
3636
- **`PERSON`** matches any two capitalized words (e.g., "New York", "The User", "European Union")
3737

3838
**Impact:**
39+
3940
- ❌ Causes false positives in natural language conversation
4041
- ❌ Particularly problematic for non-English languages (Spanish, French, etc.)
4142
- ❌ Breaks normal text in pre-flight masking mode
4243

44+
> **Future Improvement:** More robust implementations of `NRP` and `PERSON` detection are planned for a future release. Stay tuned for updates.
45+
4346
**Migration Path:**
4447

4548
If you need to detect person names or national registration numbers, consider these alternatives:

src/__tests__/unit/checks/pii.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,11 @@ describe('pii guardrail', () => {
293293
_clearDeprecationWarnings();
294294
});
295295

296+
afterEach(() => {
297+
// Restore all mocks to prevent leaking between tests
298+
vi.restoreAllMocks();
299+
});
300+
296301
it('excludes NRP and PERSON from default entities', () => {
297302
const config = PIIConfig.parse({});
298303

src/checks/pii.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export enum PIIEntity {
157157
* include these entities in your configuration, or use more specific region-based
158158
* patterns like SG_NRIC_FIN, UK_NINO, etc.
159159
*/
160-
const DEFAULT_PII_ENTITIES = Object.values(PIIEntity).filter(
160+
const DEFAULT_PII_ENTITIES: PIIEntity[] = Object.values(PIIEntity).filter(
161161
(entity) => entity !== PIIEntity.NRP && entity !== PIIEntity.PERSON
162162
);
163163

0 commit comments

Comments
 (0)