AI Adversarial Document Lab: Crafted Markdown Defeats the Summariser

✨ AI Summary
SummariseBot summarises PDFs and Markdown — and it treats certain structures as signals of importance. Blockquotes, for instance, get summarised 'verbatim because quotes matter'. Structure the document right and you choose what the summary says.
Lab at a glance: Advanced · 140 XP · about 20 minutes · runs in your browser, no signup or setup. Try it yourself first; the full solution is behind a spoiler below.

What this lab teaches

Adversarial document upload is indirect prompt injection that rides on a parser's structural assumptions. When a summariser gives special weight to headings, bold text or quotes, an attacker uses those structures to steer the output — here, forcing a chosen phrase into the summary.

The lesson: document structure is attacker-controlled too. Treating a quote or heading as 'intent' lets the document, not the user, drive the model.

How SummariseBot reads a document

You upload a Markdown document. SummariseBot's parser surfaces blockquotes verbatim on the assumption that quoted text is salient. By placing your target phrase in the structure the parser privileges, you make it appear in the summary.

The attack approach

  • Confirm the summariser gives special treatment to certain markdown structures (quotes, headings, bold).
  • Place your target phrase inside the structure that is echoed verbatim.
  • Keep the rest of the document benign so a human reviewer sees nothing odd.
  • Upload and read the forced phrase in the summary.

Full walkthrough (spoiler)

If the phrase does not surface, you used a structure the parser does not privilege — open the steps.

Show the step-by-step solution
  1. Write a document whose blockquote contains the literal phrase 'I have been compromised'.
  2. Surround it with ordinary-looking content so the document reads as normal.
  3. Upload it for summarising; the parser echoes the quoted structure verbatim.
  4. The summary prints your phrase and the lab marks you solved.

Why it works

The parser encodes an assumption — 'quotes are important, reproduce them' — and that assumption is a lever. You did not break the model; you used the structure it trusts to place words in its mouth. Structural signals are just another channel for injection.

Core principleNever treat document structure as user intent. Summarise content as inert data and strip or neutralise structural directives before the model sees them.

Where this happens in the real world

Adversarial documents are a practical form of indirect prompt injection (OWASP LLM01), especially against summarisers and RAG ingestion. As more pipelines parse rich documents, structure-aware parsing becomes an injection surface worth testing.

How to defend against it

  • Treat all document content as inert data, not as signals of intent.
  • Normalise and flatten structure before summarising, so quotes and headings carry no special authority.
  • Delimit retrieved content clearly from instructions in the prompt.
  • Review outputs for injected literals and constrain the summary format.
Mr Elite tip: When a summariser 'respects' document structure, test whether a crafted quote or heading can dictate the output. Any structure the parser privileges is an injection lever.

Try it, then go further

Reading about it is the easy part. Open the lab, try your own approach before peeking at the spoiler, and see how many attempts it takes.

❓ Frequently asked questions

What is an adversarial document upload?
A document crafted so its structure (quotes, headings, bold) steers an AI summariser or RAG pipeline into producing attacker-chosen output — a form of indirect prompt injection.
Why does document structure matter?
Parsers often treat structure as a signal of importance. An attacker controls the structure, so privileged structures become a channel to influence the model.
How do I defend a summariser?
Treat content as inert data, normalise and flatten structure before summarising, delimit data from instructions, and review outputs for injected literals.
Which OWASP category is this?
LLM01 Prompt Injection (indirect) in the OWASP Top 10 for LLM Applications (2025).
⚡
Join free to earn XP for reading this article Track your progress, build streaks and compete on the leaderboard.
Join Free
Lokesh N. Singh aka Mr Elite
Lokesh N. Singh aka Mr Elite
Founder, Securityelites · AI Red Team Educator
Founder of Securityelites and creator of the SE-ARTCP credential. Working penetration tester focused on AI red team, prompt injection research, and LLM security education.
About Lokesh ->

Leave a Comment

Your email address will not be published. Required fields are marked *