Prompt Injection: The New Injection Attack

Prompt injection manipulates an LLM into ignoring its instructions. It is the defining AI security risk.

Prompt injection is to AI applications what SQL injection was to web applications a generation ago: the defining vulnerability of a new technology class, simple in concept and dangerous in practice. If you are deploying LLM features, it is the risk to understand first.

What prompt injection is

Prompt injection manipulates a language model into ignoring its intended instructions and following the attacker’s instead. Because LLMs blend trusted instructions and untrusted input in the same context, an attacker who controls part of that input can hijack the model’s behaviour — making it reveal data, take actions, or say things it was explicitly told not to.

Direct versus indirect

Direct injection comes straight from user input: a crafted message that overrides the system prompt. Indirect injection is subtler and often more dangerous — malicious instructions hidden in content the model later reads, such as a web page, document or email, which the model treats as trusted when it processes them.

What can go wrong

A successful injection can exfiltrate sensitive data, leak the system prompt and its guardrails, trigger unintended actions through connected tools, or poison a conversation for other users. In agentic systems with real-world permissions, the impact escalates from embarrassing to genuinely damaging.

Why it is hard to fully prevent

Unlike a syntax-level flaw, prompt injection exploits the model’s core capability to follow natural-language instructions, so there is no single patch. Defences reduce risk rather than eliminate it: input and output handling, constraining what agents can do, and separating trusted instructions from untrusted content.

Reducing the risk in practice

Test for injection continuously, apply least privilege to agents and tools, validate and sanitise model output before acting on it, protect system prompts, and treat all external content the model ingests as untrusted. Layered, these measures make injection far harder to weaponise.

How Attack Insights and DarkThreatX help

Attack Insights makes prompt injection a primary focus of AI penetration testing, attempting both direct and indirect attacks and validating what is genuinely exploitable. DarkThreatX adds context on emerging attacker techniques drawn from its corpus of over 100 billion records, helping you stay ahead of how injection is evolving.

Common mistakes to avoid

Defenders get prompt injection wrong when they expect a single fix; because it exploits the model’s core ability to follow instructions, there is no patch, only layered mitigation. A frequent error is defending against direct injection while ignoring indirect injection hidden in content the model reads, which is often the more dangerous vector. Many grant agents real-world permissions without least privilege, so a successful injection can take damaging actions. Others trust model output and render or execute it without validation, reintroducing classic web flaws. And some test once at launch and never again, despite prompts and integrations changing constantly. The effective approach combines continuous testing, least privilege, output validation, system-prompt protection, and treating all ingested content as untrusted.

Key takeaways

  • Prompt injection is the defining LLM vulnerability.
  • Indirect injection hides in content the model reads.
  • Impact ranges from data leakage to harmful agent actions.
  • There is no single patch; defences reduce risk in layers.
  • Test continuously and apply least privilege to agents.

Request a demo to see continuous, validated penetration testing in action.

Public cloud storage can expose sensitive data. Learn how to validate access, assess impact and confirm that remediation closes the exposure.

Fake websites and profiles can exploit customer trust. Learn how to identify brand impersonation and respond to digital abuse.

HTTP request smuggling exploits differences between servers. Learn how to test for this weakness and reduce exposure.

External Attack Surface

Discover and monitor every internet-facing asset you own.

Detect new CVEs and exposures as they appear.

Find misconfigurations across AWS, Azure and GCP.

Prove your security controls actually work.

Threat & Digital Risk

Our public threat intelligence platform, in real time.

Spot leaked credentials and targeted threats early.

AI-driven prioritisation that cuts through the noise.

Protect your brand, data and people beyond the perimeter.

API & Email Security

Discover and test externally exposed APIs.

Stop spoofing with SPF, DKIM and DMARC checks.

Dashboards and board-ready security reporting.

Continuously test your public web applications.

Stream validated findings to your SIEM, SOAR and ticketing tools.

Explore

See the full Attack Insights platform.

See Attack Insights in action.