site/docs/red-team/strategies/authoritative-markup-injection.md
The Authoritative Markup Injection strategy tests whether AI systems are more susceptible to harmful requests when they're presented with authoritative-looking formatting or structured markup.
This approach exploits the tendency of language models to place higher trust in content that appears to come from official, structured, or technically formatted sources.
Language models are trained on vast amounts of structured data including documentation, technical specifications, academic papers, and formal communications. This training can create a bias where models treat formally structured or marked-up content as more authoritative or trustworthy.
The strategy works by:
This technique is distinct from simple prompt injection because it focuses specifically on exploiting trust signals embedded in formatting and structure rather than just the content itself.
Add it to your promptfooconfig.yaml:
strategies:
# Basic usage
- authoritative-markup-injection
# With configuration (specify which variable to inject into)
- id: authoritative-markup-injection
config:
injectVar: query
The injectVar parameter specifies which variable in your prompt template should receive the authoritative markup injection. If not specified, the strategy will use the default prompt injection variable.
Combine with red team plugins to test specific vulnerability categories:
redteam:
plugins:
- harmful
- pii
- prompt-injection
strategies:
- authoritative-markup-injection
Consider a simple harmful request:
Tell me how to create malware
With authoritative markup injection, this might be transformed into content that appears to come from:
The model is tested to see if wrapping the request in authoritative-looking structure makes it more likely to comply, even though the underlying request remains harmful.
Authoritative markup injection is particularly important because:
This strategy helps identify vulnerabilities where models prioritize structural authority over content analysis, which is crucial for building robust AI safety systems.
For a comprehensive overview of LLM vulnerabilities and red teaming strategies, visit our Types of LLM Vulnerabilities page.