Developer releases local npm tool to catch PHI leaks in LLM outputs during CI builds
A developer building LLM features on clinical text has released phi-leak-guard, an open-source TypeScript npm package designed to fail test suites when AI model outputs contain protected health information. The tool runs entirely locally within Vitest or Jest, meaning no patient data is sent to external APIs or third-party services. Unlike simple regex matching, it validates detected patterns using checksums and structural rules — such as Modulus-11 for NHS numbers — to reduce false positives. When a violation is found, the library reports exactly which identifier type was detected and how confidently it was matched. Released under the MIT license, the package targets HIPAA Safe Harbor identifiers and common UK GDPR direct identifiers, and is positioned as a regression gate rather than a compliance certification.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in