Prompt injection

Spec sheet // Glossary // PROMPT INJECTION
Glossary / P / Prompt injection
Glossary · AI and model risk

Prompt injection

Also called indirect prompt injection, LLM prompt attack

Definition

Prompt injection is an attack on a large language model in which text supplied by a user or hidden in content the model reads overrides its intended instructions. It can make a chatbot reveal confidential data, ignore guardrails or, in agentic systems, take actions such as sending emails or moving data without authority.

LEAST PRIVILEGEINPUT FILTERSHUMAN APPROVAL
Fig. 1 · Prompt injection
EU AI Act, Article 15 · NIST AI 100-2 E2025 · AI Cyber Security Code of Practice
Key rulesEU AI Act, Article 15 · NIST AI 100-2 E2025 · AI Cyber Security Code of Practice
Applies toProviders of high-risk AI systems, such as creditworthiness assessment
RegionsGlobal · UK · EU · US
01

How it works

In direct prompt injection, a user types instructions designed to make the model disregard its system prompt or safety rules. In indirect prompt injection, the attacker plants instructions in content the model processes, such as a web page, email, document or customer message. Because the model treats everything in its context as text to follow, it may carry out the hidden instructions without the user knowing.

The risk grows when a model can call tools, read internal systems or act for users. Firms reduce it by limiting the model's permissions, separating trusted instructions from untrusted content, filtering inputs and outputs, requiring human approval for sensitive actions and logging activity. Red teaming tests these defences. No single control removes the risk, so firms layer controls and treat model output as untrusted.

Step 1Map exposureList what content the model reads and what it can do.
Step 2Limit permissionsGive the model the least access needed for its task.
Step 3FilterScreen inputs and outputs for injected instructions and data leaks.
Step 4Gate actionsRequire human approval for sensitive actions.
Step 5Test and logRed team regularly and keep logs of model activity.
02

The rules

EU · 2 December 2027 for Annex III high-risk systems, after postponement by the 2026 AI omnibusEU AI Act, Article 15Article 15 of Regulation (EU) 2024/1689 (AI Act), accuracy, robustness and cybersecurity of high-risk AI systems

Requires high-risk AI systems to be resilient against attempts by unauthorised third parties to alter their use, outputs or performance by exploiting vulnerabilities, including adversarial inputs.

Providers of high-risk AI systems, such as creditworthiness assessment
US · March 2025NIST AI 100-2 E2025NIST AI 100-2 E2025, Adversarial Machine Learning: A Taxonomy and Terminology of Attacks and Mitigations

Classifies attacks on AI systems, including direct and indirect prompt injection against generative AI and agents, and the mitigations for each.

Any organisation, voluntary guidance
UK · 31 January 2025AI Cyber Security Code of PracticeDepartment for Science, Innovation and Technology, Code of Practice for the Cyber Security of AI

Sets baseline security principles for AI systems and names indirect prompt injection among the AI-specific risks to design against.

Developers, system operators and data custodians of AI systems, voluntary
03

Common questions

What is the difference between prompt injection and jailbreaking?

Jailbreaking is a user trying to make a model break its own safety rules. Prompt injection is broader: it includes instructions hidden in third-party content that hijack the model on someone else's behalf.

Why does prompt injection matter for banks?

Banks deploy chatbots and AI agents with access to customer data and internal systems. A successful injection can leak personal data, give customers wrong information or trigger unauthorised actions.

Can prompt injection be fully prevented?

No current technique removes it entirely, because models process instructions and data as the same text. Firms limit the damage with least privilege, human approval for key actions and monitoring.