xml-agent-instruction-format

xml-agent-instruction-format is an agent for coding agents from EndogenAI/dogma. It costs 0 tokens per session (16,104 once invoked), scanned A, original, Apache-2.0.

A research document proposing a format for instructions given to AI agents. It recommends using Markdown headings for people and tools, with XML tags around sections to help an AI model interpret them.

In plain words
What is it for?
Use it when designing or reviewing .agent.md files and other structured instructions for AI coding agents.
Why use it?
Clear structure makes agent instructions easier to navigate, register, and parse. The proposal separates organization for humans from organization for the model receiving the instructions.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/endogenai/dogma/xml-agent-instruction-format
Clone the repo
git clone --depth 1 https://github.com/EndogenAI/dogma

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for xml-agent-instruction-format

README.md
[![agentmods](https://agentmods.dev/badge/agents/endogenai/dogma/xml-agent-instruction-format.svg)](https://agentmods.dev/agents/endogenai/dogma/xml-agent-instruction-format)
Your own site
<a href="https://agentmods.dev/agents/endogenai/dogma/xml-agent-instruction-format"><img src="https://agentmods.dev/badge/agents/endogenai/dogma/xml-agent-instruction-format.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 16,104 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.16104
Opus 5 $0.00000 $0.08052
Sonnet 5 $0.00000 $0.03221
Haiku 4.5 $0.00000 $0.01610

Measured yesterday against content hash 4d9947e823f0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

xml-agent-instruction-format scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/research/agents/xml-agent-instruction-format.md · 922 lines

How it starts

The opening of the file, as written. The whole thing — 922 lines — stays where its author put it; the contents beside it link to each section on GitHub.

XML-Tagged Agent Instruction Format

Status: Final Research Question: Should EndogenAI's .agent.md files use XML tags in agent instruction bodies? If so, which specific tags, where, and under what nesting rules? Is XML complementary to or a replacement for Markdown headings? Date: 2026-03-06


1. Executive Summary

After surveying 17 sources spanning Anthropic's official guidance, VS Code's .agent.md file specification, the Claude Code and Agent Skills ecosystems, OpenAI's prompt engineering guide, AutoGen, LangChain, and the Anthropic cookbook multi-agent pipeline, the answer to Issue #12 is unambiguous: EndogenAI should adopt a hybrid schema — Markdown ## Section headings for file structure, XML tags wrapping the content within each section for Claude's instruction parsing.

The central finding is architectural, not cosmetic. XML and Markdown serve different masters. ## Section headings exist for two audiences: humans reading the file in editors and the IDE's agent registration and navigation machinery. XML tags exist for one audience: the Claude model receiving the instruction text. These two concerns are orthogonal. VS Code forwards the entire .agent.md body verbatim to the model without parsing or transformation — acting as a conduit, not a compiler. (OQ-12-1 resolved 2026-03-07: the Language Model API layer also performs no XML-aware pre-processing; see Section 6 and Open Question 1.) This means both layers can coexist in the same file without conflict.

Secondary finding (2026-03-07): The VS Code Language Model API does not support system messages. The prompt instructions from a .agent.md body are prepended as a User-role message, not a System message. XML tags in the body still pass through unchanged; this finding affects only message role, not XML handling.

The apparent contradiction in the evidence — that Claude Code sub-agent files and Agent Skills files use plain Markdown bodies with no XML, while Anthropic's cookbook agents and official prompt engineering guide use XML extensively — resolves directly on execution context. Claude Code sub-agents are minimal, task-specific workers invoked via <function_calls> tool calls; their "instruction body" is intentionally lean. Anthropic's cookbook orchestrator agents are complex, multi-role system prompts sent as raw strings to the API; XML is the only structuring mechanism available because there is no Markdown heading layer. EndogenAI's .agent.md files occupy a third position: they are file-format agents with IDE requirements and complex behavioural guidance. For this position, the correct pattern is to use both layers.

Read the full file on GitHub · 922 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 922 lines · 0 tokens per session scan A 4d9947e823f0

Subscribe to this mod's changes

xml-agent-instruction-format is an agent published in the GitHub repository EndogenAI/dogma (2 stars, last pushed 11d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 16,104 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.