You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prompt.chat_messages() parsed every line of the rendered template as a
possible ChatMessage, so template data that rendered to message JSON was
returned as a privileged system, assistant or tool message.
Each Prompt now carries a secret sentinel in its render context. The chat
tag, the tool filter and the media filters mark everything they emit with
it, and the parsers accept only marked lines and markers; anything else
stays plain text. The sentinel is per instance rather than per render
because the render cache keys on the context, so a sentinel that changed
between renders would make cached text unparseable. text() strips it, so
its output is unchanged and the marker cannot leak to whoever supplies
the data.
The same round trip through rendered text also affected
CompletionExtension._body_to_messages(), where data could inject tool
definitions as well as messages, and chat_message_from_text(), where data
could inject content blocks such as remote image URLs through the
no-chat-block fallback. Both are covered.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments