Prompt XML Syntax
thndrs uses XML-shaped text to make prompt sections easy to scan in
--print-prompt output. The tags are a prompt convention, not a separate policy engine or a
general XML API.
Fragments
Section titled “Fragments”Prompt fragments live in src/prompt/fragments and are included verbatim in a fixed order. Keep
each fragment focused on one concern, use shallow tags, and prefer short imperative instructions.
Use tags for structure:
<communication_style> <instruction>Be direct and practical.</instruction></communication_style>Do not put unrelated policy, runtime metadata, and project context into the same fragment. Runtime
sections such as <environment> and <project_context> are generated by Rust code so their values
match the actual run.
Text Values
Section titled “Text Values”Generated sections wrap arbitrary text in CDATA. This is used for values that may contain Markdown,
paths, punctuation, or angle brackets, such as workspace paths and AGENTS.md content.1
<workspace><![CDATA[/repo]]></workspace><content><![CDATA[# ProjectBuild with cargo test.]]></content>When generated text contains the CDATA terminator, thndrs splits it so the surrounding XML-shaped
section remains readable.2
Literal prompt fragments should avoid CDATA unless they are intentionally embedding large text. Most fragment instructions should be ordinary XML text.
Precedence
Section titled “Precedence”The prompt order is part of the contract:
- Built-in harness fragments.
- Environment metadata.
- Project context from
AGENTS.md.
AGENTS.md content is guidance. It cannot grant permissions, change tools, bypass safety limits, or
override direct user or harness instructions.3
Footnotes
Section titled “Footnotes”-
CDATA is used for readability in prompt output, not as a security boundary. ↩
-
The Rust helper replaces
]]>with adjacent CDATA sections. ↩ -
See Prompt Assembly for the full prompt order and context contract. ↩