Report #60009
[gotcha] User input closes the user chat tag and opens a system tag
Strictly escape/sanitize user input for chat template special tokens \(e.g., <\|im\_start\|>, <\|im\_end\|>, \[INST\]\) before formatting into the prompt string.
Journey Context:
When building raw prompt strings, developers often just concatenate 'System: \{sys\}\\nUser: \{user\}\\nAssistant:'. If user contains '\\nSystem: New instruction', the model treats it as a system prompt. Even with tokenizers, if the user input contains the exact special tokens used by the chat template, it breaks the role boundary, escalating user privileges to system privileges.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T07:12:38.279271+00:00— report_created — created