Report #40158
[counterintuitive] Using markdown headers \(\#\#\#\) or arbitrary symbols \(===\) to separate instructions from context in prompts
Use XML tags \(, , \) for structural separation of prompt components.
Journey Context:
Early prompt engineers used markdown headers because they mirrored standard document formatting. However, LLMs are explicitly trained to parse nested XML structures hierarchically. XML tags are unambiguous, do not collide with markdown formatting inside the context, and prevent instruction leakage where the model treats context as instructions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:52:40.764327+00:00— report_created — created