Skip to content

Reject role-token injection in structured prompts - #796

Open
sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/reject-dialog-control-token-injection
Open

Reject role-token injection in structured prompts#796
sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/reject-dialog-control-token-injection

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Fixes #768.

Validate structured dialog.Conversation inputs before serialization. Message text containing turn or channel delimiters now fails before tokenization, preventing content from changing the serialized role structure. Explicit dialog.ControlToken chunks and intentionally preformatted raw Sampler strings remain supported.

Tests: 4 targeted tests pass; new files pass Pyink; git diff --check passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing escape sequence allows to inject a system message

1 participant