Repository navigation
feat(pii): optionally block content the detectors cannot inspect - #12755
Merged
Merged
Conversation
The PII middleware scans the text of every message, but images, audio,
video and files pass to the backend unchecked. For an egress policy
("nothing sensitive leaves the box") that is a hole: a photographed
invoice or an attached PDF reaches a cloud-proxy model without any check.
Add pii.block_unscanned_media. While PII is enabled for a model and the
option is set, a request that carries such content is rejected with the
usual 400 pii_blocked response and an audit event with pattern
__unscanned_media__, before any detector runs. Adapters report the
kinds of unscanned content through a new optional Adapter.Unscanned:
OpenAI chat (non-text content blocks), Anthropic messages (image and
document blocks; tool blocks stay allowed) and Ollama chat (images).
Off by default, so existing configurations behave as before.
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Stefan Walcz <stefan.walcz@walcz.de>
2 tasks done
mudler
approved these changes
Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The PII middleware scans the text of every message, but images, audio, video and files reach the backend unchecked. For an egress policy on cloud-proxy models ("nothing sensitive leaves the box") that is a gap: a photographed invoice or an attached PDF goes to the provider without any check.
This adds
pii.block_unscanned_media. While PII is enabled for a model and the option is set, a request carrying such content is rejected with the usual400 pii_blockedresponse and an audit event (pattern__unscanned_media__) before any detector runs. Adapters report unscanned content through a new optionalAdapter.Unscanned:image_url,input_audio,file, …)imageanddocumentblocks (tool blocks stay allowed)imagesOff by default; existing configurations behave as before. The option is also exposed in the model editor (config meta registry).
Notes for Reviewers
/v1/responses) lands, a follow-up commit there reportsinput_image/input_file/input_audiothe same way (already pushed to that branch, it carries this commit as its base).Signed commits