What Is Prompt Injection in LLMs?

Prompt injection is a security vulnerability in which crafted input alters a large language model’s behavior or output in unintended ways. OWASP ranks it first in its Top 10 for LLM applications (LLM01:2025), and the input can affect the model even if humans cannot see it.

Secure AI & LLMs. See Prophaze block threats in real time.

Key practices include:

How a Prompt Injection Attack on an LLM Works

Instructions and data can overlap

LLM applications process system instructions alongside user input and external content. Even when these are separated structurally, models may struggle to distinguish trusted instructions from malicious text embedded in the content they are asked to process.

Attacks can come from multiple sources

Prompt injection may be direct, through a user’s message, or indirect, through a webpage, email, uploaded document or retrieved data containing malicious instructions.

The impact depends on the application's access

An injected instruction might manipulate a summary or response, but in applications connected to sensitive data, APIs or autonomous agents, it could also contribute to data exposure or unauthorized actions. The risk increases when the application grants excessive permissions or relies on the model alone to enforce security rules.
A real case: Stanford student Kevin Liu got Microsoft’s Bing Chat to divulge its programming with a prompt that began ‘Ignore previous instructions.’
A simple example would be : Imagine a receptionist who gets one sheet of paper containing both the manager’s rules and a visitor’s note. If the note says ‘disregard the rules above’, the receptionist has no way to know the note isn’t from the manager.

Types of Prompt Injection

OWASP’s scenarios show the range: a support chatbot told to query private data stores and send emails; a summarized web page with hidden instructions that exfiltrate the conversation through an image link; an edited RAG document; split payloads in a resume; encoded prompts (Base64, emojis); and CVE-2024-5184 in an LLM-powered email assistant.

Prompt Injection vs. Jailbreaking

Prompt injection manipulates an LLM through malicious instructions embedded in user input or external content. Jailbreaking specifically attempts to bypass a model’s safety restrictions. Although the techniques differ, they can overlap and produce similar security risks.

LLM Prompt Manipulation: What It Can Cause

Prompt manipulation can lead to sensitive data exposure, system prompt leakage, misleading responses or unauthorized actions through connected tools. The potential impact depends on the application’s permissions, the data it can access and the decisions it influences. Understanding these risks helps security teams prioritize safeguards based on the potential business impact.

AI Prompt Injection Defense

No single control can reliably prevent every prompt injection attack. A layered defense reduces risk by combining input validation, access restrictions, output checks and ongoing security testing.
Key practices include:
Security teams should also recognize that filters and detection systems can miss novel attacks or incorrectly flag legitimate requests. Treat the model as one component of the security architecture, not as the sole enforcement mechanism.

One Text Stream, Two Kinds of Authority

LLMs can struggle to distinguish trusted instructions from malicious content, making prompt injection a broader application security challenge. Understanding AI security fundamentals, LLM guardrails and insecure output handling helps explain why protecting AI systems requires controls beyond input filtering alone. For a closer look at how meaning can be exploited to manipulate model behavior, explore our guide to semantic attacks on LLMs.
Ultimately, effective prompt injection defense depends on limiting trust, restricting model permissions and continuously testing safeguards against evolving attack techniques.

Frequently Asked Questions (FAQ)

1. What is the purpose of prompt injection?
Attackers use it to override instructions, leak data or trigger unauthorized actions. IBM notes researchers also use it to understand LLM capabilities and security gaps, and that it is not inherently illegal.
In direct injection the attacker types the malicious prompt. In indirect injection the instruction hides in content the model retrieves, such as a web page or document, so the victim may never see it.
You cannot eliminate it, so layer defenses: least privilege, input and output filtering, separation of untrusted content, human approval for high-risk actions and regular adversarial testing.

Protect AI and LLMs, everywhere.

Discover AI & LLM threats, block prompt injection and jailbreak attacks, and enforce security policies at scale.

Recent Blog Posts

Indonesia Bank Cyberattack

Indonesia Bank Cyberattack: What OJK Told Banks to Do

Attempts against Indonesia’s financial sector passed 1.2 million in 24 hours. No bank has confirmed

AI Security Risk Assessment

AI Security Risk Assessment: How to Measure AI Risk Across the Enterprise

Key Takeaways Most enterprises cannot see all their AI. HiddenLayer’s 2026 AI Threat Landscape Report

Weekly Threat Report November 5–11, 2026

Weekly Threat Report, November 5–11, 2026: AI Secret Exposure, OpenSSH Bypass and Refrigeration Sabotage Follow-Up

Key Takeaways Secrets in agent settings and cloud environments create persistent exposure beyond the original

Scroll to Top