XML tags in prompts — CCA-F Exam Prep

×
L2.040
REAL STORYA developer staring at two outputs from the same prompt. Left output: a perfectly formatted JSON response. Right output: a rambling paragraph that includes fragments of the few-shot examples mixed with real data. The developer has circled a section where example data leaked into the real output. Dim office, late night.

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 it worked perfectly. Other times, the output looked suspiciously like Example 2.