Your system prompt has 14 sections. Instructions, examples, constraints, output format, tone guidelines, safety rules. You wrapped each one in XML tags because Anthropic's documentation told you to. It works fine on Claude. Then you send the same prompt to GPT-4o. The model ignores half your boundaries. Instructions bleed into examples. Constraints leak into tone guidelines. You have tag soup.

A growing community of prompt engineers is switching to nested JSON structures instead. Not because JSON is inherently better. Because nested objects create containment hierarchies that XML tags and Markdown headers cannot match.

The Concept Bleeding Problem

When you put multiple instruction types in one system prompt, they interfere with each other. The model blends instructions across sections. Safety constraints infect output format rules. Example outputs get treated as new instructions. Tone guidelines override task-specific directives.

This happens because most prompt structures are flat. XML tags and Markdown headers create horizontal boundaries. They separate sections side by side. They do not create parent-child relationships between instructions.

A flat XML structure looks like this:

<instructions>Write a professional email.</instructions>
<tone>Formal but warm.</tone>
<constraints>Do not mention pricing.</constraints>
<examples>Subject: Follow-up...</examples>

All four sections sit at the same level. The model processes them as parallel inputs. Nothing tells it that the tone instruction applies inside the instructions section, or that the constraints section takes priority over the examples section.

Why Nested JSON Is Different

JSON objects nest. Keys contain objects. Objects contain arrays. Arrays contain items. This creates a vertical hierarchy that XML tags express only through naming conventions.

A nested JSON structure looks like this:

{
  "role": "email_assistant",
  "instructions": {
    "task": "Write a professional email based on context",
    "tone": "formal but warm",
    "constraints": ["do not mention pricing", "keep under 200 words"]
  },
  "examples": [
    {
      "subject": "Follow-up on our conversation",
      "body": "Hi [Name], I wanted to follow up..."
    }
  ]
}

The containment is explicit. Tone and constraints are children of instructions. The model sees the hierarchy in the structure itself, not just in the tag names. This reduces concept bleeding because the nesting creates clear ownership. The tone belongs to instructions. The examples are separate from instructions.

The @pictsbyai Approach

The community trend that brought this to attention centers on @pictsbyai, who popularized a nested JSON format specifically designed to prevent concept bleeding in image generation prompts. The approach uses nested objects to separate visual specifications, style directives, and safety constraints into distinct subtrees.

The key insight: when instructions live in separate branches of a JSON tree, they are less likely to cross-contaminate. The model processes each branch as a coherent unit rather than mixing flat sections together.

This is not a peer-reviewed finding. It is a community observation supported by growing anecdotal evidence. But the logic is sound. Nested structures create containment. Containment reduces bleeding.

XML vs JSON: The Delimiter Hypothesis

The debate between XML and JSON for prompt structure has been active for months. A February 2026 analysis by Kyle (0xblacklight) made a key observation: XML tags are both syntactic and semantic delimiters, while JSON separates syntax from semantics.

In XML, <instructions> tells you what the section is (semantic) and where it starts and ends (syntactic). In JSON, the key "instructions" is semantic, but the curly braces and commas are purely syntactic. The semantic label sits at the top of the object, not at both boundaries.

This matters for LLMs because models process sequences linearly. When the closing </instructions> tag arrives, the model immediately knows the section ended. When a closing curly brace arrives in JSON, the model must trace back to the matching key to understand what ended.

For simple structures, this difference is negligible. For deeply nested structures with many levels, XML's boundary clarity gives it an advantage. But JSON's nesting hierarchy provides a different advantage: explicit containment relationships that XML expresses only through naming.

Model-Specific Affinities

Different model families have different structural preferences. This is not controversial. Anthropic's documentation explicitly recommends XML tags for Claude. OpenAI's function calling and structured output features use JSON schemas natively. GPT models have seen vastly more JSON than XML in their training data, because JSON is the dominant data format in web APIs and code repositories.

Scaling Thoughts documented this clearly: Claude loves XML, GPT loves JSON. The structural conventions each model family was trained on create implicit expectations. When a model sees familiar formatting, it processes it more reliably.

This creates a practical dilemma. If you write prompts for one model, use its native format. If you write prompts that must work across models, you need a format that degrades gracefully on both.

The Pragmatic Middle Ground

The community is converging on a pragmatic approach:

  • For Claude-specific prompts: Use XML tags with semantic naming. Follow Anthropic's documentation. The model was trained to respect these boundaries.
  • For GPT-specific prompts: Use nested JSON objects. Leverage the model's native familiarity with JSON hierarchies.
  • For cross-model prompts: Use nested JSON with clear key naming. JSON degrades more gracefully than XML on GPT models, and Claude still processes JSON reliably even if XML is its preference.
  • For image generation prompts: Use nested JSON with separate subtrees for visual specs, style, and safety. This is where concept bleeding is most damaging and where the @pictsbyai approach has shown the most benefit.

The worst choice is Markdown headers for complex multi-instruction prompts. Markdown headers are display instructions, not structural boundaries. There is no way to express containment in Markdown. The model must guess where one section ends and another begins.

What to Watch

The JSON-vs-XML debate is not settled. The delimiter hypothesis (Systima) needs systematic benchmarking. The @pictsbyai nested format needs quantitative evaluation, not just anecdotal reports. Anthropic and OpenAI may release model-specific guidance that shifts the landscape.

But the core problem is real. Concept bleeding in complex system prompts is a daily frustration for anyone building with agents. Nested JSON structures offer a practical mitigation. They are not perfect. They are better than flat tag soup.


Citations

  • @pictsbyai nested JSON prompt format — community trend on Twitter/X, popularized April 2026
  • "The Definitive Guide to Prompt Structure" — Limited Edition Jonathan, Substack, February 2026
  • "You're Doing it Wrong: Prompt- and Context-Engineer with XML, not JSON" — 0xblacklight (Kyle), blacklight.sh, 2026
  • "Structural Conventions: Why Claude Loves XML and GPT Loves JSON" — Scaling Thoughts, 2026
  • "The Delimiter Hypothesis: Does Prompt Format Actually Matter?" — Systima AI, 2026
  • Anthropic Prompting Best Practices: Use XML Tags — docs.anthropic.com/en/docs/use-xml-tags
  • "Structured Prompting for LLMs: YAML, JSON, XML or Plain Text?" — Towards AI, 2026
  • "Testing Common Prompt Injection Defenses: XML vs. Markdown" — Spencer Schneidenbach, schneids.net

Suggested Title

JSON-Structured Prompts: The Community's Answer to Tag Soup

Word Count

998

Fact-Check Notes

  • The @pictsbyai nested JSON format is a community trend identified in the task context. I could not find a specific verified post or repository from @pictsbyai. This is anecdotal and should be flagged for Brian's review before publishing. The general JSON structured prompting trend is well-documented by other sources.
  • The 0xblacklight blog post was directly fetched and confirmed. The analysis about XML vs JSON delimiter semantics is the author's reasoning, not peer-reviewed research.
  • The Scaling Thoughts article about model-specific structural preferences could not be fully fetched. The claim that "Claude loves XML, GPT loves JSON" is widely echoed across multiple sources and aligns with official Anthropic documentation.
  • The Systima "Delimiter Hypothesis" article could not be fetched. Its existence is confirmed from search results but content could not be verified.
  • Anthropic's XML tag recommendation is confirmed from official documentation.
  • Concept bleeding as a phenomenon is not formally defined in any peer-reviewed paper I found. It is a community term for cross-contamination between prompt sections. This should be noted.