WriteMyAIPromptFree, no sign-up

XML tags in prompts

XML tags in prompts are paired markers such as `<context>` and `</context>` used to label each section of a prompt so the model can tell them apart.

Anthropic’s models were trained with XML-delimited structure and follow it more reliably than markdown headings, particularly in long prompts. The tag names are arbitrary; what matters is that they are consistent and that every opened tag is closed.

Related terms

Delimiter
A delimiter is a marker such as an XML tag, a row of dashes, or triple backticks that separates one part of a prompt from another.
Prompt structure
Prompt structure is the order and separation of a prompt’s parts — role, context, task, constraints, format, examples — which changes model behaviour independently of the words used.

More on prompt structure

See the full glossary, read the guides, or put it into practice in the prompt builder.