AI engineering glossary · Prompt context engineering
What is XML tags in prompts?
XML tags in prompts: A prompt style that wraps each section in named tags like <document> or <instructions>. The names tell the model what each block is, help it refer to blocks by name, and make outputs easy to extract. Several model providers recommend it for long, multi-part prompts.
XML tags in prompts: an example
<contract>...text...</contract><question>What is the notice period?</question> and ask the answer inside <answer></answer> tags.
Related terms
More Prompt context engineering terms
- Zero-shot chain-of-thought
- Zero-shot prompting
- Analogical prompting
- Assistant prefill
- Automatic prompt engineer
- Batch API
- Chain-of-thought faithfulness
- Chain-of-thought prompting
Where you learn it
XML tags in prompts is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.