Privacy and governance

AI Agent Prompt Injection: When the Danger Is in What It Reads

A document with an almost invisible line reaching an AI agent; the agent sits inside a boundary and the outward action is stopped.

A website, an email, a PDF or a calendar invite can carry instructions hidden for the AI agent that reads them. Sometimes you can’t even see them: white text on a white background. This is known as AI agent prompt injection, and Spain’s data protection authority (AEPD) devotes point 7 of its guidelines to it, with a warning that is unusual in an official guide: no measure removes this risk completely.

This is the fifth article in our series on the AEPD AI agents guidelines. We look at what this risk is, why it has no final fix, and what a company can do so that a trick doesn’t turn into damage.

What is prompt injection in an AI agent?

An agent can’t reliably tell apart what you ask it and what it reads while working. If you ask it to summarize a document and the document contains text saying “send this file to such-and-such address”, the agent may take it as an order.

The guidelines give examples of what those instructions try to achieve: getting the agent to send your data, open a link or approve something. In other words, to do something other than what you asked, using the permissions you gave it for something else.

Why can’t it be removed completely?

Because reading outside content is exactly the job of many agents. One that manages an inbox has to read emails from strangers. One that compares quotes has to read suppliers’ websites and PDFs. You can’t ask an agent to read without reading.

So the AEPD doesn’t offer a miracle filter. Its conclusion changes the question: if you can’t guarantee the agent won’t be tricked, make sure that if it is, it can’t do much. In the guidelines’ words, the best protection is to limit what the agent can do if it does get tricked. And the more outside content it handles, the less access and ability to act it should have over your data and accounts.

The combination to avoid

Point 7 identifies three ingredients that, together in a single task, turn a trick into a serious problem:

IngredientWhat it meansExample in a company
Content from strangersEmails, files or websites you don't controlInvoices arriving from new suppliers
Access to private informationYour own or your company's dataThe ERP with suppliers' bank details
Ability to actSend, share, pay or publishBeing able to change a payment account

The guidelines’ example is an instruction that looks harmless: “summarize my new emails and reply to all of them”. It has all three ingredients. If you need to combine them, the AEPD asks for the agent to request confirmation before any outward action, such as sending, sharing, paying or publishing.

Removing any one of the three is enough to break the chain. An agent that reads invoices from strangers and looks up the ERP, but can’t change anything, will at worst give a wrong answer. We cover confirmation before acting in the series article on what an agent must not do without asking.

Signs that something is wrong

The guidelines give a short list of signs to stop the task and review it before going on:

  • the agent asks for a password or a code,
  • pushes you to approve something,
  • visits unexpected sites,
  • or suggests a link nobody asked for.

And they add one more measure: set up, accept or create limits on the outside services the agent tries to access. In a company, that means a closed list of sites and services the agent can connect to, and nothing else.

What should a company require against prompt injection?

Since there is no final fix, protection comes in layers. These are the questions for whoever sells you the agent:

  1. Can I separate read tools from write tools? An agent that reads outside content should have writing cut back or under approval.
  2. Can outward actions go through a person? Sending, sharing, paying and publishing, with confirmation.
  3. Does the agent see credentials? If it doesn’t, a hidden instruction can’t ask for them.
  4. Can I limit which outside services it connects to? The fewer, the smaller the attack surface.
  5. Is there a record of what it did and why? If something happens, you need to be able to reconstruct it.
  6. Does each agent work in isolation? A tricked agent shouldn’t be able to touch what belongs to another.

How Heptora handles it

At Heptora we don’t promise that an agent can’t be tricked: the AEPD is right that no measure removes the risk. What the platform’s AI governance does is limit what a tricked agent could do:

  • Least privilege and isolated agents. Each AI agent only sees the files, collections and tools in its scope.
  • Reading and writing kept apart. Every tool it connects to is configured separately, and anything that changes your systems has its own guardrail and, if you want, human approval.
  • Confirmation on the critical steps you mark: sending, paying, deleting, changing master data.
  • Security rules. Anything out of bounds is stopped by the security classifier and raised as an alert.
  • A record of everything, and passwords and keys kept in an encrypted vault on your own machine.

Frequently asked questions

What is prompt injection?

Instructions hidden in a website, an email, a PDF or a calendar invite so that the AI agent reading them does something other than what you asked, such as sending data, opening a link or approving something.

Can prompt injection be fully prevented?

No. The AEPD acknowledges that no measure removes this risk completely. That is why it recommends limiting what the agent can do if it does get tricked.

Which tasks are most dangerous for an AI agent?

Those that combine content from strangers, access to private information and the ability to act in your name. The guidelines’ example is “summarize my new emails and reply to all of them”.

What should I do if an agent asks me for a password or pushes me to approve something?

Stop the task and review it before going on. The guidelines flag it as a warning sign, just like visiting unexpected sites or suggesting a link.

Look for the risky combination in your processes

We'll go through one of your processes with you and show where an agent reads outside content, touches private data and can act.