Prompt Injection

What is Prompt Injection?

Prompt injection is an attack in which someone inserts instructions into an AI system's input, directly or hidden in content it processes, to make it ignore its intended instructions and behave in unintended ways.

Updated November 2026 · 5 min read


Large language models follow instructions written in ordinary language. That is what makes them useful, but it also creates a weakness. The model cannot reliably tell the difference between instructions from its developers and instructions that arrive in the text it is given. If a user types "ignore your previous instructions," or a web page the model reads contains hidden text telling it to reveal confidential data, the model may comply. This is prompt injection. It can cause an AI system to leak information, produce harmful content, give false answers or, in the case of AI agents, take actions its owners never intended. The attacker does not need to break into any system, only to get text in front of the model.

The term came into wide use in 2022, as developers began building applications on language models. Prompt injection is ranked as the top risk in the OWASP Top 10 for Large Language Model Applications, and it has become more serious as AI agents gain access to email, documents, browsers and business systems. There is no complete fix, because the weakness comes from how language models process text. Defenses therefore aim to reduce the likelihood and limit the impact of attacks. For security, AI and product teams, managing prompt injection is one of the most important parts of deploying generative AI safely.

Definition of Prompt Injection

Prompt injection is a class of attack against systems built on large language models, in which crafted input causes the model to follow instructions that override or subvert those set by the system's designers, leading to unauthorized outputs, data disclosure or actions.

It is a leading threat in AI security, a primary focus of AI red teaming and a major risk addressed by agentic AI governance.

Types of Prompt Injection

Direct prompt injection occurs when a user types instructions designed to override the system's rules, such as asking a chatbot to reveal its hidden instructions or ignore its restrictions. Attempts to bypass safety rules in this way are often called jailbreaking. Jailbreak techniques are widely shared online, so systems face them constantly.

Indirect prompt injection occurs when malicious instructions are hidden in content the AI system processes, such as a web page, email, document, image or database record, and are then followed without the user's knowledge.

Indirect attacks are especially dangerous for AI agents and assistants that read external content and can take actions, because the attacker does not need direct access to the system. Any content the system reads becomes a possible route for attack. An attacker only needs to place content where the AI system will read it.

Possible Consequences

Data leakage occurs when the model reveals confidential information, personal data or its own system instructions. Revealed instructions can help attackers design further attacks.

Unauthorized actions occur when an agent is tricked into sending messages, changing records, moving money or calling tools it should not.

Manipulated outputs occur when the model gives false, biased or harmful answers that users trust. Users may act on these answers without realizing they were manipulated.

Further attacks occur when an injected instruction spreads, for example by inserting malicious content into documents or messages that other AI systems later read.

Importance of Managing Prompt Injection in AI Governance

Managing prompt injection protects data. Many AI applications have access to sensitive information that attackers could extract. The more data a system can reach, the greater the potential loss.

It limits the damage agents can do. As AI agents gain permissions to act, prompt injection can turn a text attack into a real-world action. This is why permissions and approvals matter as much as filters.

It also maintains trust. Users and customers need confidence that AI assistants cannot be easily turned against them.

Prompt Injection and Financial Management

Successful attacks can cause data breaches, fraudulent transactions or harmful content, each with direct costs and reputational damage.

Limiting agents' permissions and adding approval steps reduces the potential financial loss from any single attack.

Defensive tools, testing and monitoring add cost, which should be focused on systems that handle sensitive data or take actions.

Including prompt injection in vendor security reviews avoids buying AI products that expose the organization to avoidable risk.

Common Challenges

There is no complete technical solution, because models process instructions and data in the same way.

Attackers constantly develop new techniques, including hidden text, encoded instructions and instructions inside images. Defenses need regular updates to keep up.

Strong filters can block legitimate use, while weak ones miss attacks, so tuning requires care. Monitoring both false positives and missed attacks helps find the right balance.

How to Reduce Prompt Injection Risk

Reducing prompt injection risk involves limiting what AI systems can access and do, filtering and separating untrusted content, requiring human approval for sensitive actions, testing defenses and monitoring for attacks.

The most effective approach assumes some injections will succeed and limits the damage they can cause. This is the same principle as defense in depth in traditional security.

Designing for Resilience

Apply least privilege, giving AI systems only the data and tools they need for their task.

Treat all external content, such as web pages, emails and uploaded documents, as untrusted, and mark or separate it from trusted instructions where possible.

Require human in the loop approval for high-impact actions, such as sending external messages, making payments or changing records.

Detecting and Testing

Use input and output AI guardrails to detect known injection patterns and block outputs that contain sensitive data or unexpected instructions.

Test systems regularly with direct and indirect injection attacks, and add successful attacks to automated test suites.

Log inputs, outputs and tool calls, monitor for suspicious behavior and include prompt injection in incident response plans.

Examples of Prompt Injection in Practice

The examples below show how organizations handle prompt injection.

Both use illustrative figures. The first involves an email assistant, and the second involves a website chatbot.

In each, layered defenses limited the impact.

Protecting an Email Assistant

A company tests an AI assistant that can read and summarize employees' email and draft replies.

Red teamers send an email containing hidden text instructing the assistant to forward the employee's recent messages to an outside address.

Because the assistant can only draft, not send, and because drafts to new external recipients are flagged, the attack fails, and the company adds detection for similar hidden instructions.

Hardening a Website Chatbot

An airline's chatbot is targeted by users trying to make it promise refunds the airline does not offer.

The airline grounds the chatbot's answers in its published policies, adds output checks that block commitments not found in those policies and routes refund requests to staff.

Attempts to extract unauthorized promises continue, but none succeed in the following quarter.

Conclusion

Prompt injection is an attack in which crafted input, typed directly or hidden in content an AI system processes, makes the system ignore its intended instructions. It can lead to data leakage, unauthorized actions and manipulated outputs.

In AI governance, managing prompt injection protects data, limits the damage agents can do and maintains trust. Applying least privilege, treating external content as untrusted, requiring human approval for sensitive actions, using guardrails, testing regularly and monitoring for attacks help organizations reduce prompt injection risk.