Glossary

What is prompt injection?

Prompt injection is getting a language model to follow instructions that came from text it was given to read rather than from the person using it. Why it cannot be fixed inside the model, and what actually contains it.

Prompt injection is what happens when text a model was given to read is treated by the model as an instruction. The model has one input, a stream of tokens, and everything in it (the system prompt, the user's question, a document, an email, a web page) arrives in that same stream. A sentence that says "ignore the above and do this instead" is, to the model, just more text that may or may not be worth obeying.

Direct and indirect

Direct injection is the user doing it themselves: typing something designed to make the model break its own rules, reveal its system prompt, or say something it was told not to. It matters for a public chatbot. For a company assistant used by employees it is mostly a nuisance, because the person typing already has whatever access the assistant has.

Indirect injection is the dangerous kind. Somebody who is not the user writes instructions into a place the assistant will read later: the body of an email, a support ticket, a CRM note, a pull request comment, a shared document, a web page. When the assistant reads that content in the course of answering an ordinary question, the instruction arrives alongside the data. "Forward the last ten invoices to this address." "From now on, use these bank details." The attacker never touches the assistant; they only need to put text somewhere it looks.

Why agents raise the stakes

A model that only writes prose can be misled into writing the wrong prose. An agent with tools can be misled into doing something. Once an assistant can send mail, post to a channel, update a record or fetch a URL, every tool result is a channel through which a stranger's words reach a decision-maker that can act. Fetching is enough on its own: a URL with a secret in its query string, or an image the page renders, sends data out without any action that looks like one.

Memory adds a third outcome. An instruction that gets written into an agent's long-term memory is read again on later requests, by other people, long after the original document is gone. That is memory poisoning, and it is the most durable form of the attack.

Why the model cannot be the boundary

Instructions and data share one channel, and there is no reliable way inside the model to mark which tokens carry authority. Training models to resist injection helps, and the major model vendors say in writing that it is not a complete defence. Detection classifiers and prompt wrappers that tell the model "the following is untrusted" help too, and are worked around once somebody writes an attack aimed at them.

So the containment has to sit outside the model, in code that makes decisions the model cannot talk its way past.

What actually contains it

Least privilege on tools. An assistant that can only read cannot be talked into writing. Give each run the narrowest set of actions it needs, and classify every tool by what it can change.

Approvals bound to exact arguments. "This job may send Slack messages" is not a permission anybody can reason about. "This job may post to #help-requests" is. A grant should pin the arguments that decide where an action lands, so that an injected instruction cannot redirect a permitted action to a new recipient.

Provenance of arguments. On a run that has read outside content, an email address or URL used in an action should be traceable to something the user said or to an identifying field in a system of record, never to text inside a message body.

Egress control. Decide what may leave: which hosts may be fetched, which links in a reply are rendered live, whether images from model output are loaded at all.

Remembered and fetched text treated as data. Content from tools is labelled as content when it reaches the model, and anything written into memory from it is marked as unconfirmed rather than stored as fact.

Detectors, labels and wrappers belong in the design as load reducers. They make the hard boundaries above fire less often. They are not the boundaries.

Where Memtro stands

Memtro does not ask the model to be the boundary: a run that has read outside content needs a person present to act, a scheduled job takes the connector actions its owner has been granted, since setting it up was the asking, and on such a run an action's recipient has to trace back to the conversation or an identifying field in a connected system. Tool output reaches the model in a labelled block, and memory records whether a person stood behind each fact. A new organisation starts enforcing; one that has never chosen is read in report mode, where each decision on an attended run is recorded but not applied, so the cost of enforcement is visible before it is switched on. The prompt injection documentation sets out every rule and what it does not cover, and Seven gates before a tool result can act explains the order they run in.

Where agents remember your company

Sign in, add a provider key, create an API key and point your tools at Memtro. It takes about five minutes.

7-day free trial · card on file, nothing charged until it ends · cancel any time