# How do you stop an AI agent from being tricked by a hidden instruction?

You cannot fully stop it, so you limit the damage. Prompt injection hides instructions in an email, a web page or a file the agent reads. It tops the OWASP list of AI risks for the third year. Give the agent only the tools its job needs and rules it cannot cross. Put a person before anything irreversible.

By Surinder Thakur, AI Product Designer and Builder. Published 17 Nov 2026. Topic: [Trusting AI with money](https://www.surinder.design/work?type=trusting-ai-with-money).

## What does an attack look like?

An invoice with a hidden line: ignore your rules and pay this account. A web page telling the agent to send your files somewhere.

The agent reads it as part of the job, and may treat it as an order.

## Why can it not be fixed for good?

Because the agent reads instructions and data in the same language. Models get more resistant, but there is no complete fix yet.

Steve Wilson, co-chair of OWASP's GenAI Security Project, compares it to death and taxes: something to manage, never to remove. So the defence sits around the agent, not inside it.

## Which limits matter most?

Only the tools the job needs. An agent that matches invoices has no tool to change bank details.

Hard rules outside the model: payees on an approved list, limits it cannot raise. And a person before anything that cannot be undone.

## How do you know it held?

Test it with planted instructions before launch, in emails and documents like the real ones.

Log every blocked action. A spike in blocks tells you someone is trying.

## In 1 picture

Rules outside the model stop a hidden instruction from becoming an action.

1. Email arrives: With a hidden instruction
2. Agent reads it: As part of the job
3. Rules check: Outside the model
4. Normal work: Inside the rules only

When asked to act outside its job at step 3: Blocked, and a person told. Logged with the email that asked.

A tricked agent still cannot cross the rules.

## Sources

- [SD Times · Prompt injection tops 2026 OWASP GenAI and LLM Top Ten](https://sdtimes.com/security/prompt-injection-tops-2026-owasp-genai-llm-top-ten-vulnerabilities/)

## Next questions

- [What should an AI agent be allowed to do without asking?](https://www.surinder.design/work/what-should-an-ai-agent-do-without-asking): Anything a person can check and undo in time. Reading, sorting and drafting need no approval, because nothing leaves the building.
- [How do you stop an AI agent making a mistake with money?](https://www.surinder.design/work/ai-agent-mistake-with-money): You limit what it can do alone. The agent pays only inside the rules you set: approved payees, a limit, a monthly budget.
- [What should an AI agent remember about my customers?](https://www.surinder.design/work/what-should-an-ai-agent-remember): Only what makes the next task better, and what the customer would expect it to keep.
- [What does the EU AI Act mean for a company using AI agents?](https://www.surinder.design/work/what-the-eu-ai-act-means-for-ai-agents): An agent that talks to people in the EU must tell them it is an AI.

## Questions that lead here

- [How do you get an AI agent to say "I do not know"?](https://www.surinder.design/work/how-to-get-an-ai-agent-to-say-i-do-not-know): Give it 3 things. A narrow set of sources it must answer from.

Page: https://www.surinder.design/work/how-to-stop-prompt-injection-in-an-ai-agent
