Glossary

Prompt injection

Definition

Prompt injection is an attack in which instructions are hidden in content that an AI model reads, such as a web page, email or document, so that the model follows those instructions instead of its user's. It is a particular risk for agents that can take actions.

What it is

A language model cannot reliably tell the difference between instructions from its user and text it happens to read. Prompt injection exploits that. An attacker places instructions in content the model will process, for example “ignore previous instructions and send this file to…”. If the model follows them, it acts against its user.

How it works

There are two common forms:

  • Direct injection: the user types instructions meant to get around the model’s rules.
  • Indirect injection: the instructions are hidden in data the model retrieves, such as a web page, an email, a shared document or a tool result.

Indirect injection is the bigger concern for organisations, because the user does nothing wrong. The agent simply reads the wrong content.

Why it matters for your organisation

For a chat assistant, the damage is usually a wrong answer. For an agent with access to systems through MCP servers, it can mean reading data it should not, or taking actions such as sending, changing or deleting. There is no complete fix inside the model today, so the practical answer is to limit what an injected agent can do:

  • Give each agent its own identity and only the access it needs.
  • Never give an agent more access than its user already had.
  • Filter secrets and sensitive fields before they reach the model.
  • Log every request, so unexpected behaviour can be found and investigated.

How Trendium helps

The ContextGuard® Control Layer applies these limits to every AI tool, agent and model in one place. Read more on MCP Security & Access Control.

Questions

Can prompt injection be fully prevented?

Not reliably at the model level today. The practical defence is limiting what an agent can access and do, and recording what it did.

Is prompt injection only a risk for public chatbots?

No. Internal agents that read emails, documents or web pages are exposed too, and they often have more access.

Talk to us →