← Field Notes
Engineering13 August 2026·9 min read·Chris Ma

THE SAME
CHANNEL.

LLMs process instructions and data through the same channel with no built-in separation. OWASP's LLM Top 10 has held prompt injection at #1 for two consecutive editions. Here is why — and the layered defense that actually works.

Prompt InjectionLLM SecurityOWASPAI AgentsDefense in Depth

Prompt injection has held the top spot on the OWASP Top 10 for LLM Applications for two consecutive editions. The reason is structural, not incidental. LLMs process instructions and the data they are working on through the same channel, with no built-in separation between the two. When a model reads “here is an email, summarise it” followed by the actual email text, it has no hard boundary telling it that everything after a certain point is data, not commands. If the email contains something that looks like an instruction, the model cannot reliably tell the difference.

OWASP is direct about the consequence: you cannot patch your way out of prompt injection. It exploits how LLMs fundamentally work, not a specific bug you can fix once. As anything agentic gets wired to these models, email access, file-system access, API credentials, the ceiling on what a successful injection can achieve rises sharply.

Key Takeaways
  • Prompt injection has held the OWASP Top 10 for LLM Applications #1 spot for two consecutive editions because it exploits how LLMs fundamentally work, not a specific bug.
  • At one injection attempt the success rate is 4.7%. At one hundred attempts it climbs to 63%. This is the argument for defense in depth and monitoring, not just a single good filter.
  • The ceiling on impact scales directly with what the compromised model is allowed to do. An agent with email, file-system, and API access has a much higher ceiling than a read-only chatbot.
  • You cannot patch your way out of prompt injection. Mitigation requires layering: content segregation, least-privilege tooling, human approval for irreversible actions, input/output filtering, and regular red-teaming.
01

HOW IT WORKS

#
DIRECT INJECTIONUser types into chatMALICIOUS INSTRUCTION"Ignore previous instructions and..."LLM processes combined inputFollows attacker instructionEasier to detect — input comes directly from userINDIRECT INJECTIONAttacker embeds in external contentwebpage · email · doc · Slack messageHIDDEN INSTRUCTION INSIDE CONTENTAgent reads content on your behalfTakes real action you never authorisedHarder to detect — you trusted the content source

Direct injection

A user explicitly types a malicious instruction — the classic pattern is asking a chatbot to disregard its prior instructions and reveal internal configuration. This is the version most people picture, and it is the easier of the two to defend against, because the input comes directly from a user you can apply scrutiny to.

Indirect injection — the one that actually matters for anything agentic

The attacker types nothing into your chat. Instead, they embed malicious instructions inside content the model will later process on your behalf: a webpage, a document, an email, a support ticket, a Slack message. When your AI assistant reads that content — to summarise, triage, or review — it can encounter those embedded instructions and follow them as if they came from you. From the model’s perspective, text is text.

This is precisely what happened in the documented Slack AI incident: malicious instructions hidden in ordinary Slack content caused the AI integration to exfiltrate information it should not have accessed. The attack surface is not the model — it is the model’s pipeline of untrusted content.

02

THE NUMBERS

#

Anthropic’s own published system card for Claude Opus 4.5 provides one of the more concrete, quantified pictures of real-world injection resistance in an agentic coding environment:

0%20%40%60%80%4.7%1 attempt33.6%10 attempts63%100 attemptsIndirect prompt-injection attack success · Claude Opus 4.5 · Agentic coding environment · Anthropic System Card

Two things worth taking from that data. First, single-attempt defenses genuinely work most of the time — a 4.7% success rate at one attempt means a casual attacker hits a wall more than 95% of the time. Second, an attacker who can make many attempts — an automated, repeated attack against a production system — sees success rates climb to 63% at a hundred tries. That is the actual argument for defense in depth and monitoring, not just a single good filter.

The ceiling on impact scales directly with what the compromised model is allowed to do. A chatbot with no tool access and no memory of sensitive data has a low ceiling on what a successful injection can achieve. An agent with email access, file-system access, and API credentials has a very different ceiling. This is why prevention has to focus as much on limiting what a model can do as on stopping it from being tricked in the first place.

Instruction override

Model ignores original guidance and follows attacker instructions instead.

Data exfiltration

Sensitive content the model can access — system prompt, documents, connected-account data — gets surfaced to the attacker.

Unauthorised tool calls

In an agentic system, a successful injection can trigger real actions: send email, modify files, call APIs — using the agent's own legitimate permissions.

System prompt leakage

Attacker extracts the hidden instructions that shape the application's AI behaviour, enabling more targeted follow-on attacks.

Downstream chain corruption

In a multi-step workflow, a single injected instruction early in the chain quietly corrupts subsequent steps that trust earlier outputs.

03

THE LAYERED DEFENSE

#

No single control solves this. OWASP’s own guidance is explicit that mitigation requires layering multiple defenses, because none of them is individually sufficient against a motivated, repeated attack. Each technique below reduces risk — stacked together, they reduce it substantially.

DEFENSE IN DEPTH — NO SINGLE CONTROL IS SUFFICIENTAdversarial testing — recurring cadence, not just pre-launchcatches novel vectorsInput / output filtering for known attack patternscatches known signaturesHuman approval for high-risk or irreversible actionsbackstop against any injectionLeast-privilege tooling — only what the task needslimits blast radiusSystem-level behavioral constraints + output format rulesreduces hijack surfaceSegregate untrusted content from instruction streamcommand ≠ data channelATTACKStack from outermost (bottom) to innermost (top) · OWASP LLM Top 10 2025 — LLM01

1 — Segregate untrusted content from the instruction stream

Structure prompts so untrusted content — a fetched webpage, an uploaded document, an email body — is visibly delimited as data to be processed, not blended into the instruction stream. This is the direct analogue to parameterised queries preventing SQL injection: separate the command channel from the data channel wherever the architecture allows it.

2 — System-level behavioral constraints

Define expected output formats and behavioral boundaries in the system prompt itself. A model instructed to only ever output a specific structured format has less room for an injected instruction to hijack the interaction into open-ended behaviour.

3 — Least-privilege tooling

This is the highest-leverage structural defense for anything agentic. Give a model or agent only the specific tools and access it needs for its actual task — nothing broader “just in case.” An agent that can only read a specific document has a low ceiling even if successfully injected. An agent with broad file-system, email, and API access has a much higher one. Same principle as row-level security in a database, applied to agent permissions.

4 — Human approval for high-risk or irreversible actions

For anything with real consequence — sending an email, making a purchase, deleting data, executing code against production — insert an explicit human-in-the-loop checkpoint rather than letting an agent act autonomously. This is the single most reliable backstop against an injection that clears every earlier filter.

5 — Input/output filtering

Scan for known attack patterns and known-bad output signatures on both sides. This catches what you have seen before — not novel attacks, which is exactly why it is one layer among several rather than a complete solution.

6 — RAG groundedness checks

For any RAG-connected system, assess context relevance and groundedness as a way of catching outputs that have drifted from what the retrieved content actually supports — a useful signal that something embedded in a retrieved document has pulled the model off-track.

7 — Adversarial testing on a real cadence

Conduct regular red-teaming and breach simulations — not a one-time pre-launch audit, but a recurring practice. The attack-success-rate data makes the argument: repeated attempts matter, and a single pre-launch test does not model a production attacker who gets a hundred tries. Open-source tooling (Promptfoo, Garak) exists specifically for this.

One misconception to clear directly

Grounding a model in retrieved data (RAG) or fine-tuning it on your own data does not close the prompt injection gap. Both are still vulnerable to malicious content smuggled into whatever they process. Defense in depth remains necessary regardless of whether you have also invested in RAG or fine-tuning for other reasons. These are separate problems.

04

WHERE THIS APPLIES NOW

#

Prompt injection is not a theoretical concern for a future AI product — it is a present concern for anything already wiring AI to external content. Four categories where the risk is immediate:

  • Anything processing untrusted external content. A webpage summariser, an email triage tool, a document reviewer, an n8n workflow reading inbound Slack messages — build these assuming the content might contain hidden instructions, not as an edge case to patch later.
  • n8n workflows with MCP Client Tool nodes or Tools Agent steps. Treat every external tool call as a potential injection vector if the data feeding that step originates from anything outside your direct control — an inbound email, a scraped page, a public API response.
  • Coding agents against real codebases. A malicious or compromised dependency, a poisoned README, or planted comments in a repo an agent is asked to review are all plausible indirect-injection vectors. Arbitrary repo content is external, untrusted content — treat it accordingly.
  • Any agentic system with permissions broader than the task requires. The access model is the amplifier. Start with least-privilege before you build the feature, not after you ship it.
Layered defense checklist
  • ·Untrusted content is explicitly delimited from the instruction stream
  • ·System-level behavioral constraints and expected output formats are defined
  • ·Any agent or tool-using system runs on least-privilege access, scoped to its task
  • ·High-risk or irreversible actions require explicit human approval
  • ·Input/output filtering is in place for known attack patterns
  • ·RAG-connected systems are evaluated for groundedness, not just fluency
  • ·Adversarial testing happens on a recurring cadence, not just pre-launch
  • ·No assumption that RAG or fine-tuning alone closes the injection gap

The attack surface is not the model — it is every piece of untrusted content you let the model touch, and everything you let it do with what it finds there.

Recommended Reading

OWASP Foundation · owasp.org

The industry-standard risk list for LLM deployments, with prompt injection ranked #1. Essential reading before shipping any LLM-powered feature.

Perez & Ribeiro · arXiv 2022

The first systematic study of prompt injection as an attack class, establishing the taxonomy that the security community now uses.

Ross Anderson · Wiley

The most comprehensive textbook on building secure systems. The chapters on protocol failures translate directly to LLM input/output design.

← Field Notes

Continue the conversation

If this changed how you think about it — or you think I'm wrong — I want to know.

Corrections, disagreements, and applications all welcome. Replies go directly to Chris.

Get in touch →
Field Notes · PodcastHost + Expert · Gemini TTS

THE SAME CHANNEL

~6-8 min

1× · Two speakers · tap to play