How do I prevent HTML tags from being escaped in prompts and evaluations?
Last updated: January 14, 2026
Context
When building evaluations that check for proper HTML tag usage, you may encounter issues where HTML tags appear escaped in your prompt outputs. This can cause evaluations to fail because they expect non-escaped HTML tags but receive escaped versions instead.
Answer
To prevent HTML tags from being escaped in your prompts, you need to use the Mustache template format with triple bracket syntax. Here's how to set this up:
Navigate to the Prompts tab first - Select your prompt from the main Prompts section rather than directly within the Experiment view, as this provides access to the necessary template formatting options.
Set the template format to Mustache:
In the Prompt Playground, click the Settings (gear icon) in the top right of the prompt section
Ensure the Template Format is set to "Mustache"
Use triple bracket syntax: Instead of using the default variable format, manually type your variable using triple brackets: `{{{output.content}}}` instead of `{{output.content}}`
Test your changes: After making these changes in the Prompts tab, you can then navigate to your evaluations and playground to verify that HTML tags are no longer escaped.
Important Note: The template formatting options are currently only available when editing prompts from the Playground in the main Prompts tab, not when editing directly within the Experiment/Evaluator view. This is a known limitation that is being reviewed for improvement.
The triple bracket syntax in Mustache templates tells the system to render the content as-is without HTML escaping, which resolves the issue with escaped HTML tags in your evaluations.