Axisdream
Written and Published byAxisdream·

Prompt Injection Is a Permission Problem

A document containing hidden instructions reaching into a tool call

Key Takeaways

  • •A model reads instructions and untrusted content in the same stream. Add tool access and a sentence in a webpage can become a command that does something.
  • •Examines why the model cannot tell instructions from data, analyzing the structural bottlenecks and trade-offs in real-world deployments.
  • •Provides engineering benchmarks and verification criteria for direct and indirect injection.

Australia's cyber security agency warned in November 2026 that prompt injection becomes more consequential when a model uses tools, executes code or takes autonomous action. That sentence describes the difference between a chatbot and an agent, and it is a difference of permission rather than capability.

A chat model that reads a malicious web page and repeats its instructions produces a bad answer. An agent with tool access that reads the same page can send email, delete files, call an API or push code. The observation generalises past open weights. It applies to any agent holding any credential, and the OWASP Top 10 for LLM Applications ranks prompt injection first among the risks it catalogues.

Why the model cannot tell instructions from data

A language model receives one sequence of tokens. The system prompt, the user's request, the retrieved document, the tool output and the web page content all arrive in that same sequence.

There is no hardware boundary between them. Frameworks add delimiters, role labels and structural markers to suggest which part is which, and those markers help, because models are trained to respect them. They are not enforcement. A document that contains text resembling a system instruction is, from the model's perspective, text that resembles a system instruction, and the probability it will be treated as one is not zero.

That is what makes prompt injection different from every prior injection class. SQL injection was solved at the boundary by parameterisation, which separates code from data at the parser. Here the code and the data are both natural language, and the parser is a neural network whose behaviour is a probability distribution rather than a rule.

Nobody has found the general fix. Systems that claim to resist injection are resistant to the injections their authors tested.

Direct and indirect injection

Direct injection is the case where the user attempts to override the system prompt. It is the version most discussed and the least dangerous, because the user is the party at risk and they already control the session.

Indirect injection is the important one. The malicious instructions arrive inside content the agent fetches during a legitimate task: a web page, a PDF, a calendar invite, a code comment, a skill's instruction file, a support ticket.

The agent has no reason to distrust that content, because retrieving it was the task. A summarisation agent asked to read a competitor's page and summarise it may encounter a passage instructing it to include the user's configuration in the summary. A coding agent reviewing a pull request may encounter a comment instructing it to add a workflow file. Both are doing their job when the instruction arrives.

The OWASP Top 10 for LLM Applications lists prompt injection as its first entry and excessive agency as a separate one, which is the right separation. Injection is how the attacker gets a foothold in the reasoning. Excessive agency is why the foothold matters.

Why tool access changes the consequence

A tool call is an instruction from the model to the outside world. The model does not need to be convinced of anything to make one. It needs to conclude that a call is the appropriate next step, and a malicious document can supply the reasoning that makes that conclusion reachable.

The severity then depends entirely on what the tool can do.

A read-only search tool limits the damage to disclosure of whatever the search can reach. A tool that writes files limits it to the workspace. A tool with an API token for a production service limits it to that service. A shell limits it to the permissions of the user running the agent, which on a developer laptop is usually broad.

The pattern is familiar from web security. The vulnerability is not that the attacker can send input. It is that the input reaches an interpreter with authority. Prompt injection is the input path, and the tool is the interpreter.

The confused deputy is the accurate frame

A confused deputy is a program with authority that is tricked into using that authority on behalf of someone who lacks it. An agent with a user's credentials, told by a document to fetch a URL, is a deputy that has been confused about whose instructions it is following.

The frame matters because it points at the fix. Confused deputy problems are solved by binding authority to the request that justified it, rather than by teaching the deputy to detect deception. An email agent acting on a user's request to summarise an inbox should be able to read mail, and should not be able to send mail, because the task did not require it.

That is capability scoping, and it is enforceable in a way that instruction detection is not.

Enforcement has to live outside the model

The design principle that follows is simple and unpopular: the boundary between the model and anything sensitive belongs outside the model.

If the agent's permission to send email is a sentence in the system prompt, an injection that convinces the model otherwise has removed the control. If the permission is a credential the process does not hold, no amount of convincing helps, because the operation will fail with an authorisation error.

Three mechanisms implement this in practice. The first is least privilege at the credential level, so the agent holds a token scoped to the task rather than to the account. The second is an approval gate outside the loop, where an operation classified as consequential is held until a human releases it, and the release happens in the gateway rather than in the conversation. The third is sandboxing, so code the agent runs cannot reach the host's file system or network beyond what the task requires.

Pinky, an open-source iPhone and Android control project, documents the second mechanism in a useful form: a gateway that enforces approvals for risky actions outside the model itself. That structure is worth copying precisely because the model never has the authority to grant itself permission.

What approval gates must actually do

An approval prompt inside the chat is theatre. The model writes it, the model can be persuaded to skip it, and the user's approval is a token in the same stream that the attack already occupies.

A real gate classifies actions before execution, holds the ones that exceed a threshold, and presents the request through a channel the model cannot write to. It also logs the release with the reason, so the audit trail shows what was approved rather than what the agent claims was approved.

The classification is the hard part. A payment is clearly consequential. A file write in a temporary directory is clearly not. Most activity sits between, and the classification rule decides whether the gate is a control or a nuisance that users learn to click through.

The useful default is to gate by irreversibility rather than by category. Reading, searching and drafting are reversible. Sending, deleting, paying, publishing and changing permissions are not, and the second list is short enough to enumerate.

What scanners cannot do

Scanners examine artefacts for known patterns. They are useful for finding a malicious skill, an unsafe dependency or a suspicious network destination before installation.

They are structurally unable to catch injection that arrives after installation, because the payload is in content fetched at runtime and does not exist when the scan runs. A clean scan is a statement about the files, and the attack is in the conversation.

The same limitation applies to model-level defences. Training a model to recognise malicious instructions raises the cost of an attack and does not remove the class, because the attacker's text and the defender's filter are optimised against each other and the attacker gets to try again.

The layered posture that survives

Four layers, each of which limits the blast radius of the others failing.

Scope credentials to the task, so a successful injection reaches one service rather than the account. Gate irreversible operations outside the model, so a successful injection reaches an approval queue rather than an action. Sandbox execution, so a successful injection reaches a container rather than a laptop. Log tool calls with their arguments, so a successful injection is visible in the record within minutes rather than discovered weeks later during an incident review.

None of those layers detects injection, and that is the point. Detection is unreliable, so the design assumption is that injection succeeds and the question becomes what it can reach.

The uncomfortable part for anyone building agents is that this posture costs capability. A broadly scoped agent is more useful than a narrowly scoped one, and every restriction adds a step. The trade is real, and the teams that take it deliberately at design time end up with a system they can defend, while the teams that add restrictions after the first incident end up rebuilding the permission model while production is running.

Related Dispatches