XML tags in prompts — CCA-F Exam Prep
L2.04|XML tags in prompts
1/12
The prompt had instructions, examples, and user input. Claude followed the example instead of the instruction.
A developer built a contract analysis tool. The prompt contained: instructions for how to analyze contracts, three example analyses, and the actual contract to analyze.
Sometimes Claude analyzed the real contract correctly. Other times, it produced output that looked suspiciously like Example 2 -- same structure, same phrasing, even fragments of the example contract mixed into the real analysis.
The developer rewrote the instructions four times. Added bold text. Added caps. Added "IMPORTANT: analyze the ACTUAL contract below, not the examples."
It still happened. 1 in 8 requests. Randomly. Unpredictably.
