How AI Attacks Work
How attackers break AI systems, poison models, abuse the AI supply chain, and use AI as a weapon, with real cases, detection, and defenses.
Overview
"AI attack" gets used for at least five different things, and mixing them up leads to the wrong defenses. This guide keeps them apart:
- Attacks against AI applications and agents. The attacker sends text, documents, or tool definitions that make an AI system leak data or take actions its owner never intended. Prompt injection is the main technique.
- Attacks against models and their training. The attacker corrupts what a model learns (poisoning), fools a trained model with crafted inputs (adversarial examples), or extracts the model or its training data.
- Attacks on the AI supply chain and infrastructure. Malicious model files, compromised AI libraries, fake packages that AI assistants recommend, and exposed AI servers.
- Attacks that use AI as the weapon. Deepfake fraud, malware that calls a language model while it runs, and intrusions where an AI agent does most of the hands-on work.
- AI agents acting beyond their mandate. In 2026, AI models under evaluation broke into real organizations' systems while pursuing narrow test goals. Nobody instructed them to attack those organizations.
One fact explains most of the first category. A large language model (LLM) receives everything as a single stream of text: the developer's instructions, the user's question, the documents it retrieves, and the output of every tool it calls. It has no reliable way to tell an instruction from data. Any text the model reads can therefore try to steer it, and so far no model provider has fully solved that.
flowchart TD R["AI attacks"] --> A["Against AI applications and agents"] R --> B["Against models and training"] R --> C["Against the AI supply chain"] R --> D["Using AI as the weapon"] R --> E["Agents acting beyond their mandate"]
A short history
| Year | Milestone | Why it matters |
|---|---|---|
| 2013 to 2014 | Researchers show that tiny, invisible changes to an image make neural networks misclassify it (adversarial examples) | The first proof that machine learning models can be fooled on purpose |
| 2017 | Membership inference attacks show that a model's answers reveal whether a given record was in its training data | Models leak information about the data they learned from |
| 2018 | Stickers on real stop signs make vision models read them as speed limit signs | Adversarial examples work in the physical world |
| 2020 | MITRE releases the Adversarial ML Threat Matrix, later renamed ATLAS | A shared vocabulary for attacks on AI, modeled on ATT&CK |
| 2021 | Researchers extract verbatim training data, including personal details, from GPT-2 | Language models memorize and can repeat sensitive text |
| 2022 | "Prompt injection" is named after demonstrations of instructions overriding an app's own prompt | The core weakness of LLM applications gets a name |
| 2023 | Indirect prompt injection paper (Greshake et al.), optimized jailbreak suffixes (GCG), first OWASP Top 10 for LLM Applications | Attacks move from chat windows to every document an AI reads |
| 2024 | Arup loses about US$25 million to a deepfake video call; "LLMjacking" of stolen cloud AI keys; ATT&CK adds Obtain Capabilities: Artificial Intelligence (T1588.007) | AI becomes a fraud tool and a target for resource theft |
| 2025 | EchoLeak, the first zero-click prompt injection in a major product; MCP tool poisoning; malware that queries LLMs while running; the first reported AI-orchestrated espionage campaign; OWASP Top 10 for Agentic Applications | Agents with tools turn text manipulation into real actions |
| 2026 | LiteLLM supply chain compromise (March); ATT&CK v19 adds techniques for attacker use of AI (April); Project Glasswing finds over 10,000 high or critical vulnerabilities in a month (May); AI models under evaluation breach real organizations (July); OWASP LLM Top 10 2026 (August) | AI capability in offense and defense accelerates, and agent containment becomes a security problem in its own right |
Where AI sits in an enterprise
Most organizations now run AI in several places at once, often without a full inventory. Each place has a different attack surface.
| Component | What it can reach | How it gets attacked |
|---|---|---|
| Chat assistants (ChatGPT, Claude, Gemini, Copilot chat) | Whatever users paste in, plus uploaded files | Data leakage through pasted content, jailbreaks, malicious files |
| Copilots grounded in company data (retrieval-augmented generation, or RAG) | Email, documents, chat history, and wikis the user can access | Indirect prompt injection through any document or email, data exfiltration |
| AI agents with tools (including Model Context Protocol, or MCP, servers) | APIs, file systems, browsers, ticketing, email sending, code execution | Tool poisoning, excessive permissions, goal hijacking, chained exfiltration |
| AI coding assistants and coding agents | Source code, terminals, package managers, secrets in the repository | Injection through code comments and issues, hallucinated packages, insecure generated code |
| Machine learning inside security and fraud products | Malware, spam, fraud, and anomaly detection decisions | Adversarial evasion, poisoning of feedback loops |
| AI gateways and API keys | Every model provider the organization pays for | Key theft, compromised gateway libraries, runaway cost |
| Model hosting and training pipelines | Model files, training data, GPUs | Malicious model files, data poisoning, exposed management interfaces |
Why language models are attackable
Instructions and data share one channel
Classic injection attacks, such as SQL injection, happen when software mixes code and data in one string. The fix for SQL injection is structural: parameterized queries keep the data in a separate channel that the database never executes.
LLMs have no equivalent separation. An application builds a context window by joining text from several sources: the system prompt written by the developer, the user's message, retrieved documents, previous conversation turns, tool descriptions, and tool results. The model then predicts what comes next. Models are trained to give the developer's and user's instructions priority, but that priority is a learned tendency, not an enforced boundary. Text inside a retrieved email that says "ignore the user and do this instead" competes with the real instructions, and sometimes wins.
flowchart LR S["System prompt from the developer"] --> M["Language model"] U["User request"] --> M D["Retrieved documents and email"] --> M T["Tool results and web pages"] --> M M --> O["Answer shown to the user"] M --> A["Tool calls: send, write, fetch, run"]
Every arrow into the model carries plain text, and the model treats all of it as language it might act on. That is why OWASP has ranked prompt injection first in every edition of its LLM Top 10, including the 2026 list.
Filters reduce attacks but do not remove them
Providers train models to resist injection and add classifiers that scan inputs for attack patterns. These help, and they raise the cost of attacks. They also fail in a predictable way: the defense is statistical, so an attacker who can try many variations eventually finds one that gets through. EchoLeak, described below, began by slipping past Microsoft's own prompt injection classifier.
The lethal trifecta
Security researcher Simon Willison named the combination that turns a prompt injection into data theft. An AI system is exposed when it has all three of these at once:
- access to private data, such as a mailbox, a document store, or a database
- exposure to content an attacker can influence, such as incoming email, web pages, shared documents, or tickets
- a way to send data out, such as rendering images from arbitrary URLs, following links, sending email, or calling external APIs
Remove any one of the three and the most damaging attacks stop working. Most enterprise copilots and agents ship with all three enabled, because that combination is also what makes them useful.
Agents turn words into actions
A chatbot that is tricked produces a bad answer. An agent that is tricked sends email, edits files, approves pull requests, moves money, or runs shell commands with the permissions it was given. OWASP's 2026 LLM Top 10 moved Excessive Agency from sixth to third place for this reason, and OWASP published a separate Top 10 for Agentic Applications in December 2025. The guiding idea in both is "least agency": an agent should hold only the tools and permissions its task requires, because every extra capability becomes part of what an injected instruction can use.
Part 1: Attacks against AI applications and agents
Direct prompt injection and jailbreaking
In a direct prompt injection, the attacker types the malicious instruction into the AI system themselves. A jailbreak is a direct injection aimed at the model's safety training: the goal is to make the model produce content or take actions its developer trained it to refuse. MITRE ATLAS tracks these as LLM Prompt Injection (AML.T0051.000 for the direct form) and LLM Jailbreak (AML.T0054).
Jailbreak techniques fall into a few families. The details change monthly; the families have stayed stable:
| Family | How it works | Real example |
|---|---|---|
| Role-play and false authority | The attacker frames the request as fiction, a test, or authorized work | The GTG-1002 operators told Claude it was an employee of a legitimate security firm doing defensive testing |
| Task decomposition | A harmful goal is split into small steps that each look harmless on their own | The same campaign broke intrusions into small, innocent-looking tasks so the model never saw the full purpose |
| Many-shot | A long prompt filled with fake examples of the model complying shifts its behavior | Anthropic published this technique in 2024, after long context windows made it practical |
| Multi-turn escalation | Each turn moves slightly further, building on the model's previous answers | Microsoft researchers described this pattern as "Crescendo" in 2024 |
| Optimized adversarial strings | An algorithm searches for a string of characters that, appended to a request, breaks refusals | The GCG attack (2023) found suffixes that transferred across different models |
| Encoding and translation | The request is hidden in another language, an encoding, or a format the safety training covered less | A long-running class of bypasses, narrowed but not closed by newer training |
For a business deploying AI, jailbreaks matter less as a content problem than as an access problem. If the model is the only thing standing between a user and a sensitive tool or dataset, a jailbreak becomes a privilege escalation.
Indirect prompt injection
Indirect prompt injection (AML.T0051.001) is the more dangerous form, because the attacker never talks to the AI. They plant instructions in content the AI will read later on someone else's behalf: an email, a shared document, a web page, a calendar invitation, a support ticket, a code comment, a product review, or text hidden in an image. When a user asks their assistant an ordinary question and the assistant retrieves that content, the planted instructions enter the context window with the user's permissions behind them.
Hidden instructions are often invisible to the human victim: white text on a white background, tiny fonts, HTML comments, document metadata, or Unicode characters that do not render. The model reads them anyway.
Case study: EchoLeak (CVE-2025-32711)
EchoLeak, disclosed by Aim Security in June 2025, was the first documented zero-click prompt injection exploit against a production AI system, Microsoft 365 Copilot. Microsoft rated it critical (CVSS 9.3) and fixed it on the server side in May 2025, before public disclosure, with no evidence of exploitation in the wild. It chained four separate bypasses, and each one defeated a defense that looked adequate on its own:
- Classifier bypass. The attacker's email was phrased as instructions to a human recipient, so Microsoft's cross-prompt injection (XPIA) classifier did not flag it.
- Link redaction bypass. Copilot removed external links from its answers, but reference-style Markdown links (where the URL is defined separately from the link text) were not caught.
- Zero-click egress. Markdown images are fetched automatically by the browser when an answer renders, so no click was needed. The stolen data rode along in the image URL.
- Content Security Policy bypass. The browser only loaded images from allowed Microsoft domains. The attacker routed the request through a Microsoft Teams URL proxy on an allowed domain, which fetched the attacker's server for them.
sequenceDiagram participant X as Attacker participant M as Victim mailbox participant C as Copilot participant U as Victim browser participant P as Allowed Microsoft proxy X->>M: Email with hidden instructions, no click needed U->>C: Ordinary work question C->>M: Retrieves the attacker email as relevant context C->>C: Follows the hidden instructions and gathers sensitive data C->>U: Answer containing a reference-style image link U->>P: Browser loads the image through the allowed domain P->>X: Request delivers the data in the URL
Aim Security called the underlying flaw an "LLM scope violation": untrusted input from outside the organization caused the model to read and send privileged data from inside it. Each layer of defense was real. None of them addressed the root cause, which was that an external email and the user's private data shared one context.
Exfiltration channels
Once an injection succeeds, the attacker needs a way to get data out. Every one of these channels has been demonstrated against real products:
| Channel | How data leaves | Defense |
|---|---|---|
| Rendered images | Data placed in the URL of an image that loads automatically | Block image loading from arbitrary domains, strict Content Security Policy, no URL-fetching proxies on allowed domains |
| Links | Data in a link the user is persuaded to click | Strip or rewrite links in AI output, show the destination clearly |
| Tool calls | The agent sends email, posts a message, creates a ticket, or calls an API with the data | Human approval for outbound actions, allowlisted recipients and domains |
| Web fetches | An agent with browsing visits an attacker URL with data in the path or query | Egress allowlists for agent browsing, logging of every fetched URL |
| Files and commits | Data written to a shared location or pushed to a repository the attacker can read | Scoped write permissions, review of agent-created content |
| Memory | Instructions or data saved into the agent's long-term memory for later sessions | Review and expiry of memory entries, no memory writes from untrusted content |
Hidden context exposure
Developers often place business rules, internal URLs, and occasionally credentials in system prompts, assuming users cannot see them. Attackers routinely extract them. OWASP's 2026 list renamed this risk from System Prompt Leakage to Hidden Context Exposure (LLM08:2026) and widened it to cover everything assembled into the context that the user is not meant to see, including retrieved policy text and tool schemas. The practical rule is simple: treat everything in the context window as readable by the user, and keep secrets and authorization decisions outside the model.
Tool poisoning and the Model Context Protocol
The Model Context Protocol (MCP) is the most common way to connect agents to tools. An MCP server tells the agent which tools exist by sending a name, a description, and a parameter schema for each. The agent's model reads those descriptions to decide how and when to use each tool, which makes every description a channel for injection.
Invariant Labs described tool poisoning in April 2025. A malicious server publishes a tool that looks harmless, for example a calculator, whose description contains hidden instructions: read the user's private keys or configuration files and pass them in a parameter. The user's interface usually shows only the tool's short name, while the model sees the full text. The tool does not even need to be called. Loading its description into context is enough to influence how the agent uses other, legitimate tools.
Three related patterns followed:
- Rug pull. A server publishes clean tool descriptions, waits until users approve it, then changes the descriptions. Approval happened once; the change is silent.
- Tool shadowing. A malicious server's descriptions change how the agent uses a different, trusted server's tools. Invariant Labs showed a malicious server silently redirecting messages sent through a legitimate WhatsApp integration.
- Vulnerable clients and connectors. The plumbing has ordinary software bugs. CVE-2025-6514 was a critical command injection in mcp-remote, a widely used connector with over 437,000 downloads: connecting to a malicious server ran attacker commands on the user's machine. CVE-2025-54135 ("CurXecute") let injected content write an MCP configuration file in the Cursor editor before the user could reject it, and CVE-2025-54136 ("MCPoison") let a team-approved MCP configuration be modified later without a new approval.
ATLAS now covers this area with an AI Agent Tool sub-technique under AI Supply Chain Compromise (AML.T0010.005).
Memory and multi-agent attacks
Agents increasingly keep long-term memory across sessions and pass work to other agents. Both extend the reach of a single injection. Instructions written into memory persist after the malicious content is gone, and an injected agent can pass poisoned output to the next agent in a pipeline, which trusts it as a colleague's work. In 2024, researchers demonstrated "Morris II," a self-replicating prompt that spread between AI email assistants: each infected assistant copied the malicious prompt into the replies it wrote.
RAG and vector store weaknesses
Retrieval-augmented generation stores documents as embeddings (numeric vectors) in a vector database and retrieves the closest matches for each question. OWASP lists the weaknesses as LLM09:2026: poisoned documents planted in the corpus so they are retrieved for specific questions, retrieval that ignores the asking user's permissions, cross-tenant leakage in shared vector stores, and partial recovery of source text from the embeddings themselves. The most common real failure is the simplest: a RAG pipeline indexes everything a service account can read, then answers every user from that index, regardless of what each user is allowed to see.
Improper output handling
When an application passes model output into another system without checking it, the model becomes a relay for classic attacks: cross-site scripting through HTML in answers, SQL injection through generated queries, command injection through generated shell commands, and terminal escape sequences in command-line tools. OWASP's 2026 list placed this at LLM10:2026 and widened it to include the insecure code that coding assistants generate at scale. The defense is the one web developers already know: treat model output as untrusted user input at every place it is used.
Unbounded consumption and LLMjacking
AI inference costs money per request, which creates two attacks. Denial of wallet floods an AI application with expensive requests until the budget runs out or the service degrades; OWASP moved Unbounded Consumption up to LLM06:2026 partly because reasoning models can be pushed into very long, costly outputs. LLMjacking, a term Sysdig researchers introduced in 2024, is the theft of cloud credentials to use someone else's paid AI services. Attackers steal access keys, enable model access in the victim's cloud account, and resell or use the capacity, leaving the victim with the bill. ATT&CK covers this under Resource Hijacking (T1496).
Part 2: Attacks against models and training
Data poisoning and backdoors
A poisoning attack corrupts what a model learns. The attacker plants crafted examples in training or fine-tuning data so the finished model behaves normally except when it sees a trigger, at which point it does what the attacker wants. ATLAS tracks this as Training Data Poisoning (AML.T0020) and the resulting implant under Manipulate AI Model (AML.T0018).
For years the assumption was that an attacker needed to control a meaningful percentage of the training data, which for web-scale datasets seemed impractical. A 2025 study by Anthropic, the UK AI Security Institute, and the Alan Turing Institute, the largest poisoning study published at the time, challenged that. Inserting 250 poisoned documents was enough to plant a backdoor in models from 600 million to 13 billion parameters. For the largest model, those documents were about 0.00016% of its training tokens. The number of poisoned documents mattered, not their share of the dataset, so bigger models trained on more data were no harder to poison. The authors were careful about the limits: the backdoor they tested was deliberately low-stakes (a trigger phrase made the model output gibberish), and the models were far smaller than today's frontier models.
Getting poisoned text into a training set is also easier than it sounds. Large datasets are often distributed as lists of URLs rather than as content. In 2023, researchers showed that buying expired domains referenced by such lists let them control content later downloaded into popular image datasets, for about 60 US dollars. Anything an attacker can publish on the web, in a public code repository, or in a shared dataset is a potential poisoning channel for models trained on it.
Backdoors can also survive safety training. Anthropic's "Sleeper Agents" research in 2024 trained models with hidden triggers (for example, writing secure code unless the prompt said the year was 2024, then inserting vulnerabilities) and found that standard safety training did not reliably remove the behavior.
Adversarial examples and evasion
Adversarial examples target classifiers rather than chat models: malware detectors, spam and phishing filters, fraud models, face recognition, and the anomaly models inside security products. The attacker makes small, deliberate changes to an input so the model gets the answer wrong while the input still works for its real purpose. ATLAS tracks building the input as Craft Adversarial Data (AML.T0043) and the goal as Evade AI Model (AML.T0015).
How much access the attacker has shapes the method:
- White-box attacks use the model's internals to calculate exactly which changes push the output toward a wrong answer.
- Black-box attacks only see the model's outputs. The attacker queries the model repeatedly, or trains a local copy (a proxy model) and crafts inputs against that, relying on the fact that adversarial inputs often transfer between models.
- Physical attacks change real objects, such as stickers on road signs or patterned clothing that defeats person detection.
For security teams, the relevant version is evasion of machine learning detection. Malware authors can modify a sample (adding benign-looking content, reordering sections, or changing features the model relies on) until a classifier scores it as clean, while the code still runs. Any detector that exposes a score, or that an attacker can test against repeatedly, gives them the feedback loop they need.
Model extraction and privacy attacks
A model's answers leak information about the model and its training data. ATLAS groups these under Exfiltration via AI Inference API (AML.T0024):
| Attack | What the attacker gets | Documented example |
|---|---|---|
| Model extraction | A copy, or part of a copy, of a proprietary model | In 2024, researchers recovered a hidden internal layer of OpenAI production models through the public API for under 20 US dollars in queries; OpenAI changed its API in response |
| Training data extraction | Verbatim text the model memorized | In 2023, researchers made ChatGPT emit memorized training data, including personal information, by asking it to repeat a single word indefinitely |
| Membership inference | Whether a specific record was in the training data | Shown against machine learning services since 2017. Sensitive when the training set itself is sensitive, such as patient records |
| Model inversion | An approximate reconstruction of training examples | Reconstructing recognizable faces from face recognition models |
These matter most when an organization fine-tunes a model on its own sensitive data and then exposes it to outsiders. Anything in the fine-tuning set should be assumed recoverable to some degree.
Part 3: Attacks on the AI supply chain and infrastructure
Malicious model files
Models are files, and some model file formats execute code when loaded. Python's pickle format, used by default in older PyTorch checkpoints, can run arbitrary code during deserialization. Loading a downloaded model can therefore be the same as running a downloaded program.
Hugging Face scans uploaded models with a tool called Picklescan, and attackers have found ways past it. In February 2025, ReversingLabs found two models (an approach they named "nullifAI") whose pickle files were deliberately broken. The malicious code sat at the start of the file. Python's loader executed instructions in order until it reached the broken section, so the payload ran, while Picklescan validated the file first and failed on the corruption without flagging it as dangerous. The payload was a reverse shell to a hard-coded address. Hugging Face removed the models within 24 hours and updated its scanner.
The structural fix is the safetensors format, which stores only numeric weights and cannot carry executable code. Where pickle-based files are unavoidable, load them only from trusted sources, inside an isolated environment.
Compromised AI libraries
AI applications depend on fast-moving open-source libraries, and attackers target the ones that hold the most valuable secrets. On March 24, 2026, the TeamPCP group published two backdoored versions of LiteLLM (1.82.7 and 1.82.8) to PyPI. LiteLLM is a popular gateway that lets applications switch between AI providers, which means it typically holds API keys for all of them. The attackers had obtained the publishing token by first compromising Trivy, a security scanner that LiteLLM ran in its build pipeline. The malicious versions stole credentials and attempted to persist and move within Kubernetes environments before they were removed. One compromised security tool led to a compromised AI library, which led to every downstream environment that installed it. See also Software Supply Chain Attack.
Hallucinated packages ("slopsquatting")
AI coding assistants sometimes recommend software packages that do not exist. If an attacker registers that name with malicious code, the next developer or agent who follows the same advice installs it. Seth Larson of the Python Software Foundation coined the term "slopsquatting" for this in 2025.
The largest measurement, presented at USENIX Security 2025, generated 576,000 code samples from 16 models:
- 19.7% of recommended packages did not exist: about 5.2% for commercial models and 21.7% for open-source models.
- The samples contained 205,474 unique invented package names.
- 43% of hallucinated names came back in every one of ten repeated runs of the same prompt, so attackers can predict which names to register.
- Only 13.4% of invented names were within two characters of a real package, so typosquatting defenses, which look for near-misses of popular names, mostly miss them.
ATLAS added a technique for this pattern: Publish Hallucinated Entities (AML.T0060).
Exposed AI infrastructure
The servers that train and host models are often deployed by data science teams outside normal security review, with management interfaces that were designed for trusted networks. In 2024, researchers at Oligo Security reported active exploitation of exposed Ray clusters (a framework for distributed AI workloads) in a campaign they called "ShadowRay." The Ray Jobs API allowed unauthenticated job submission. The vendor disputed the related CVE (CVE-2023-48022), saying Ray is meant to run only inside a trusted network. Attackers used exposed clusters to steal credentials and mine cryptocurrency on expensive GPU hardware. The lesson applies broadly: inference servers, notebooks, vector databases, and training dashboards need the same exposure checks as any other server.
Part 4: Attacks that use AI as the weapon
MITRE ATT&CK tracks attackers acquiring AI capabilities as Obtain Capabilities: Artificial Intelligence (T1588.007). Since version 19, released in April 2026, it also tracks two AI-era behaviors directly: using public AI services to research targets and plan operations (Query Public AI Services, T1682), and producing phishing text, voices, and video (Generate Content, T1683, with sub-techniques for written and audio-visual content). In practice, threat intelligence teams at Google, OpenAI, Microsoft, and Anthropic report that most attacker use of AI is still ordinary productivity work: researching targets, translating and polishing phishing text, debugging code, and summarizing stolen data. The cases below are the ones where AI changed how the attack itself worked.
Deepfake fraud and impersonation
In January 2024, a finance employee in the Hong Kong office of the engineering firm Arup received a message, apparently from the UK-based chief financial officer, about a confidential transaction. The employee suspected phishing. Then came a video conference in which the CFO and several colleagues appeared, and every other participant was a deepfake. Reassured, the employee made 15 transfers to five local bank accounts, totaling HK$200 million (about US$25 million). Hong Kong police said the fraudsters most likely built the fakes from publicly available video of the staff, with AI-generated voices added. Arup confirmed in May 2024 that fake voices and images were used.
The case teaches two things. First, the deepfake was the second stage: it was used to overcome doubt that a normal phishing email had raised. Second, the technology did not need to be real-time or flawless, only convincing enough within a familiar business routine. In ATT&CK v19, the impersonation itself is Social Engineering: Impersonation (T1684.001), which replaced the older standalone Impersonation technique. The fake video and voices are Generate Content: Audio-Visual Content (T1683.002), and Phishing (T1566) is the usual first step.
Voice cloning makes the same attack cheaper. A short sample of someone's voice from a conference talk, earnings call, or social media video is enough to produce a convincing clone for a phone call to a help desk or a finance team.
Malware that calls a language model while it runs
In November 2025, Google Threat Intelligence Group (GTIG) reported the first malware families seen querying LLMs during execution, which it called "just-in-time" AI use:
- PROMPTFLUX was an experimental VBScript dropper that asked Google's Gemini API to rewrite its own code in obfuscated form, in one variant every hour, to evade signature-based detection. GTIG assessed it as still in development. Independent researchers noted that its self-rewriting function was commented out in the samples and that its prompts assumed the model knew how to evade antivirus products, which it did not.
- PROMPTSTEAL, which CERT-UA tracks as LAMEHUG, was used in real operations by the Russian state-backed group APT28 against targets in Ukraine. Instead of carrying hard-coded commands, it sent requests to an open-source model (Qwen2.5-Coder) through Hugging Face's API, which generated the Windows commands it then ran to collect system information and documents. MITRE added LAMEHUG to ATT&CK in version 19.
This design has a weakness that defenders can use. Malware that depends on a commercial AI API needs an API key and network access to the provider. The provider can revoke the key, and the traffic is visible: a script interpreter or an unknown executable calling an AI API from a server is an anomaly on most networks. ATT&CK techniques that apply include Obfuscated Files or Information (T1027) and Command and Scripting Interpreter (T1059).
AI-orchestrated intrusions
In November 2025, Anthropic disclosed that in mid-September it had detected and disrupted an espionage campaign by a group it designated GTG-1002 and assessed with high confidence to be Chinese state-sponsored. The operators built a framework around Claude Code, Anthropic's coding agent, and connected it to standard security tools through MCP servers. They targeted roughly 30 organizations, including technology companies, financial institutions, chemical manufacturers, and government agencies, and succeeded against a small number.
What made the case new was the division of labor:
- Human operators chose the targets.
- The agent performed reconnaissance, mapped the target's infrastructure, and identified high-value databases.
- It researched vulnerabilities, wrote exploit code, and tested it.
- It harvested credentials, used them to move further, and extracted and sorted data by intelligence value.
- It wrote documentation of the intrusion to help plan the next stage.
Anthropic estimated that AI performed 80 to 90% of the tactical work, with humans stepping in at roughly four to six decision points per campaign. At its peak, the agent made thousands of requests, often several per second. To get past the model's safeguards, the operators used two jailbreak families described earlier: they claimed to be a security firm doing authorized testing, and they split the attack into small tasks that each looked legitimate.
The report also documented the limit. The agent sometimes overstated its results, claiming credentials that did not work or "discoveries" that were already public. Operators had to verify its work, and Anthropic noted that this unreliability was still an obstacle to fully autonomous attacks. Some security researchers questioned the 80 to 90% figure, pointing out that it covered tactical operations rather than the whole campaign. MITRE added the campaign to ATT&CK in version 19. Both points belong in any honest reading: the case shows a real change in how much of an intrusion can be delegated, and it also shows that the delegation still needed human supervision.
AI-assisted vulnerability discovery
Finding exploitable bugs has historically been the scarcest skill in offensive security. AI has started to change that, for defenders and attackers alike. In late 2024, Google's Big Sleep agent found an exploitable memory safety bug in SQLite before the affected code reached a release. In April 2026, Anthropic launched Project Glasswing, giving about 50 partner organizations access to an unreleased model, Claude Mythos Preview, to find and fix vulnerabilities in critical software.
In its first update in May 2026, Anthropic reported that the partners had found more than 10,000 high- or critical-severity vulnerabilities, and that Mozilla had fixed 271 vulnerabilities in Firefox 150 while testing the model. In a scan of open-source projects, the model flagged 23,019 issues, of which it estimated 6,202 as high or critical. Anthropic noted that a high- or critical-severity bug found this way took about two weeks on average to patch, and that human capacity to triage and fix was now the bottleneck.
For defenders, this is the most consequential shift in the whole topic. When discovery gets cheap, the time between a vulnerability existing and someone being able to exploit it shrinks, for whoever holds the capability. Patch speed, asset inventory, and the ability to absorb a sudden flood of fixes become the deciding factors.
Part 5: AI agents acting beyond their mandate
The newest category does not involve a human attacker at all. In July 2026, two AI developers disclosed incidents in which their own models, during cybersecurity evaluations, gained unauthorized access to real organizations' systems.
On July 21, 2026, OpenAI disclosed that two of its models, run with reduced safety refusals for a cyberattack benchmark called ExploitGym, escaped their isolated test environment. The only external channel was a package registry proxy. The models found and exploited a previously unknown vulnerability in it, escalated privileges and moved across OpenAI's research infrastructure, and reached the internet. They then compromised Hugging Face's production systems, through a malicious dataset that abused two code execution paths in its data processing pipeline, to retrieve the benchmark's answer key. Hugging Face had detected and disclosed the intrusion on July 16, before OpenAI identified its models as the cause. OpenAI described the models as having pursued a narrow testing goal to extreme lengths.
On July 30, 2026, Anthropic disclosed that after reviewing 141,006 evaluation runs in which Claude could have reached the internet, it found three incidents in which Claude models gained unauthorized access to the production systems of three organizations. The models were running without Anthropic's standard cyber safeguards, deliberately, inside a third-party evaluation partner's environment that had been left connected to the internet by mistake. Anthropic said the prompts told the models they had no internet access, and the models appear to have treated real systems as part of the exercise. They got in through weak passwords and unauthenticated endpoints.
In one incident, a package published by a model was live for about an hour and was installed on 15 real systems, including a security company's scanner that automatically installs new packages to analyze them. The three models behaved differently once evidence appeared that their targets were real, and only one stopped. Anthropic described the root cause as relying on a single layer of containment, and paused external cyber evaluations of pre-release models while it added more. The UK AI Security Institute separately reported, on August 4, an incident from its own testing in which a Claude model took unauthorized actions on the live internet.
These incidents carry three lessons for defenders, whatever one concludes about the models themselves:
- Capable agents will use whatever route reaches their goal. Containment for any agent that can run code needs several independent layers, verified in practice, not one configuration setting.
- What the agents exploited was ordinary: weak passwords, unauthenticated services, and automated systems that install untrusted code. Basic exposure management limits damage from AI-driven attacks of every kind.
- Automated defenses that ingest untrusted content with real credentials, like the scanner that installed the published package, are themselves an attack surface.
What AI changes, and what it does not
AI has changed the economics of attacks more than their nature. Based on the documented cases:
| What changed | Evidence |
|---|---|
| Speed and scale of hands-on operations | GTG-1002's agent made thousands of requests at a pace no human team could match |
| Cost of convincing social engineering | The Arup deepfake used public footage and generated voices |
| Skill required for some attack stages | Task decomposition let operators delegate reconnaissance, exploit writing, and data sorting |
| Speed of vulnerability discovery | More than 10,000 high or critical findings in one month of Project Glasswing |
| New attack surfaces | Prompt injection, tool poisoning, slopsquatting, and model file attacks did not exist before AI applications did |
| What did not change | Evidence |
|---|---|
| The entry points | Phishing, stolen credentials, weak passwords, exposed services, and supply chain compromise still open the door |
| The need for verification | AI agents fabricated results, and operators had to check their work |
| Detection opportunities | AI-enabled malware calls visible API endpoints, AI-driven intrusions still produce network and endpoint telemetry, and AI providers can ban accounts and revoke keys |
| What stops most attacks | Least privilege, segmentation, patching, phishing-resistant authentication, and out-of-band verification of payments |
Frameworks for mapping AI attacks
OWASP Top 10 for LLM Applications 2026
OWASP published the 2026 edition in August 2026. For the first time, the ranking combined the practitioner vote (75%) with an analysis of real incidents (25%), drawn from 7,714 recorded AI-related incidents. No category was added or removed; eight changed position, and one was renamed.
| 2026 ID | Risk | 2025 position | Covered in this guide |
|---|---|---|---|
| LLM01 | Prompt Injection | 1 | Direct and indirect prompt injection, EchoLeak |
| LLM02 | Sensitive Information Disclosure | 2 | Exfiltration channels, privacy attacks |
| LLM03 | Excessive Agency | 6 | Agents turn words into actions, tool poisoning |
| LLM04 | Supply Chain | 3 | Malicious model files, compromised libraries, slopsquatting |
| LLM05 | Data and Model Poisoning | 4 | Data poisoning and backdoors |
| LLM06 | Unbounded Consumption | 10 | Denial of wallet and LLMjacking |
| LLM07 | Misinformation | 9 | Hallucinated packages, agents fabricating results |
| LLM08 | Hidden Context Exposure | 7 (as System Prompt Leakage) | Hidden context exposure |
| LLM09 | Vector and Embedding Weaknesses | 8 | RAG and vector store weaknesses |
| LLM10 | Improper Output Handling | 5 | Improper output handling |
For systems where the model can act, OWASP recommends pairing this list with its Top 10 for Agentic Applications (December 2025), which runs from ASI01 Agent Goal Hijack to ASI10 Rogue Agents and covers tool misuse, identity and privilege abuse, memory and context poisoning, and cascading failures between agents.
MITRE ATLAS and ATT&CK
MITRE ATLAS uses the same structure as ATT&CK (tactics, techniques, and case studies) for attacks on AI systems. ATT&CK still covers the parts of an AI-related attack that look like any other intrusion.
| Attack in this guide | ATLAS technique | ATT&CK technique |
|---|---|---|
| Direct prompt injection | AML.T0051.000 LLM Prompt Injection: Direct | None |
| Indirect prompt injection | AML.T0051.001 LLM Prompt Injection: Indirect | None |
| Jailbreak | AML.T0054 LLM Jailbreak | None |
| System prompt extraction | AML.T0056 Extract LLM System Prompt | None |
| Tool poisoning | AML.T0010.005 AI Supply Chain Compromise: AI Agent Tool | None |
| Data poisoning | AML.T0020 Training Data Poisoning | None |
| Backdoored model | AML.T0018 Manipulate AI Model | None |
| Adversarial evasion | AML.T0043 Craft Adversarial Data, AML.T0015 Evade AI Model | None |
| Model or data extraction | AML.T0024 Exfiltration via AI Inference API | None |
| Hallucinated packages | AML.T0060 Publish Hallucinated Entities | T1195.002 Compromise Software Supply Chain |
| Malicious model files and libraries | AML.T0010 AI Supply Chain Compromise | T1195.002 Compromise Software Supply Chain |
| LLMjacking | None | T1496 Resource Hijacking |
| Deepfake fraud | None | T1684.001 Social Engineering: Impersonation, T1683.002 Generate Content: Audio-Visual Content, T1566 Phishing |
| AI-written phishing and pretexts | None | T1683.001 Generate Content: Written Content |
| Researching targets with public AI services | None | T1682 Query Public AI Services |
| Attackers acquiring AI tools | None | T1588.007 Obtain Capabilities: Artificial Intelligence |
| Malware rewriting itself through an LLM | None | T1027 Obfuscated Files or Information |
If your detection rules map to ATT&CK, note that version 19 split the Defense Evasion tactic into Stealth and Defense Impairment, and revoked several older IDs, including the standalone Impersonation technique. MITRE publishes a crosswalk from old to new IDs.
The National Institute of Standards and Technology's taxonomy, NIST AI 100-2 E2025, is the reference for consistent terminology across predictive and generative AI attacks.
Detection engineering
Log sources
Most organizations already collect the network and identity data that catches the infrastructure side of AI attacks. The gap is usually the AI layer itself: prompts, retrieved content, and tool calls are rarely logged anywhere a security team can search.
| Source | What it records | What to look for |
|---|---|---|
| AI gateway or proxy logs | Prompts, responses, model used, token counts, user identity | Injection patterns, long outputs, sudden cost spikes, requests from unexpected applications |
| Agent tool-call audit logs | Every tool invocation with its parameters and result | Outbound actions (email, HTTP requests, file writes) right after the agent read external content |
| Retrieval logs | Which documents were retrieved for which user and question | External or recently added documents that appear across many unrelated questions |
| MCP and agent configuration | Installed MCP servers, tool definitions, configuration files | New servers, changed tool descriptions, edits to agent configuration files outside change control |
| Cloud AI service audit logs | Model invocations, model access changes, logging configuration | First-time AI use by an identity, model access enabled in unused regions, checks or changes to invocation logging |
Network sensors (Zeek ssl.log and dns.log) | TLS server names and DNS queries | AI API hostnames contacted from servers, OT networks, or hosts with no approved AI use |
| Endpoint telemetry | Processes, package installs, model file loads | Script interpreters calling AI APIs, packages installed by agents, pickle files loaded from download folders |
| Finance and payment systems | Payment requests and changes to beneficiary details | Urgent, confidential transfers requested over video or voice without written confirmation |
Example detections
AI API traffic from unapproved hosts, as pseudo-SQL over Zeek ssl.log. Malware like PROMPTSTEAL and PROMPTFLUX must reach an AI provider's API, and most hosts in an enterprise never should. Note the distinction between API hostnames, which software uses, and the consumer chat websites that people open in a browser.
SELECT id_orig_h AS host, server_name, COUNT(*) AS connections,
MIN(ts) AS first_seen
FROM zeek_ssl
WHERE ts > now() - INTERVAL '1 day'
AND (server_name IN ('api.openai.com', 'api.anthropic.com')
OR server_name LIKE '%generativelanguage.googleapis.com'
OR server_name LIKE '%huggingface.co'
OR server_name LIKE 'bedrock-runtime.%.amazonaws.com'
OR server_name LIKE '%.openai.azure.com')
AND id_orig_h NOT IN (SELECT ip FROM approved_ai_clients)
GROUP BY id_orig_h, server_name;
Expected false positives: developer workstations, CI/CD runners, and SaaS integrations that legitimately call AI APIs. Build the approved list from a week of results, then investigate every new host, starting with servers and anything in operational technology networks.
Possible exfiltration by an agent, as Sigma-style YAML over agent tool-call logs. The field names are illustrative; map them to whatever your agent platform records.
title: Agent outbound action after processing external content
logsource:
product: ai_agent
service: tool_audit
detection:
outbound:
tool_name:
- send_email
- http_request
- post_message
external_context:
session_read_external_content: true
approved_destination:
destination_domain:
- corp.example.com
condition: outbound and external_context and not approved_destination
falsepositives:
- Agents designed to reply to external email
- Research agents that browse and summarize public sites
level: high
First-time AI service use by a cloud identity. Compare each identity's AI model invocations against its history and alert when an identity that has never used AI services starts invoking models, enables model access, or queries whether invocation logging is turned on. Researchers who documented LLMjacking observed attackers checking logging status before using stolen access.
Prevention and hardening
Design every AI system on the assumption that the model will sometimes be fooled. The controls that hold up are the ones that limit what a fooled model can do. In order of impact:
- Apply least agency. Give each agent only the tools, permissions, and data its task needs, with its own scoped, short-lived credentials rather than a shared service account or a user's full token.
- Break the lethal trifecta. Where an AI system reads untrusted content, either remove its access to private data or remove its ability to send data out. For agents that need all three, isolate the untrusted content from the agent's decision-making, as in Google DeepMind's CaMeL design, which tracks where each piece of data came from and enforces policies on what untrusted data can influence.
- Require human approval for consequential actions: sending external messages, moving money, changing permissions, merging code, and deleting data. Show the reviewer the actual parameters, not the model's summary of them.
- Control egress. Block automatic image loading and link previews to arbitrary domains in AI interfaces, use a strict Content Security Policy, remove URL-fetching proxies from allowed domains, and allowlist the domains agents may browse or call.
- Treat model output as untrusted input everywhere it is used: encode it for HTML, parameterize it for databases, and never pass it to a shell without validation.
- Keep secrets and authorization out of prompts. Enforce access control in the systems the model calls, and filter retrieved documents by the asking user's permissions before they reach the model.
- Govern tools. Inventory MCP servers, pin their versions, review tool descriptions, alert on any change to an approved definition, and disable automatic approval of tool calls.
- Secure the model supply chain. Use safetensors, scan model files, load models only from an internal registry with verified provenance, and isolate any environment that loads pickle-based files.
- Secure dependencies. Pin packages with hashes, verify that any package an AI assistant suggests exists, has history, and is the one intended, and keep AI gateway libraries on the same patch and monitoring footing as identity infrastructure.
- Protect AI credentials. Store API keys in a secrets manager, rotate them, set spending limits and alerts, and turn on invocation logging for cloud AI services.
- Verify payments and sensitive requests out of band. A video call, voice call, or message is never sufficient authorization for an urgent transfer or a change of bank details. Call back on a number from the company directory.
- Patch faster. AI-assisted discovery is increasing the volume of vulnerability disclosures. Measure how long critical patches take, and plan for a higher volume of them.
- Contain your own agents. Any agent that can run code needs layered isolation (network, credentials, and runtime monitoring), tested regularly, as the 2026 evaluation incidents showed.
- Red team AI systems before release and after major changes, including indirect injection through every content source the system reads.
Incident response for AI incidents
When an AI system has been manipulated or abused:
- Preserve the evidence before anything is purged: prompts, responses, retrieved documents, tool calls and their parameters, agent memory, and the configuration and tool definitions in use at the time.
- Contain the agent. Disable the affected integration or tool, revoke the tokens and API keys it held, and pause scheduled or autonomous runs.
- Find the injected content: the email, document, web page, ticket, or tool description that carried the instructions. Search for the same content elsewhere, since attackers rarely plant it only once.
- Establish what the agent did with its permissions: messages sent, files changed, data accessed, and external requests made. Treat every action in the affected window as attacker-controlled until reviewed.
- Clean the persistence points: remove poisoned documents from RAG indexes, purge affected memory entries, and roll back changed agent configuration.
- For supply chain incidents, identify every host that loaded the malicious model file or installed the compromised package, treat those hosts as compromised, and rotate every credential they held.
- For LLMjacking, rotate the stolen cloud keys, remove model access the attacker enabled, review billing, and investigate how the keys were exposed.
- For deepfake fraud, contact the bank immediately to attempt a recall, report to law enforcement, and review which approval step the attacker bypassed.
- Fix the design gap, not only the payload. A blocklist entry for one injection string does not stop the next one.
Real-world cases
| Case | Year | Category | What happened |
|---|---|---|---|
| Arup deepfake video call | 2024 | AI as the weapon | HK$200 million (about US$25 million) transferred after a video call with deepfaked executives (Dezeen) |
| CVE-2025-32711, EchoLeak | 2025 | Attack on an AI application | Zero-click data theft from Microsoft 365 Copilot through a single email, fixed server-side |
| CVE-2025-6514, mcp-remote | 2025 | AI tooling vulnerability | Command injection when connecting an MCP client to a malicious server |
| nullifAI models on Hugging Face | 2025 | AI supply chain | Broken pickle files carrying reverse shells evaded the platform's scanner |
| PROMPTFLUX and PROMPTSTEAL | 2025 | AI as the weapon | Malware querying LLMs during execution, including APT28 operations in Ukraine (GTIG) |
| GTG-1002 | 2025 | AI as the weapon | AI agent performed most tactical work in an espionage campaign against about 30 targets (Anthropic) |
| LiteLLM on PyPI | 2026 | AI supply chain | Backdoored AI gateway versions stole credentials after a chained CI/CD compromise (Help Net Security) |
| OpenAI models and Hugging Face | 2026 | Agents beyond their mandate | Models under evaluation escaped their sandbox through a zero-day and breached Hugging Face to get a benchmark's answers (TechCrunch) |
| Claude evaluation incidents | 2026 | Agents beyond their mandate | Models in a misconfigured third-party test environment accessed three real organizations' systems (Anthropic) |
Framework mappings
- T1588.007: Obtain Capabilities: Artificial Intelligence
- T1682: Query Public AI Services
- T1683: Generate Content
- T1684.001: Social Engineering: Impersonation
- T1566: Phishing
- T1195.002: Supply Chain Compromise: Compromise Software Supply Chain
- T1496: Resource Hijacking
- T1027: Obfuscated Files or Information
- CWE-1427: Improper Neutralization of Input Used for LLM Prompting
- CWE-1426: Improper Validation of Generative AI Output
How AI Attacks Work in the news
News stories tagged with How AI Attacks Work. This list updates on its own while the page is open.
- Info CERT-EU reports on AI-assisted cyber operationsmedium.com
- High AI Attacks Hit Over 100 CompaniesThe Hacker News
- High Attackers use AI to breach Linux serversMicrosoft
- High Canada export system breached by AI-driven attackBleepingComputer
- High UK DWP systems hacked with AI-enabled attacktheguardian.com
- Info ThreatBook stops CyberStrikeAI after hackers use it for attacksThe Hacker News
- Info AI Attacks and Fraud Target Identitiesforbes.com
- High Threat actors abuse ARTEX AI frameworkMicrosoft
Frequently asked questions
Can prompt injection be fixed?
Not completely with current models, because instructions and data share one channel. Training and classifiers reduce it, but EchoLeak began by bypassing a classifier. The reliable defenses limit what a successfully injected model can do: least agency, egress control, and human approval.
Is a jailbreak the same as prompt injection?
A jailbreak is one kind of prompt injection, aimed at the model's safety training. Prompt injection is broader: any input that changes the model's behavior against its owner's intent, including instructions hidden in documents the model reads on a user's behalf.
We only use well-known AI assistants. Does this apply to us?
Yes. EchoLeak targeted Microsoft 365 Copilot, the most widely deployed enterprise assistant. The risk grows with every data source and tool you connect, so review what each assistant can read, what it can send, and which plugins, connectors, and MCP servers users have added.
Can AI build and run attacks on its own?
Partly. In the GTG-1002 campaign, an agent did most of the hands-on work, but humans chose targets, approved key steps, and checked results the agent sometimes fabricated. The 2026 evaluation incidents showed capable models breaking into real systems without being asked to, through weak passwords, unauthenticated services, and a zero-day.
How do we detect AI-generated phishing?
Mostly the same way as other phishing. Text quality is no longer a useful signal, so rely on sender authentication (SPF, DKIM, DMARC), link and attachment analysis, and process controls. For payment and credential requests, verify through a separate, trusted channel regardless of how convincing the message, call, or video looks.
References and further reading
- OWASP GenAI Security Project: Top 10 for LLM Applications
- MITRE ATLAS: Adversarial Threat Landscape for Artificial-Intelligence Systems
- NIST AI 100-2 E2025: Adversarial Machine Learning, A Taxonomy and Terminology of Attacks and Mitigations
- Greshake et al.: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection
- Zou et al.: Universal and Transferable Adversarial Attacks on Aligned Language Models
- Reddy and Gujral: EchoLeak, the first real-world zero-click prompt injection exploit
- Simon Willison: The lethal trifecta for AI agents
- Debenedetti et al. (Google DeepMind): Defeating Prompt Injections by Design (CaMeL)
- Anthropic: A small number of samples can poison LLMs of any size
- Spracklen et al. (USENIX Security 2025): Package hallucinations by code-generating LLMs
- ReversingLabs: Malicious ML models on Hugging Face (nullifAI)
- Help Net Security: LiteLLM PyPI packages compromised by TeamPCP
- Google Threat Intelligence Group: Advances in threat actor usage of AI tools
- Anthropic: Disrupting the first reported AI-orchestrated cyber espionage campaign
- Anthropic: Project Glasswing, an initial update
- Anthropic: Improving our alignment and security efforts
- TechCrunch: OpenAI says Hugging Face was breached by its pre-release models
- Dezeen: Arup victim of deepfake video scam in Hong Kong
- MITRE ATT&CK Enterprise matrix
- MITRE CWE list
- NIST Computer Security Resource Center glossary
Found a technical error in this entry? Tell us and we will fix it.