
Using XML tags in prompts creates clear separation between instructions, context, and data — especially important for Claude and other advanced models.
<context> — background the AI needs<document> — text to analyze<instructions> — what to do<examples> — few-shot samples<output_format> — how to respondPrevents the AI from confusing your data with your instructions — critical when analyzing untrusted text.
Reference:
TaskLoco™ — The Sticky Note GOAT