LibreChat/packages
Dustin Healy 3ea35af9ad 🛡️ feat: Extend PII filter to OpenAI-compatible and Responses agent APIs
The chat-route middleware operates on `req.body.text`, but the remote
agent API endpoints (`/api/agents/v1/chat/completions`,
`/api/agents/v1/responses`) accept the same prompt content as a
`messages` array or an `input` field. A caller using their API key
could send a credential-shaped value through either route and bypass
the configured PII filter even though they share the same agent and
model backbone the middleware is meant to guard.

Factored out `findPiiMatchInMessages`, a tolerant walker that handles
both `content: string` and `content: ContentPart[]` user-message
shapes against the same compiled, cached pattern list. Wired it into
the OpenAI-compat controller after agent lookup and into the
Responses controller right after `convertToInternalMessages`. Each
returns the endpoint's native 400 error shape
(`sendErrorResponse` / `sendResponsesErrorResponse`) with the
`message_pii_filter_block` code when a user message matches.
2026-06-08 12:24:26 -07:00
..
api 🛡️ feat: Extend PII filter to OpenAI-compatible and Responses agent APIs 2026-06-08 12:24:26 -07:00
client ⚡ refactor: Migrate @librechat/client build to tsdown (#13596) 2026-06-08 11:20:03 -04:00
data-provider 🛡️ feat: Reject chat messages matching configured credential patterns 2026-06-08 11:40:35 -07:00
data-schemas 🛡️ feat: Reject chat messages matching configured credential patterns 2026-06-08 11:40:35 -07:00