Prompt injection

What is Prompt injection?

Prompt injection is an attack where text placed in content the model reads (a crawled web page, an uploaded file, a user message) is written to influence the model's behaviour. It matters most for agents, because a model that can call tools can be pushed toward calling them, so authorisation must be enforced outside the model.

In more detail

Language models cannot reliably tell instructions from their developer apart from instructions that appear inside the text they are reading. Prompt injection exploits that: a visitor types "ignore your instructions and…", or a web page the assistant has crawled contains hidden text addressed to AI systems.

For a chatbot that only replies, the damage is usually embarrassment: an off-brand answer, or its instructions revealed. For an agent with tools it can be worse, because injected text can push the model to request an action.

No wording of the instructions fully prevents it. The dependable defences sit outside the model: give it only the tools it needs, validate every tool call, keep identity and permissions out of the model's hands, and keep irreversible actions behind a person.

Illustration for "Prompt injection"GLOSSARYPrompt injection
Prompt injection, defined in plain English.
Prompt injection connected to customers and the tools that serve themPromptinjectionTool callingAI agentGrounding
Related terms in this glossary.

How SpideyChat handles it

SpideyChat's defences are structural rather than in the prompt. Tools are off by default and re-checked on the server before each call, arguments are validated, destructive actions are refused, who the visitor is comes from the request rather than from anything the model says, and chat requests are rate-limited.

We make SpideyChat. The rest of this page describes the term in general, not our product.

Questions

Can prompt injection steal my data?
It can only reach what the assistant can reach. An assistant that answers from public content and can only record leads or open tickets has little to leak; one connected to customer accounts needs much stronger controls.
Is prompt injection the same as jailbreaking?
They overlap. Jailbreaking usually means a user talking a model out of its rules. Prompt injection more broadly means any untrusted text steering the model, including text in documents and web pages.

All glossary terms