Reference · verified July 2026

LLM Prompt Injection Cheat Sheet

1. Attack techniques

Click a technique to expand it. Shape-only payloads — for authorised testing.

67/67

Direct 7

Jailbreak 8

Multi-turn 5

Obfuscation 14

Indirect / RAG 9

Extraction 5

Exfiltration 8

Agent abuse 8

Reasoning-model 3

The most damaging attacks combine three things: access to private data, exposure to untrusted content, and the ability to communicate externally — Simon Willison's “lethal trifecta.” Miss any one leg and injection stays noise.

2. Real-world incidents

Once an LLM is embedded in real software, the question stops being “can the model say something bad?” and becomes “can untrusted content reach a model that has privileges?”

DateIncidentWhat happenedClass
Feb 2023Bing Chat / “Sydney”Direct instruction-override extracted the hidden system prompt (internal codename “Sydney”) — the canonical public prompt-leak demo.Direct → prompt extraction
2023ChatGPT markdown-image exfilMarkdown image rendering could beacon chat/plugin data to an external host; OpenAI later shipped URL-exfil mitigations. The class recurred with every new tool surface.Indirect → markdown exfil
Aug 2024Slack AI private-channel exfilPromptArmor: instructions planted in any public channel executed when a privileged user queried Slack AI, leaking private-channel content. The attacker never needed data access.Indirect → cross-tenant exfil
Sep 2024SpAIwareInjection wrote persistent instructions into ChatGPT long-term memory → continuous exfiltration across all future sessions — effectively a C2 channel.Memory poisoning → persistence
Feb 2025GitLab Duo source-code theftLegit Security: hidden instructions in MR descriptions/commits/source made Duo exfiltrate private code; streaming markdown→HTML also enabled HTML injection. Demonstrated five OWASP LLM Top 10 items in one chain.Indirect → exfil + HTML injection
Jun 2025EchoLeak — CVE-2025-32711 (CVSS 9.3)The landmark case. Aim Security: a single crafted email, zero clicks, made M365 Copilot exfiltrate context — bypassing the XPIA classifier, link redaction, and CSP by abusing an allowlisted Teams image proxy. Termed an “LLM Scope Violation.”Zero-click indirect → exfil
Aug 2025GitHub Copilot RCE — CVE-2025-53773Injection in repo content made Copilot edit `.vscode/settings.json`, enable auto-approve (“YOLO mode”), then execute commands. Wormable via shared repos.Indirect → config write → RCE
Sep 2025ForcedLeak (CVSS 9.4)Noma: a payload in a Web-to-Lead Description field made Salesforce Agentforce exfiltrate CRM data to an expired domain still on the CSP allowlist — re-registered for ~$5.Indirect → allowlist abuse → exfil
Oct 2025CamoLeak — CVE-2025-59145 (CVSS 9.6)Legit Security: injection in invisible PR-description comments made GitHub Copilot Chat encode keys + source into Camo-proxy image URLs. Traffic originated from GitHub's own infra, evading monitoring.Indirect → trusted-proxy exfil
2025postmark-mcpFirst malicious MCP server caught in the wild — 15 clean releases building trust, then one line of exfiltration code. A classic rug pull.Agentic supply chain

The whole taxonomy: private data + untrusted content + an egress channel.

3. Defenses & where they fall short

There is no complete fix for prompt injection today — OWASP, Microsoft, Meta, and independent research (“The Attacker Moves Second” broke 12 published defenses at >90% ASR) all agree. Layer these and assume some attacks get through.

Detection reduces frequency. Architecture reduces consequence. Only the second one is load-bearing.

Architectural controls (the ones that hold)

ControlWhat it stopsWhere it falls short
Eliminate the lethal trifectaNever combine private-data access + untrusted content + external comms in one path. Miss any leg and injection can't become a breach. The highest-value control.Requires giving up capability; most agents want all three. “External comms” is easily under-scoped (markdown rendering, link unfurling, DNS, error messages).
Meta “Agents Rule of Two”≤2 of 3 (untrusted input / sensitive data / state-change or external comms). All three → a human approves. The best practical framework shipping today.Click-through defeats it. Untrusted-input + external-comms without private data still harms.
Dual-LLM patternA privileged LLM never sees untrusted content; it orchestrates a quarantined LLM whose output is opaque data, never instructions. Principled, model-independent.Substantially constrains capability; hard to retrofit; leaks if the privileged side renders quarantined output into a channel.
CaMeL (Google DeepMind)Design-level: extract control+data flow from the trusted query into a custom interpreter, attach capability metadata to every value, enforce policy at each tool call. Untrusted data provably can't influence program flow.A utility gap vs undefended; needs explicit per-app policies; not turnkey. Doesn't make responses correct, only flows authorised.
Least privilege + scoped identityCaps the blast radius (“read all repos” → “read this repo”).Nothing about injection itself — if the legit task needs the scope, so does the injected task.
Human-in-the-loop for irreversible actionsThe last reliable control for send / delete / deploy / pay.Approval fatigue is real and measured — users click through. A confidence score shown in the interstitial is not security (injection can score 100%).

Input / prompt-level controls

ControlWhat it stopsWhere it falls short
Instruction/data separation + delimitersRaises the bar vs naive “ignore previous instructions.” Cheap — do it anyway.Microsoft explicitly does not recommend it as a primary control; attackers forge the delimiter.
Spotlighting (datamarking / encoding)Mark untrusted text so provenance is continuous. Microsoft measured ASR ~50% → <3% with datamarking; ~0% with encoding, no measured task-quality harm.Evaluated vs non-adaptive attacks; must be applied by trusted code before concatenation — easy to get wrong in multi-source RAG.
Unicode / invisible-character sanitisationStrip the Tags block, zero-width, bidi controls, variation selectors — closes the invisible-text channels outright. Cheap, high-value.Only covers known ranges; new confusables appear. (Google declined to fix the Gemini case — so you own this.)
Input classifiers / injection detectorsCatch known patterns and opportunistic attacks; useful telemetry; reduce attack volume.Directly falsified — “The Attacker Moves Second” reached >90% ASR against ProtectAI, PromptGuard, and Model Armor with a search-based adaptive attack. Injection has no reliable signature.
Instruction hierarchy trainingTrains explicit precedence (system > developer > user). Raises the floor. (OpenAI.)Probabilistic precedence isn't enforcement; degrades under long context, multi-turn drift, and structured-format confusion (Policy Puppetry).

Output-side controls

ControlWhat it stopsWhere it falls short
Safe rendering / output sanitisationNo auto-fetched images, no arbitrary HTML, sanitise before render, never stream-render before sanitising. Closes the dominant exfil primitives — the CamoLeak and GitLab Duo fixes were both this.Whack-a-mole across every channel (markdown, HTML, link unfurl, DNS prefetch, CSP-allowed proxies). GitLab left `<img>`/`<form>`/`<a>` on by default — a config gap, not a library bug.
Output classifiers / guardrailsCatch obviously harmful completions; add a policy layer + audit trail. (Llama Guard, NeMo Guardrails.)Same adaptive result; Anthropic identifies output-obfuscation attacks that disguise output so a response-only classifier sees it as harmless.
Anthropic Constitutional ClassifiersThe most rigorously stress-tested guardrail publicly documented — 3,000+ red-team hours found no universal jailbreak; the updated version adds only ~0.4% production refusals.Two surviving classes — reconstruction (harmful info split into benign segments) and output obfuscation. Defends jailbreak (model safety), not app-layer injection — don't conflate them.

Defender's quick-start — defense-in-depth, in order

  1. Eliminate the trifecta where you can — everything below is a compensating control.
  2. Least privilege + scoped, per-agent identity. Assume injection succeeds.
  3. Egress allow-list, audited for ownership on a schedule.
  4. Safe rendering + Unicode sanitisation — cheap, deterministic, closes top exfil primitives.
  5. Spotlighting (datamarking minimum) at every ingestion path.
  6. Human-in-the-loop for irreversible actions — show the action, not a confidence score.
  7. Classifiers + logging — for volume reduction and forensics, never as the boundary.
  8. Adaptive red teaming (PyRIT, garak), mapped to ATLAS IDs, on a recurring cadence.

4. Sources & further reading

★ Companion taxonomy

Arcanum Prompt Injection Taxonomy (PITAX) ↗

The definitive 172-node classification of LLM attacks by Jason Haddix / Arcanum Security (CC BY 4.0), cross-mapped to OWASP, MITRE ATLAS, and NIST. This sheet was cross-checked against it for completeness — go there for the full, exhaustive taxonomy.

Stop reading, start breaking

Every technique above is a hands-on lab against a real LLM — with a live trace showing exactly why the attack works, and the defenses that stop it.