LibreChat/packages/data-provider
Dustin Healy 92385d5e51 🛡️ feat: Client-Side PII Prefilter
Adds a browser-side prefilter so credentials are caught and redacted
(or refused) before the message even leaves the client, with the
existing server-side enforcement remaining intact for callers that
bypass the UI.

The startup config endpoint now serializes the resolved
messagePiiFilter to a browser-safe wire format: onMatch, redactionText,
and patterns expressed as { id, label, source, flags } so RegExp can
survive JSON and be reconstructed in the client.

A new useClientPiiFilter hook reads that config from React Query and
exposes an apply(text) call. It is wired into useChatFunctions.ask,
the single chokepoint that covers all seven submit paths (form submit,
regenerate, continue, edit-and-resubmit, edit content part, voice
auto-send, programmatic ask).

Mode semantics on the client mirror the server: warn redacts inline
and shows a warning toast, block stops the submission entirely with an
error toast (the POST never fires), silent redacts inline with no UI.
When client redaction has already happened the server pre-redact finds
nothing to scrub and stays silent, so there is no duplicate toast.

The new com_ui_pii_blocked translation key is the only string addition.
2026-06-07 21:09:36 -07:00
..
react-query 📦 chore: npm audit fixes and Mongoose 8.23 TypeScript follow-ups (#12996) 2026-05-07 09:47:40 -04:00
specs 🔐 fix: Resolve Env Variables in MCP OAuth URL Fields (#13573) 2026-06-07 21:39:44 -04:00
src 🛡️ feat: Client-Side PII Prefilter 2026-06-07 21:09:36 -07:00
.gitignore
babel.config.js
check_updates.sh 🔧 feat: Initial MCP Support (Tools) (#5015) 2024-12-17 13:12:57 -05:00
jest.config.js refactor: Parallelize CI Workflows with Isolated Caching and Fan-Out Test Jobs (#12088) 2026-03-05 13:56:07 -05:00
package.json ⬆️ chore: Bump TypeScript to 5.9.3 (+ typescript-eslint 8.60.1) (#13584) 2026-06-07 22:20:44 -04:00
rollup.config.js perf: Migrate data-schemas Build to tsdown with isolatedDeclarations (#13578) 2026-06-07 21:40:48 -04:00
server-rollup.config.js 🚀 feat: Add Code API Proxy Support and Update MCP SDK (#6203) 2025-03-06 12:47:59 -05:00
tsconfig.json 📦 chore: npm audit fixes and Mongoose 8.23 TypeScript follow-ups (#12996) 2026-05-07 09:47:40 -04:00
tsconfig.spec.json 📦 chore: Update TypeScript Config for TS v7 (#12794) 2026-04-23 12:51:03 -04:00