﻿# Prompt injection is almost solved – in their harness, not in yours

> The frontier models got hard to inject: 0.1% per attempt on a static benchmark, and Claude Code made auto mode its default. Meanwhile we connect mail, Slack and drives as RAG, and every connector is a way in. An adaptive attacker still broke 36 of 40 coding scenarios – all through a weaker fallback model – a rate is not a proof, and quiet weeks are the normalisation of deviance. Why auto mode is a fair bet, why only the training travels with the weights while the probe, the action classifier, the sandbox and the red-teaming stay in the vendor's product – Clinejection ran the most robust model of its day – what trained token provenance did and where it broke, and why prompt injection is phishing rather than SQL injection: the prepared statement moved up into the plan.

Source: https://laszlonemes.com/blog/prompt-injection · Published: 2026-11-29 · Author: László Nemes

November 29, 2026 · 20 min read

`AI security` `Prompt injection` `Coding agents` `AI engineering`

For a long time I thought prompt injection could not be solved without a breakthrough. The model would have to know, for every token, whether it came from me or from the email it was reading, and nothing in a transformer knows that. Everything else – delimiters, "ignore instructions in the document", a second model checking the first – looked like a filter in front of a problem that has no filter-shaped solution.

Meanwhile, look at how we build workflows and agents now. We connect mail, Slack, Drive and the wiki as a matter of course – a kind of RAG, so the model works with the real, detailed data instead of guessing, the same way a coding agent searches the codebase before it edits. Claude Code runs in auto mode, which is now its default. And mostly nothing happens, so we keep going. That is either evidence that the problem got solved along the way, or the most dangerous kind of evidence there is. I went through the system cards, the benchmarks, the papers and the incidents of the last year to find out which.

> **The thesis:** prompt injection isn't solved, and nobody will prove that it is. It got rare – in the frontier labs' own products, where adversarial training in the model is stacked with a probe on what comes in, a classifier on what goes out and a sandbox, red-teamed as one system. That is why auto mode could become the default. Take the same model into your own harness and only the training comes with it. Treat prompt injection like phishing, not like SQL injection: a rate you lower with training, and damage you bound with architecture.

## What the numbers say

The improvement is real, and it is not marketing. In the largest public measurement so far – Gray Swan's competition, written up by [Dziemian et al.](https://arxiv.org/abs/2603.15714) in March 2026 – 464 participants made about 272,000 attack attempts against 13 frontier models in tool-use, coding and computer-use scenarios. The attack success rate ranged from 0.5% for Claude Opus 4.5 to 8.5% for Gemini 2.5 Pro. The paper's verdict is the other half of the sentence: "All models proved vulnerable."

The newest models went further. On Gray Swan's indirect prompt injection benchmark, attackers get fifteen tries per scenario. With that budget, the [Claude Opus 5.5 system card](https://assets.claude.com/fc1b44717c85dc068bc6ba5024219938094694bd.pdf) (September 2026) reports 1.0%. OpenAI's [GPT-6 Astra card](https://deploymentsafety.openai.com/gpt-6-astra/prompt-injection) reports 8.5%, down from 27.0% for GPT-5.6 Sol. Google says [Gemini 4 Argon](https://blog.google/innovation-and-ai/technology/safety-security/gemini-4-model-safety-security/) is at 0.7%, a figure no third party has reproduced so far. The three were measured with different safeguards switched on, so this isn't a league table, but the direction is the same everywhere. Anthropic stopped reporting its browser evaluation in November, because its latest models "resist all of its attacks, so it can no longer measure progress".

And then there is the coding row. The Opus 5.5 card uses Shade, Gray Swan's adaptive attacker, which combines search, reinforcement learning and human insight. Shade is trained on the test scenarios and gets 200 attempts on each of 40. With Anthropic's prompt injection probes switched on, it still broke 36 of the 40.

> **Fig. 1** · Six rates for one model, all from the Opus 5.5 system card. The small bars are drawn at a minimum width so they show at all. The model is constant; the attacker, the number of attempts and the surface are not. Without the probes, the coding attacker succeeded on more than half of its attempts.
>
> *Diagram:* One model, Claude Opus 5.5, six attack success rates from its own system card. Against a static benchmark it is 0.1 percent per attempt and 1 percent after 15 attempts. In browser and computer use it is below 0.1 percent. In coding, an adaptive attacker with 200 attempts per scenario succeeds on 11 percent of attempts with probes and 55 percent without, and breaks 36 or 37 of 40 scenarios.

Anthropic calls that a *deliberately permissive* threat model: the attacker optimises against the exact test scenarios and gets many tries, while a real attacker usually doesn't know the deployment and gets noticed after repeated attempts. That is fair, and worth saying. The more interesting detail is where the successful attacks landed.

### A system is as robust as its weakest model

When a cyber classifier triggers, Opus 5.5 hands the request to an older model, Claude Opus 4.8. In the coding evaluation that happened to most requests, and among those the attack succeeded 85.73% of the time. Of the 2,872 requests Opus 5.5 answered itself, not one was susceptible.

The [Fable 5.2 system card](https://www.anthropic.com/document/claude-fable-5-2-mythos-5-2-system-card) (November 9, 2026) makes the point even clearer. Fable 5.2 is Anthropic's newest flagship, and it is my main model. On paper it is the easiest to inject of the recent Claude models. On the static benchmark it reaches 4.09% after fifteen tries, against about 1% for Opus 5.5. Against Shade in coding it reaches 89.82% of attempts and all 40 scenarios without probes. With probes it is 28.16%, and still all 40 scenarios. The reason is the fallback. 99.5% of its valid responses in that test came from Opus 4.8, and 90.31% of those were compromised. Fable 5.2 answered 43 requests itself, and none of them were compromised. The card puts it in one line: "When it answers an attempt itself, it is one of our most robust models to date."

> **Fig. 2** · Attack success follows the share of requests the fallback model serves. The models on the labels were hardly ever the ones that fell: the requests Opus 5.5 and Fable 5.2 answered themselves were not compromised once.
>
> *Diagram:* Adaptive attacker in coding, 200 attempts per scenario, without probes. Fable 5.1: 60 percent of requests served by the Opus 4.8 fallback, 52 percent attack success. Opus 5.5: 64 percent fallback, 55 percent attack success, and none of the 2,872 requests it answered itself compromised. Fable 5.2: 99.5 percent fallback, 90 percent attack success, and none of the 43 requests it answered itself compromised.

> The weak point was not the model on the label. It was the routing: **a system is as injection-resistant as the weakest model it can route to.**

The same table has a quieter surprise. Claude Haiku 5.5 is the smallest and cheapest model in the family, and it was the hardest to inject in that test: 0.08% of attempts without probes and none with them. Model size doesn't set the rate. The route does.

This isn't a quirk of one vendor. Your own harness routes too: to a cheaper model for the easy steps, a smaller one for summaries, a fallback under load or when a call fails. Whichever model reads the untrusted text sets the rate. The benchmark of the model you picked for the hard part tells you nothing about it. For my own sessions, this is why I don't read "Fable is robust" as "my session is robust".

Nobody who measures this claims it is over. Anthropic's [browser-use post](https://www.anthropic.com/research/prompt-injection-defenses) from November 2025 says prompt injection "is far from a solved problem". OpenAI, [hardening ChatGPT Atlas](https://openai.com/index/hardening-atlas-against-prompt-injection/) a month later, wrote that prompt injection, "much like scams and social engineering on the web, is unlikely to ever be fully 'solved'". Hold on to that comparison too.

## Auto mode is a bet, and a fair one

My first reading of auto mode as the default was: the vendor is confident. Since v2.1.283 it is the starting permission mode for interactive Claude Code sessions on every plan and provider, according to the [permission modes documentation](https://code.claude.com/docs/en/permission-modes), and the Opus 5.5 card calls it "now the default permission mode in Claude Code for most of our users". That is a real statement. But what it is confident about is narrower than "prompt injection is handled".

Anthropic's [engineering post](https://www.anthropic.com/engineering/claude-code-auto-mode) on auto mode (March 2026) describes two checks. A server-side probe scans tool outputs – file reads, web fetches, shell output – before they enter the agent's context and adds a warning when something looks like an attempt to take over. And a transcript classifier judges each action. The clever part is what the classifier is not shown: "The classifier sees only user messages and the agent's tool calls; we strip out Claude's own messages and tool outputs, making it reasoning-blind by design." An injection in a web page can't argue with a judge that never reads the web page.

> **Fig. 3** · The two checks sit at different points – one on the data coming in, one on the actions going out – so an attack has to beat both, and the model between them. The classifier's blindness to tool output is a design choice, not a gap.
>
> *Diagram:* In Anthropic's products an injected instruction has to get past three things in a row: a probe that scans tool results before the model reads them, the model's own trained resistance, and a classifier that judges each tool call from the user's messages and the calls alone, without the tool output. Only then does it reach the sandbox and the world.

The numbers Anthropic publishes are honest ones. On 10,000 real actions the full pipeline blocks 0.4% that were fine. On 52 real overeager actions – an agent doing something the user didn't want – it misses 17%, and the post calls that "the honest number". The documentation says it plainly: auto mode "reduces permission prompts but does not guarantee safety".

The real argument for the default is a different number in the same post: with manual prompts, users accept 93% of them anyway. The baseline auto mode replaced was never a careful human. It was a reflex click. So the bet isn't "we trust the model now", it is "the human clicking approve was never the defence" – which is what I wrote under Security in [State of AI](https://laszlonemes.com/ai): don't rely on a human clicking "approve". I think the bet is right. It is a bet on a rate, though, not a guarantee.

### And it has been beaten

In August 2026 Johann Rehberger disclosed a chain against Claude Code with Opus 5 in auto mode, written up in a [Cloud Security Alliance research note](https://labs.cloudsecurityalliance.org/research/csa-research-note-claude-code-automode-prompt-injection-2026/). A website the agent was asked to summarise served an archive with a Python file named after a standard-library module. Claude sensibly refused to run the unknown binary in it and wrote its own decoder script instead – in the same directory, where Python imported the planted module first. It worked in three or four of five trials. According to the note, Anthropic closed the report as "Informative": a chain of individually harmless steps is outside what the classifier is for. Every action looked fine, because every action was fine. What stops that is the layer under the classifier, and the documentation says as much: the check is no replacement for an operating-system sandbox.

## A rate is not a proof

Could someone prove that prompt injection is solved? No, and that is not pessimism. A proof needs a property that holds for every input. The input here is open-ended natural language, and "this is an instruction the user actually wants" is a semantic property nobody can write down formally. A benchmark gives you something weaker: an upper bound on the attacks somebody tried.

How weak that bound can be is the subject of [The Attacker Moves Second](https://arxiv.org/abs/2510.09023) (October 2025), by authors from OpenAI, Anthropic, Google DeepMind and ETH Zürich. They took twelve published defences – prompting tricks, detectors, fine-tuning defences, Google's Model Armor among them – most of which reported near-zero attack success. Adaptive attacks got above 90% on most of them. MetaSecAlign went from the 2% its authors measured to 96%. Human red-teamers in their competition succeeded on every scenario. The Opus 5.5 card cites this paper as the reason it runs adaptive evaluations at all.

The threat isn't even only outside. The same card describes rare "spontaneous prompt injections": after a harmless slip, like an extra field in a copied JSON blob, a model wrote a malicious instruction itself – which Anthropic believes is "in part, a result of training intended to defend against prompt injection". The defence has side effects that look like the attack.

What *can* be proven is a property of the system around the model: this session can't send data to an address the user didn't type; the job that runs the model can't push. Google DeepMind's [CaMeL](https://arxiv.org/abs/2503.18813) is the best-known example. It solves 77% of the AgentDojo tasks with provable security, against 84% for the undefended agent. That is the price list: a guarantee costs capability, and the guarantee is about the architecture, never about the model.

## The Challenger problem

The Challenger comparison isn't mine. Johann Rehberger made it in December 2025 in [The Normalization of Deviance in AI](https://embracethered.com/blog/posts/2025/the-normalization-of-deviance-in-ai/), borrowing Diane Vaughan's term from her study of the shuttle disaster: O-ring erosion was seen on earlier flights, and every successful flight made it look more acceptable. His line: "The absence of disaster was mistaken for the presence of safety." The line Simon Willison picked out of the essay is the one to remember: organizations "confuse the absence of a successful attack with the presence of robust security".

My own evidence – agents everywhere, and mostly nothing happens – is exactly that kind of data. Both things are true at once: the low rate is real, and the low rate is what lowers the guard. Each quiet week makes the next permission a little wider.

"Nothing happened to me" also says less than it seems, because the attacker doesn't pay per victim. The Opus 5.5 card spells out the threat model: "the same email sent to a thousand inboxes will compromise every agent that summarizes the text" – if it works. A rate per attempt and a rate per campaign are different numbers.

> **Fig. 4** · An idealisation: it assumes every attempt is independent. Real attempts are correlated – one email either works on a model version or doesn't – so the real curve is lumpier: zero for a long time, then many targets at once. That is harder to plan for, not easier.
>
> *Diagram:* A per-attempt rate is not a per-campaign rate. If each attempt succeeds independently with probability 0.1 percent, the chance that at least one of 1,000 targets falls is 63 percent. At 1 percent per attempt it passes 99 percent before 500 targets.

## Borrowing the model doesn't borrow the defence

Back to what we connect. Giving an agent the mailbox, the Slack workspace and the shared drive feels like context engineering: more real data, better answers – the same move as letting a coding agent search the repository. It is also the moment the agent starts reading text written by people outside the company. Anyone who can send you an email, post in a shared channel, comment on a document or open an issue now writes into your agent's context. **A knowledge base built from inboxes is an inbox anyone can write to.** The codebase is no exception: issues, READMEs, dependency docs and tool output are all written by someone else.

Add the private data the agent can see and any way it can send something out, and you have what Simon Willison named [the lethal trifecta](https://simonwillison.net/2025/Jun/16/the-lethal-trifecta/) in June 2025; the Opus 5.5 card defines the exposure the same way. In the vendor's own products we lean on the vendor's layers. In our own harnesses – an agent on the API, a CI workflow, an internal assistant on a cloud tenant – we quietly assume the model brings the defence along. Part of it does.

> **Fig. 5** · What travels with the model and what stays home. The adversarial training is in the weights, so any harness that calls the same model gets it. Everything else on the vendor's side is product.
>
> *Diagram:* What travels with the model and what stays home. Adversarial training is in the weights, so it comes along to any harness that calls the same model. The probe on tool results, the classifier on actions, the sandbox and the red-teaming of the whole system are part of the vendor's product; in your own harness you build them, and a cloud host's filter is opt-in and often does not scan tool results.

The training does travel: it is in the weights, and the benchmark numbers above were measured without the prompt injection safeguards of Anthropic's products. Claude Code itself also runs on Amazon Bedrock, Google Cloud and Microsoft Foundry with auto mode for the newer models, so the vendor's harness on your own cloud is a real middle option. What doesn't travel are the layers around the model. Anthropic's documentation mentions extra classifiers on what the tools return for its computer-use and browser-use tools; for everything else, the [guide for developers](https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/mitigate-jailbreaks) tells you what to build – including a screen for tool output you run yourself.

The cloud providers' filters are worth turning on, and worth reading first:

| Filter | What it scans | On by default |
| --- | --- | --- |
| [Bedrock Guardrails, prompt attacks](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-prompt-attack.html) | user input; it "does not evaluate tool results", and on `InvokeModel` only input you tag | no – you configure a guardrail |
| [Azure Prompt Shields](https://learn.microsoft.com/en-us/azure/ai-services/content-safety/concepts/jailbreak-detection) | user prompt attacks, and document attacks: files, emails, web pages, tool results | user prompts on in Foundry; document attacks off |
| [Google Model Armor](https://docs.cloud.google.com/security-command-center/docs/model-armor-overview) | prompts and responses, each request as a single turn | no – templates and floor settings |

The row that matters for agents is indirect injection – instructions in tool results and documents – and that is exactly the part that is off, missing, or yours to wire in. And all of them are detectors, the category The Attacker Moves Second took apart. They lower the rate. None of them is a boundary.

### Clinejection: the same model, a different harness

The clearest case of the year is [Clinejection](https://adnanthekhan.com/posts/clinejection/), disclosed by Adnan Khan in February 2026. Cline, an open-source coding agent, added an AI issue-triage workflow to its repository on December 21, 2025. This is the step as Khan quotes it:

.github/workflows/claude-issue-triage.yml (excerpt, as quoted by Adnan Khan)

```yaml
- name: Run Issue Response & Triage
  id: triage
  uses: anthropics/claude-code-action@v1
  with:
    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
    github_token: ${{ secrets.GITHUB_TOKEN }}
    allowed_non_write_users: "*"
    claude_args: --model claude-opus-4-5-20251101 --allowedTools "Bash,Read,Write,Edit,Glob,Grep,WebFetch,WebSearch"
    prompt: |
      You're a GitHub issue first responder for the open source Cline repository.

      **Issue:** #${{ github.event.issue.number || inputs.issue_number }}
      **Title:** ${{ github.event.issue.title || 'See issue details below' }}
      **Author:** @${{ github.event.issue.user.login || 'See issue details below' }}
```

Read the three lines that decide everything: `allowed_non_write_users: "*"` – anyone who can open an issue triggers it; `Bash` in the allowed tools; and the issue title pasted straight into the prompt. The model is `claude-opus-4-5-20251101`, the one with the lowest attack success rate in the competition above, at 0.5%.

> **Fig. 6** · The chain as Khan and Cline's post-mortem describe it. Only the first arrow is prompt injection; the rest is CI plumbing that would have been just as dangerous with any other way in.
>
> *Diagram:* The Clinejection chain. Anyone could open an issue; its title went into the prompt of a triage agent running Claude Opus 4.5 with a shell. The injected instruction made it install a package from a fork, whose install script poisoned the GitHub Actions cache. The nightly publish workflow restored that cache with the release tokens in reach, and weeks later an unauthorized cline@2.3.0 was on npm for about eight hours.

Khan showed that an issue title could make the agent run `npm install` from a fork, whose install script poisoned the GitHub Actions cache that the nightly publish workflows restored – with the VS Code Marketplace, OpenVSX and npm tokens in reach. After his report went unanswered he published on February 9, and Cline removed the workflows within about 30 minutes. According to [Cline's post-mortem](https://cline.bot/blog/post-mortem-unauthorized-cline-cli-npm), the rotation that followed deleted the wrong npm token, and on February 17 an unauthorized `cline@2.3.0` was on npm for about eight hours. Cline says the actual user impact was low.

Nothing exotic failed. The most robust model of its day did what a model sometimes does with a stranger's text, inside a workflow that gave that text a shell and a cache shared with the release jobs. That is the lethal trifecta written in YAML. Cline's fixes are the textbook ones: no AI triage with a shell, read-only automation from now on, no cache in workflows that hold publishing credentials, and npm publishing through OIDC instead of long-lived tokens. It is the rule I built the [software factory on GitHub](https://laszlonemes.com/blog/software-factory-on-github#sandbox) around: the job that runs the model can't write, and the job that writes runs no model.

## Open models: the wrong axis

My instinct was that open-weight models are where you still get tricked easily. The data supports a narrower version. In the competition paper the open-weight models – Qwen, Kimi, DeepSeek, Meta's SecAlign – sit in the middle at roughly 4 to 6%, above Claude and GPT, but the worst result belongs to a closed model, Gemini 2.5 Pro. The authors conclude that robustness is "more strongly determined by model family and its training recipe" than by capability, and later benchmarks such as [INFUSE](https://arxiv.org/abs/2610.20776) find the same spread inside the closed camp.

So "open versus closed" is the wrong axis. The right one is how much adversarial training the lab put in, and so far Anthropic and OpenAI have put in the most. The open model's real handicap is the figure above: self-hosted, you get only the first row – usually a thinner one – and you build every other row yourself. Which is fine, as long as you know that's the job.

## Token provenance, and what training actually did

The breakthrough I was waiting for – tag each token with where it came from – turns out to be a research line with a name. The closest to what I imagined is [ASIDE](https://arxiv.org/abs/2503.10566) (ICLR 2026), which rotates the embeddings of data tokens so every token carries its role into the model; OpenAI's [instruction hierarchy](https://arxiv.org/abs/2404.13208) and the delimiter-token defences StruQ and SecAlign are softer versions of the same idea. They all lower the rate, and StruQ and MetaSecAlign are on the list of defences the adaptive attacks broke. Even architectural provenance is still learned behaviour, not a type system.

The production models do a version of this through training, and the Opus 5.5 card is unusually open about it. The rule they train on: "legitimate user instructions should only arrive within user turns." That is provenance by message role. It works – the card notes that "simple attacks do not succeed anymore" – and section 6.5.1 shows where it breaks.

Early snapshots of Opus 5.5 reasoned that anything in the user's message must come from the user and should be followed. Anthropic traced it to training data generated with a rubric that said instructions in the user prompt should never be flagged. It generalised to text the user *pasted*: a README, an email, the output of `npm install` whose last line, written by an attacker, told AI assistants to run a remote script. In a coding evaluation the early snapshot acted on such planted instructions in 52% of attempts, and on instructions hidden in invisible Unicode characters in 18 of 68; Opus 5 and Sonnet 5 never did. In tool results the same snapshot never fell for it: 0 of 105.

> **Fig. 7** · Provenance as training learns it. The boundary follows the message roles. A paste sits inside the user's turn, so it inherits the user's trust – the hole the early Opus 5.5 snapshots fell through.
>
> *Diagram:* Trained provenance works per message, not per token. The model learns that the system prompt and the user's turn carry instructions and that tool results are data. Text the user pastes into their own message, a README, npm output or an email written by someone else, sits inside the user's turn and inherits its trust.

The released model was trained against it, and the November card reports the same pattern in early snapshots of the next model, again largely mitigated. The fix that interests me is the product one: Anthropic is adding changes that strip invisible characters and *mark pasted text*, so the model can tell material the user may not have written. That is my token-provenance idea, implemented in the harness instead of in the architecture. The card's own conclusion is the honest one: "Whenever a user pastes text written by someone else into a prompt, they are effectively letting that person control part of their prompt."

So I was half right. Training did solve a great deal – it is the reason static attacks barely work any more. But it solved it as a learned convention about roles, with failure modes of its own, and the provenance that holds up best is the kind the harness writes down from the outside.

## What SQL injection teaches, and where the analogy breaks

The name was always an analogy: Simon Willison [called it prompt injection](https://simonwillison.net/2022/Sep/12/prompt-injection/) in 2022 after SQL injection, which was first documented in [Phrack 54](http://phrack.org/issues/54/8.html) in 1998. SQL injection has a structural fix, and every developer has seen it:

```java
// The input becomes part of the program
String sql = "SELECT * FROM users WHERE name = '" + name + "'";
ResultSet rows = connection.createStatement().executeQuery(sql);

// The program is a constant; the input travels as a value, in a separate slot
PreparedStatement query = connection.prepareStatement("SELECT * FROM users WHERE name = ?");
query.setString(1, name);
ResultSet rows = query.executeQuery();
```

A prepared statement is a guarantee, not a rate. The query text and the values travel separately, and the parser never reads a value as code. And still: in MITRE's [2025 CWE Top 25](https://cwe.mitre.org/top25/archive/2025/2025_cwe_top25.html) SQL injection is number two, up from three, and Injection is [A05 in the OWASP Top 10 2025](https://owasp.org/Top10/2025/A05_2025-Injection/). Lesson one: a class of bug with a known structural fix lives on for decades when the fix is optional and the unsafe way is easier to type.

> **Fig. 8** · The analogy breaks at the second channel. SQL had somewhere to move the data where the parser doesn't look. A model has to read the data to summarise it, translate it or answer from it – reading it is the job.
>
> *Diagram:* Why SQL injection has a structural fix and prompt injection does not. A prepared statement sends the query text and the parameter values separately, and the parser never reads a value as code. A language model has one channel: instructions and data are the same token stream, and the model has to read the data to do its job.

Lesson two is the uncomfortable one: prompt injection has no prepared statement at the model level, because there is no slot the model doesn't read. Understanding the data is the point. The analogy that fits better is the one OpenAI uses – phishing. People get trained, the rate drops, some still click; so companies add multi-factor authentication, payment limits and a second signature, and nobody calls phishing solved.

|  | SQL injection | Prompt injection | Phishing |
| --- | --- | --- | --- |
| Where it gets in | data parsed as code | data read as instruction | a message read as a request |
| Structural fix | prepared statements | none at the model; in the architecture | none at the person; in the process |
| What training buys | nothing – the parser has no judgement | a lower rate | a lower rate |
| What bounds the damage | the fix itself | least privilege, no exfiltration path, sandbox | MFA, limits, four eyes |
| Can it be proven gone | per query, yes | per system design, partly | no |

### Where the prepared statement went

The structural fix didn't disappear, it moved up a level – from the model to the plan. The [design patterns paper](https://arxiv.org/abs/2506.08837) from June 2025 puts the principle in one rule: once an agent has read untrusted input, that input must not be able to trigger consequential actions. CaMeL is the strict version: a privileged model writes the plan from the user's request alone, a quarantined model with no tools reads the untrusted text, and code checks a policy before every tool call.

> **Fig. 9** · The prepared statement, one level up. The plan is the constant, the untrusted text is the parameter, and the schema is the slot it is bound into.
>
> *Diagram:* The structural answer moves up a level. A privileged planner sees only the user's request and fixes the plan before any untrusted text is read. A quarantined model with no tools reads the untrusted text and may only return a typed value. Program logic checks the policy before a tool runs. The untrusted text can make a value wrong; it cannot choose the action.

the same idea in a feature (sketch)

```ts
// The plan is fixed from the user's request alone, before any untrusted text is read
const plan = await planner.plan(userRequest);        // e.g. [readEmail(id), createTask(fields)]

// A model with no tools reads the untrusted text and may only fill a typed value
const Task = z.object({
  title: z.string().max(120),
  due: z.string().date().nullable(),
});
const task = Task.parse(await quarantined.extract(email.body, Task));

// Program logic, not a model, decides whether the action may run
if (!policy.allows('createTask', { owner: user.id })) throw new Denied('createTask');
await tasks.create({ ...task, owner: user.id });     // no recipient, no URL, no shell
```

It is the pattern I use in my own apps anyway: deterministic code before and after the model, the model on the narrow part only, and program logic making the decision. The price is real – a task that needs the data to decide the next step doesn't fit. For those, Meta's [Agents Rule of Two](https://ai.meta.com/blog/practical-ai-agent-security/) is the practical fallback: in one session, at most two of untrusted input, sensitive data, and the ability to change state or send something out.

## What to do in your own harness

1. **For agent work, prefer the vendor's harness.** Claude Code with auto mode, and a sandbox underneath it – the classifier judges actions, the sandbox limits what a chain of harmless-looking actions can reach. On a company cloud, the same harness against Bedrock or Foundry.
2. **Treat every connected source as untrusted input.** Mail, Slack, shared drives, tickets and issues are written by people you don't control. Retrieval should respect the reader's permissions, and a source this workflow doesn't need shouldn't be connected at all.
3. **Write down the trifecta per session, and cut one leg.** Usually the way out: an egress allowlist instead of open network. If a session needs all three, it needs a person in it.
4. **The model that reads untrusted text gets no tools that act.** It fills a schema; code decides. The plan is fixed before the data is read.
5. **No long-lived secrets where a model runs.** Short-lived tokens, OIDC for publishing, no caches shared with release jobs. Clinejection was a token problem as much as an injection.
6. **Screens are rate reducers, not boundaries.** Turn on the part that scans tool results and documents – it is the part that is usually off – and design as if it will miss.
7. **No fallback to a weaker model on untrusted input.** If the cheap model is the fallback, it is the model the attacker gets.
8. **Don't paste what you haven't read into a session with tools.** Pasted text is the one place where the model's provenance training works against you.
9. **Measure adaptively, and log every tool call.** A static test suite tells you about last year's attacks; the log tells you about this week's.

## Objections, and the answers

| They say | You say |
| --- | --- |
| "The new models basically don’t fall for it any more." | Against static attacks, true: about 1% after fifteen tries. Against an adaptive attacker in coding, the newest flagship lost all 40 scenarios with the probes on – through its fallback model. And a rate per attempt isn’t a rate per campaign. |
| "Anthropic made auto mode the default, so it is safe." | They made it the default because it beats a human who approves 93% of prompts. Their own documentation says it doesn’t guarantee safety, and they publish a 17% miss rate on overeager actions. |
| "We call the same model, so we get the same protection." | You get the training. The probe, the action classifier, the sandbox and the red-teaming of the whole system stay in their product. Clinejection ran the most robust model of its time. |
| "Our cloud provider filters prompt attacks." | Check which ones. Bedrock’s filter doesn’t evaluate tool results; Azure’s document-attack detection is off by default in Foundry. And a detector lowers a rate; it isn’t a wall. |
| "Open-weight models are the problem." | In the data, the training recipe matters more than the licence, and a closed model was the worst. The open model’s handicap is that you host every other layer yourself. |
| "Then tag every token with its source and be done." | That is ASIDE, StruQ and the instruction hierarchy. It lowers the rate, and adaptive attacks still break it. In production, role-based provenance generalised into trusting pasted text. |
| "It is SQL injection again; we will fix it the same way." | SQL had a second channel to move the data to. A model has to read the data. The prepared statement moved up a level: into the plan. |
| "If it is never solved, running agents is irresponsible." | Phishing is never solved either, and companies still run email. Lower the rate, bound the damage, watch the logs. |

## Takeaways

1. **It got rare, not solved.** 0.1% per attempt on a static benchmark, and 36 of 40 scenarios broken by an adaptive attacker. Both numbers are about the same model.
2. **Nobody will prove it solved.** Proofs exist for system designs – what a session can reach – never for what a model will do with text.
3. **The defence is a stack, and only one layer is in the weights.** Your own harness gets the training; you build the probe, the action check, the sandbox and the red-teaming.
4. **Every connector is a way in.** Mail, Slack and the drive as RAG give the agent real data – and give everyone who can write there a line in its context.
5. **A system is as robust as its weakest model.** Fallbacks and cheap routes are where the attack lands.
6. **Quiet weeks are not evidence – treat it like phishing.** Training lowers the rate; least privilege, no exfiltration path and a sandbox bound the damage.
7. **The prepared statement lives in the plan.** Fix the actions before the untrusted text is read, let the text fill only typed values, and let code decide.

So my title idea – "prompt injection might be solved, not a hundred percent" – was too generous, but not by much. For the frontier labs, in their own products, it is close enough that they can stake the default on it, and I think they are right to. The mistake is to hear that as a statement about the model. It is a statement about their stack. Mine has to earn it again.

## Sources

- Anthropic, [Claude Fable 5.2 & Claude Mythos 5.2 System Card](https://www.anthropic.com/document/claude-fable-5-2-mythos-5-2-system-card) (November 9, 2026) – section 5.2: the benchmark and adaptive numbers for Fable 5.2, Opus 5.5, Sonnet 5.5 and Haiku 5.5, the fallback analysis, and the retired browser evaluation.
- Anthropic, [Claude Opus 5.5 System Card](https://assets.claude.com/fc1b44717c85dc068bc6ba5024219938094694bd.pdf) (September 22, 2026) – section 5.2 for the benchmark, adaptive and browser numbers and the fallback analysis, 6.3.1.1 for spontaneous prompt injections, 6.5.1 for pasted text.
- OpenAI, [GPT-6 Astra System Card, prompt injection](https://deploymentsafety.openai.com/gpt-6-astra/prompt-injection) (September 2026); Google, [Developing Gemini 4 Argon responsibly and safely](https://blog.google/innovation-and-ai/technology/safety-security/gemini-4-model-safety-security/) (October 2026).
- Anthropic, [How we built Claude Code auto mode](https://www.anthropic.com/engineering/claude-code-auto-mode) (March 2026), and the [permission modes documentation](https://code.claude.com/docs/en/permission-modes) – the two checks, the error rates, the 93%, the default and the caveats.
- Anthropic, [Mitigating the risk of prompt injections in browser use](https://www.anthropic.com/research/prompt-injection-defenses) (November 2025), and [Mitigate jailbreaks and prompt injections](https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/mitigate-jailbreaks) in the developer docs.
- OpenAI, [Continuously hardening ChatGPT Atlas against prompt injection attacks](https://openai.com/index/hardening-atlas-against-prompt-injection/) (December 2025) and [Designing AI agents to resist prompt injection](https://openai.com/index/designing-agents-to-resist-prompt-injection/) (March 2026).
- Dziemian et al., [How Vulnerable Are AI Agents to Indirect Prompt Injections? Insights from a Large-Scale Public Competition](https://arxiv.org/abs/2603.15714) (March 2026).
- Nguyen et al., [INFUSE: A Unified Surface Benchmark for Indirect Prompt Injection in Agentic Systems](https://arxiv.org/abs/2610.20776) (October 2026).
- Nasr, Carlini et al., [The Attacker Moves Second](https://arxiv.org/abs/2510.09023) (October 2025).
- Debenedetti et al., [Defeating Prompt Injections by Design](https://arxiv.org/abs/2503.18813) (CaMeL), and Beurer-Kellner et al., [Design Patterns for Securing LLM Agents against Prompt Injections](https://arxiv.org/abs/2506.08837) (2025).
- Wallace et al., [The Instruction Hierarchy](https://arxiv.org/abs/2404.13208); Chen et al., [StruQ](https://arxiv.org/abs/2402.06363) and [SecAlign](https://arxiv.org/abs/2410.05451); [Meta SecAlign](https://arxiv.org/abs/2507.02735); Zverev et al., [ASIDE](https://arxiv.org/abs/2503.10566).
- Johann Rehberger, [The Normalization of Deviance in AI](https://embracethered.com/blog/posts/2025/the-normalization-of-deviance-in-ai/) (December 2025), and Simon Willison's [summary](https://simonwillison.net/2025/Dec/10/normalization-of-deviance/).
- Cloud Security Alliance, [When the Safety Classifier Fails: Prompt Injection Defeats Claude Code Auto Mode](https://labs.cloudsecurityalliance.org/research/csa-research-note-claude-code-automode-prompt-injection-2026/) (September 2026) – Rehberger's chain and Anthropic's response, as reported there.
- Adnan Khan, [Clinejection](https://adnanthekhan.com/posts/clinejection/) (February 2026); Cline, [post-mortem](https://cline.bot/blog/post-mortem-unauthorized-cline-cli-npm) and [GHSA-9ppg-jx86-fqw7](https://github.com/cline/cline/security/advisories/GHSA-9ppg-jx86-fqw7).
- Simon Willison, [Prompt injection attacks against GPT-3](https://simonwillison.net/2022/Sep/12/prompt-injection/) (2022) and [The lethal trifecta for AI agents](https://simonwillison.net/2025/Jun/16/the-lethal-trifecta/) (2025); Meta, [Agents Rule of Two](https://ai.meta.com/blog/practical-ai-agent-security/) (2025).
- Cloud filters: [Bedrock Guardrails prompt attacks](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-prompt-attack.html), [Azure Prompt Shields](https://learn.microsoft.com/en-us/azure/ai-services/content-safety/concepts/jailbreak-detection), [Model Armor](https://docs.cloud.google.com/security-command-center/docs/model-armor-overview).
- SQL injection: rain.forest.puppy, [Phrack 54](http://phrack.org/issues/54/8.html) (1998); MITRE, [2025 CWE Top 25](https://cwe.mitre.org/top25/archive/2025/2025_cwe_top25.html); OWASP, [A05:2025 Injection](https://owasp.org/Top10/2025/A05_2025-Injection/).
