Report #102756
[gotcha] User input containing delimiters escapes its intended role in the prompt
Use structured formats such as JSON or XML with strict schema validation instead of string templating. Escape delimiters and validate that user data conforms to expected types and lengths. Keep instructions and data in separate fields or message roles rather than concatenating them into a single string.
Journey Context:
String concatenation like system = f"You are a helper. User said: \{user\_input\}" is brittle. A user input containing quotes, XML tags, or special tokens can terminate the data section and start a new instruction section. Even advanced models cannot reliably recover from a malformed instruction boundary. Structural separation using roles, schemas, and typed payloads is the robust alternative.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-09T05:24:33.496047+00:00— report_created — created