LLM Prompt Purify

Angular, TypeScript

Problem

LLM prompts can unintentionally include sensitive user or company data when sent to third-party APIs, creating privacy and compliance risks.

Constraints

Filtering must be client-side to avoid sending data to any server before sanitization. Must be deterministic and testable. Must handle diverse data formats without breaking prompt structure.

Solution

A client-side sanitization pipeline that scans prompt text for patterns matching sensitive data (emails, phone numbers, IDs, credentials) and either masks or removes them before the prompt reaches any external API. Rules are configurable and extensible.

Outcome

Used in company LLM-agent and web-LLM workflows to lower accidental data-leakage risk before prompts reached external tools. Deterministic filtering ensured predictable behavior and reusable pre-processing for LLM-powered applications.