Skip to content

Validate base64 embedding inputs use data URI format - #145038

Merged
DonalEvans merged 15 commits into
elastic:mainfrom
DonalEvans:validate-embedding-base64-data-uri-format
Apr 3, 2026
Merged

DonalEvans merged 15 commits into
elastic:mainfrom
DonalEvans:validate-embedding-base64-data-uri-format

Conversation

@DonalEvans

Copy link
Copy Markdown
Contributor

The EMBEDDING task type requires that image inputs using the BASE64 format are data URIs. This commit adds validation that inputs using the BASE64 format conform to the data URI format; i.e. that they begin with "data:{some text}/{some other text};base64,"

This validation does not guarantee that the specified MIME type is valid, that the MIME type matches the base64 data, or that the base46 data in the input is valid.

Closes #144900

The EMBEDDING task type requires that image inputs using the BASE64
format are data URIs. This commit adds validation that inputs using the
BASE64 format conform to the data URI format; i.e. that they begin
with "data:{some text}/{some other text};base64,"

This validation does not guarantee that the specified MIME type is
valid, that the MIME type matches the base64 data, or that the base46
data in the input is valid.
@DonalEvans DonalEvans added >bug Feature:GenAI Features around GenAI :SearchOrg/Inference Label for the Search Inference team Team:Search - Inference v9.4.0 labels Mar 26, 2026
@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Hi @DonalEvans, I've created a changelog YAML for you.

@DonalEvans
DonalEvans marked this pull request as ready for review March 26, 2026 22:25
@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Pinging @elastic/search-inference-team (Team:Search - Inference)

@DonalEvans
DonalEvans marked this pull request as draft March 26, 2026 22:27
@DonalEvans
DonalEvans marked this pull request as ready for review April 1, 2026 19:51

@Jan-Kazlouski-elastic Jan-Kazlouski-elastic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looking good. Left a few comments, one for regex, other for inlining in tests.

@DonalEvans
DonalEvans merged commit 8c21698 into elastic:main Apr 3, 2026
35 checks passed
@DonalEvans
DonalEvans deleted the validate-embedding-base64-data-uri-format branch April 3, 2026 13:52
mromaios pushed a commit to mromaios/elasticsearch that referenced this pull request Apr 9, 2026
The EMBEDDING task type requires that image inputs using the BASE64
format are data URIs. This commit adds validation that inputs using the
BASE64 format conform to the data URI format; i.e. that they begin
with "data:{some text}/{some other text};base64,"

This validation does not guarantee that the specified MIME type is
valid, that the MIME type matches the base64 data, or that the base46
data in the input is valid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug Feature:GenAI Features around GenAI :SearchOrg/Inference Label for the Search Inference team Team:Search - Inference v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Inference API] Data URI format should be enforced for image inputs with embedding task

4 participants