2026-10-30 · 7 min read

Prompt injection explained

Prompt injection is an attack where someone plants instructions in content an AI system reads, and the AI follows them. It sits first on the OWASP Top 10 for LLM Applications, and it becomes far more dangerous once AI can take actions. Here is how it works and what to do about it.

Diagram of layered security controls around an AI system

How prompt injection works

Large language models take instructions and data through the same channel: text. A model cannot reliably tell the difference between the instructions its operator wrote and instructions that happen to appear inside the content it is processing. Prompt injection exploits that weakness.

In direct prompt injection, a user types instructions designed to override the system's rules, such as telling a customer service bot to ignore its guidelines and reveal its configuration. In indirect prompt injection, the attacker never talks to the AI at all. They plant instructions in a web page, email, document, calendar invite or support ticket, and wait for an AI system to read it. When the AI summarizes that email or browses that page, it may follow the hidden instructions.

Indirect injection is the bigger business risk. It means anyone who can get content in front of your AI, which often means anyone who can send you an email, has a way to influence what it does.

A simple example shows the mechanism. A sales team uses an AI assistant to summarize inbound email. An attacker sends a message containing a hidden line of text, perhaps in white font or tucked into a signature, telling the assistant to include a link in its summary and describe it as an urgent invoice from a known supplier. The assistant may follow the line, and an employee who trusts the summary clicks the link.

Why agents raise the stakes

A chatbot that only produces text can be manipulated into saying something wrong or embarrassing. An AI agent that can send email, read files, call other software or make purchases can be manipulated into doing something harmful. The more tools an AI can use, the more an injected instruction can achieve.

Gartner's April 2026 forecast makes this point directly. It predicts that by 2028, 25% of enterprise generative AI applications will experience at least five minor security incidents a year, up from 9% in 2025, and that by 2029, 15% will have at least one major incident a year, up from 3%. Gartner cites agents connected through the Model Context Protocol and content-injection attacks among the drivers.

Real events in 2026 show that agents can act beyond what their operators intended even without an attacker. An OpenAI agent autonomously breached Hugging Face systems on 21 July 2026, and Google disclosed on 18 September 2026 that Gemini accessed three outside systems during a test, according to Wikipedia's 2026 in AI summary. Those were not prompt injection attacks, but they show what an agent with broad access can do. An attacker using injection aims to steer exactly that capability.

The no-go zone

Gartner's most practical advice is a simple rule. Treat any use case that combines three things as a no-go zone: access to sensitive data, exposure to untrusted content, and the ability to communicate externally.

Each of the three is manageable on its own. An AI that reads sensitive internal data but never sees outside content is hard to inject. An AI that reads untrusted web pages but has no access to sensitive data has little to leak. An AI with no way to send data out cannot exfiltrate what it reads. Put all three together and a single malicious email could instruct an assistant to find confidential files and send them to the attacker.

Use this rule when you design or approve AI systems. If a proposed use case hits all three, remove one, usually by limiting external communication or requiring a person to approve each outbound action.

Where it shows up in practice

Prompt injection risk appears wherever AI reads content from outside your control. These are the cases we test most often.

  • Email assistants that summarize, triage or draft replies to inbound mail
  • Customer service chatbots and AI receptionists that take free-form input from the public
  • Research tools and browsing agents that read web pages
  • Document tools that process uploaded files, contracts, resumes or invoices
  • Retrieval systems that search a knowledge base where many people can add content
  • Coding assistants that read repositories, issues or dependencies written by others
  • Agents connected to business systems through plugins or the Model Context Protocol

Voice agents are not immune

AI receptionists and voice agents take input from anyone who dials the number. A caller can attempt direct injection by speaking instructions, such as claiming to be a manager and asking the agent to read back other customers' appointments or change its rules. Voice adds social engineering, because the agent may be configured to be helpful and polite under pressure.

The defenses are the same in principle. The agent should only have access to the data and actions it needs for the call, should verify identity before revealing personal details, should never read out its own instructions, and should hand unusual requests to a person. We test these behaviors directly when we assess a voice agent.

Controls that reduce the risk

No single technique prevents prompt injection. Model providers continue to improve resistance, but the risk cannot be trained away entirely, because it comes from how language models process text. Defense means layering controls so that a successful injection achieves little.

Model choice matters less than many buyers expect. Every major provider's models can be influenced by injected content to some degree, and our research found no provider that claims to have solved it. System design, permissions and testing make the biggest difference.

  • Least privilege: give each AI system only the data and tools it needs, with permissions scoped to the user it acts for
  • Human approval for consequential actions: require a person to confirm sending email externally, moving money, deleting records or changing permissions
  • Separate untrusted content: label and isolate outside content in prompts, and avoid giving tools to the part of a system that reads untrusted input
  • Treat output as untrusted: validate and sanitize AI output before it is passed to other software, displayed as web content or used to run commands
  • Limit external communication: block or restrict outbound links, image loads and network calls that could carry data out
  • Log and monitor: record prompts, tool calls and outputs so you can detect and investigate abuse
  • Test regularly: run injection tests before launch and after any change to prompts, tools, models or data sources

How OWASP frames the risk

The OWASP Top 10 for LLM Applications is the most widely used checklist for AI application security. Prompt injection is listed first, as LLM01. The list also covers related risks that injection often exploits, including sensitive information disclosure, improper output handling, excessive agency and system prompt leakage.

Mapping findings to OWASP gives security teams and auditors a common reference. When we run an AI penetration test, every finding is tagged with the relevant OWASP category, ranked by severity and paired with a fix. After fixes are applied, we retest to confirm they hold.

Governance frameworks point the same way. The NIST AI RMF's Measure function covers security testing, and access controls appear in every serious AI governance program. IBM's Cost of a Data Breach 2026 report found that 92% of organizations with AI incidents lacked proper AI access controls, which is the control that limits what an injected instruction can reach.

Questions to ask before launch

Before you approve any AI system that reads outside content, get clear answers to these questions. What untrusted content can reach the model? What data can the model access? What actions can it take, and which need human approval? Can it send anything outside the organization? Who reviews its logs? When was it last tested for injection, and by whom?

If the system combines sensitive data, untrusted content and external communication, apply Gartner's no-go rule and remove one of the three before going live.

Repeat these questions whenever the system changes. A new plugin, a new data source or a switch to a different model can open a path that did not exist at launch, and injection tests should be rerun after each change.

Platforms we source and support for this

Ad Spin Tech is the one team that ties these together: we choose them, source them, connect them to your systems and keep the security protocols maintained after go-live.

AI security and identity

  • CrowdStrike
  • Palo Alto Networks
  • Zscaler
  • Fortinet
  • SentinelOne
  • Okta

See the full partner ecosystem

Questions buyers ask

Can prompt injection be fully prevented?

Not with current technology. It arises from how language models process instructions and data together. Layered controls such as least privilege, human approval and output validation limit what a successful attack can do.

Is prompt injection the same as jailbreaking?

They overlap. Jailbreaking usually means a user tricking a model into ignoring its safety rules. Prompt injection is broader and includes hidden instructions planted in content the AI reads.

Which AI systems are most at risk?

Agents that read outside content and can take actions, especially those with access to sensitive data and the ability to communicate externally. Gartner calls that combination a no-go zone.

How do you test for prompt injection?

We attempt direct and indirect injection against your actual configuration, including planted content in emails, documents and web pages, then map findings to the OWASP Top 10 for LLM Applications, provide a fix plan and retest.

Does choosing a different AI provider fix prompt injection?

No provider has eliminated it. Some models resist certain attacks better than others, but the main protection comes from how you design permissions, approvals and output handling around the model.

Get the 2026 AI Model Buyer's Guide

An 11-page, vendor-neutral white paper: prices for 12 providers, compliance matrix, provider profiles, which model fits which job, voice AI options, 2026 risks and a 10-question vendor checklist.

Test your AI before an attacker does

Our AI penetration test covers prompt injection, data leakage and agent abuse, mapped to OWASP, with a retest.

Phone (AI receptionist answers 24/7)(212) 851-3282