Key points
- Prompt injection is when text fed to an AI model changes what the model does in ways its owner did not intend.
- Direct injection comes from the person typing. Indirect injection is hidden in content the AI reads, such as an email, web page or document.
- It is number 1 on the OWASP Top 10 for LLM Applications, in both the 2025 and the 2026 editions.
- The risk grows when the AI can act: send emails, read files, call APIs or move money.
- There is no single fix. Limit what the AI can do, keep a human in the loop for risky actions, and test before launch.
What is prompt injection?
Prompt injection is an attack on applications built on large language models (LLMs), such as chatbots, copilots and AI agents. The attacker writes text that the model treats as an instruction, and the model follows it instead of, or as well as, the instructions its owner gave it.
OWASP, the open security community, defines it this way: a prompt injection vulnerability "occurs when user prompts alter the LLM's behavior or output in unintended ways." OWASP adds that the text does not need to be visible to a person. It only needs to be read by the model.
The root cause is simple. An LLM reads everything as one stream of text. It has no reliable way to tell "this is an instruction from my owner" apart from "this is data I was asked to read". Normal software keeps code and data separate. LLM applications mix them by design.
Direct vs indirect prompt injection
Direct prompt injection
The person typing into the chatbot tries to change its behaviour. For example, a user tells a bank's customer service bot to forget its rules and act as a different assistant, hoping it will reveal its hidden instructions or discuss things it should not. OWASP notes that direct injection can also be accidental, when normal user input happens to push the model off course.
Indirect prompt injection
The instruction is planted in content the AI reads later. The user may be innocent. OWASP describes this as an LLM accepting input "from external sources, such as websites or files" that changes its behaviour. Indirect injection is the bigger worry for businesses, because the attacker never needs to touch your system directly.
Prompt injection examples
These are made-up scenarios to show the pattern. They are not taken from real incidents and do not include working attack text.
- Email assistant. A staff member asks an AI assistant to summarise their inbox. One email from an outsider contains hidden text telling the assistant to forward recent invoices to an outside address. If the assistant can send email, it may do so.
- CV screening. A job applicant puts white-on-white text in a CV telling the screening tool to rank them as the best candidate. The recruiter never sees the text, but the model does.
- Customer chatbot with order access. A user persuades a retail chatbot that they are a staff member, and it reads out another customer's order details because the bot's database query was not limited to the logged-in user.
- Browsing agent. A personal AI agent is asked to compare prices. One shopping page carries instructions telling the agent to fill in a payment form on a different site.
- Knowledge base. Someone uploads a document to a shared folder that an internal chatbot searches. The document tells the chatbot to give wrong answers about a refund policy.
Why it matters for chatbots and AI agents
A chatbot that can only chat can leak its hidden instructions or say something embarrassing. That is bad, but limited. The damage grows with what the AI is allowed to do.
- Data leaks. If the model can search customer records, files or email, an injected instruction can make it pull out data and show it, or send it somewhere.
- Unsafe actions. If the model can call tools, such as sending messages, changing records, approving refunds or making payments, an injected instruction can trigger those actions.
- Hard to see. The bad instruction can sit in an ordinary-looking email or web page. Logs may only show that the agent "decided" to do something.
The common mistake we see is giving an AI agent the same access as the person using it, or more. An agent connected to a mailbox, a file share and a payment system is one injected sentence away from misusing all three. Treat every AI agent as an untrusted user with its own, smaller set of permissions.
Where it sits in the OWASP Top 10 for LLM Applications
Prompt injection is LLM01, the top risk, in the OWASP Top 10 for LLM Applications 2025. It stays at number 1 in the 2026 edition, which OWASP's GenAI Security Project dated 3 August 2026. In the 2026 edition, Excessive Agency (AI systems with too many functions, permissions or too much autonomy) moved up from 6th to 3rd.
Those two risks go together. Prompt injection is how an attacker steers the model. Excessive agency decides how much harm the steering can do. Our guide to the OWASP Top 10 for LLM Applications covers all ten.
Defences that work
OWASP's own guidance lists ways to reduce the risk, not remove it. Plan for some injections to get through, and make sure they cannot do much.
- Least privilege for tools. Give the AI only the tools and data each task needs. Use separate service accounts and API tokens for the AI, not a staff member's login. Start with read-only access.
- Enforce access rules in code, not in the prompt. If a user may only see their own orders, the database query must enforce that. A line in the system prompt saying "only show the user's own orders" is not a control.
- Human approval for risky actions. Payments, refunds, deleting data, sending email outside the company and changing permissions should need a person to confirm. Show the person exactly what will happen.
- Separate instructions from data. Mark untrusted content (emails, web pages, uploads) clearly as data. Do not let content the AI reads add new tools, change its role or change where it sends things.
- Input and output handling. Check model output before it reaches other systems. Validate the format, block links and addresses that are not on an allowed list, and never pass model output straight into a database query, shell command or web page.
- Monitoring. Log the prompts, retrieved content and tool calls for each session. Alert on unusual tool use, such as bulk reads or messages to new outside addresses.
- Testing. Test with injected content before launch and after every change to prompts, tools or models. OWASP recommends treating the model as an untrusted user in these tests.
What regulators in Hong Kong, Singapore and Malaysia say
Singapore
On 6 November 2026 the Cyber Security Agency of Singapore (CSA), GovTech and the Infocomm Media Development Authority (IMDA) issued a joint advisory, "Using Personal AI Agents Safely and Securely". It warns that scammers may hide malicious instructions in websites, emails, messages or documents. It advises users to connect only the accounts an agent needs, avoid connecting banking, government and healthcare accounts, start with read-only permissions, require approval for significant actions, and prefer one-time approval over "always allow".
IMDA's Model AI Governance Framework for Agentic AI, launched on 22 January 2026, asks organisations to limit agents' autonomy and access to tools and data, and to define checkpoints where human approval is required. IMDA says it is also developing guidelines for testing agentic AI applications.
Hong Kong
On 25 August 2026 the Privacy Commissioner for Personal Data (PCPD) published "Protecting Personal Data Privacy in the Use of Agentic AI". Law firm summaries say it covers risks from agents' broad access and from vulnerable plugins, and recommends least-privilege access, vetting plugins against an approved list, human approval for higher-risk decisions, and a security checklist across the agent's life cycle. The organisation using the agent remains responsible for personal data it handles.
Malaysia
Malaysia's Ministry of Science, Technology and Innovation (MOSTI) released the National Guidelines on AI Governance and Ethics on 20 September 2024. They are voluntary and general. They do not set specific rules on prompt injection.
Prompt injection testing checklist
- List every source of text the model reads: user input, emails, web pages, uploaded files, knowledge base, tool results, memory.
- List every tool the model can call and what the worst misuse of each would be.
- Remove tools and permissions the feature does not need.
- Try direct injection: can a user make the bot reveal its hidden instructions, change role or skip its rules?
- Try indirect injection through each content source: does planted text change what the model does?
- Check that access rules (whose data, which records) are enforced by the application, not the prompt.
- Confirm that payments, deletions, outside emails and permission changes need human approval.
- Check that model output is validated before it reaches databases, browsers or other systems.
- Confirm logs capture prompts, retrieved content and tool calls, and that someone reviews alerts.
- Repeat the tests after any change to the model, prompt, tools or data sources.
Sources
- OWASP GenAI Security Project, LLM01:2025 Prompt Injection: genai.owasp.org
- OWASP GenAI Security Project, OWASP Top 10 for LLM Applications 2026, 3 Aug 2026: genai.owasp.org
- Cloud Security Alliance Labs, research note on the OWASP 2026 LLM Top 10: labs.cloudsecurityalliance.org
- Cyber Security Agency of Singapore, joint advisory AD-2026-015 on personal AI agents, 6 Nov 2026: csa.gov.sg
- AsiaOne, how to use a personal AI agent safely, 10 Nov 2026: asiaone.com
- Ministry of Digital Development and Information, Model AI Governance Framework for Agentic AI, 22 Jan 2026: mddi.gov.sg
- PCPD, media statement publishing agentic AI guidance, 25 Aug 2026: pcpd.org.hk
- Reed Smith, Hong Kong's new guidance on agentic AI, 9 Sep 2026: reedsmith.com
- MyGOV, National Guidelines on AI Governance and Ethics: malaysia.gov.my
This guide summarises public documents as of 26 November 2026. It is not legal advice; check the regulator's current text.