What Is Prompt Injection? AI Security Risks Explained

Prompt injection is a security problem in which input supplied to an AI system causes it to behave in unintended ways. It can arise from a direct message or from material the assistant reads, such as an email, document or webpage. The risk is especially important when AI can use tools.

Last updated: 29 November 2026

Direct vs indirect prompt injection

Direct prompt injection involves instructions submitted directly to a model. Indirect prompt injection involves instructions embedded in external material that a system retrieves or processes. An assistant should distinguish the user’s authorised task from the content it is asked to analyse, even when that content resembles instructions.

Why connected AI tools are at risk

An assistant that can only generate a draft has a different risk profile from one with permission to edit a website, send email or access business records. If untrusted material influences tool selection, actions could exceed what the user intended. The consequences depend on the system’s actual permissions.

A practical business example

An inbox assistant is asked to summarise messages. One message contains unrelated instructions asking the system to perform an action outside that task. The assistant should summarise the message as data rather than obey it. The application should prevent unauthorised actions independently of the model’s judgement.

How to reduce prompt injection risks

Grant only the permissions needed for the task, favour read-only access when possible and require approval for sending messages, modifying records or sharing sensitive data. Validate tool requests and outputs, separate trusted instructions from external content, and log actions. Avoid giving an untested agent broad access to production systems.

Can prompt injection be prevented completely?

There is no dependable universal prevention technique for today’s language-model applications. OWASP identifies prompt injection as a major AI security risk. Combine technical controls, testing and human approval rather than trusting a single instruction telling the model to ignore malicious content.

Frequently asked questions

Is prompt injection the same as a computer virus?

No. It targets how an AI processes inputs and chooses behaviour, rather than necessarily installing malicious executable code.

Does a system prompt make an agent secure?

No. System instructions help guide behaviour, but security also requires independently enforced permissions and controls.

Further reading

See the technical reference and guidance for more information.

Related AI guides

AI glossary: artificial intelligence terms explained

What is an AI agent?

What is MCP?

What Is RAG in AI? Retrieval-Augmented Generation Explained

Share this article:

Disclosure: Some links on this page are affiliate links. If you sign up through one, we may earn a commission at no extra cost to you. Our guides are for information only and aren’t financial advice. See our disclaimer.

Table of Contents

Subscribe To Our Newsletter & Exclusive Discord

Join the Every Bit Helps mailing list to receive our newsletter & get access to the latest deals & to our Discord community.

Congrats You Have Successful Subscribed!