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.

Level: intermediateTopic: Prompt context engineering

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

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.