thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

AI & Machine Learning · Intermediate

XML Tags in Prompts

Using XML-style tags to delimit instructions, documents and examples within a prompt.

Definition

Tags such as <document>, <instructions> and <example> help models such as Claude distinguish sections, reduce confusion between instructions and data, and make output easier to parse. Delimiting untrusted content also helps (but does not fully prevent) prompt injection.

Example

<contract>{text}</contract> Summarize the termination clauses in <summary> tags.

Exam tip

Wrapping untrusted documents in tags separates data from instructions but is not a complete injection defense.

Related terms