AI security explained in plain terms is the work of protecting AI systems from attack, and protecting the people who use them from the harm those attacks cause. The central question is what makes AI systems vulnerable in ways that ordinary software is not, and the short answer is that AI adds new attack surfaces: its training data can be poisoned, its inputs can be crafted to mislead it, and its outputs can leak information it was meant to keep private.
AI systems are now part of critical infrastructure: they screen job applicants, approve loans, filter messages, and help write software. Attacking them has become worthwhile, and attackers have developed techniques that target the AI itself rather than the servers around it. This guide explains the main attacks on AI systems, how they work, and how to defend against them.
Key takeaways
- AI security protects AI systems from attack, and protects users from the harm those attacks cause.
- AI adds new attack surfaces beyond ordinary software: training data, model inputs and model outputs.
- Prompt injection, data poisoning and model extraction are among the most important AI-specific attacks.
- Defence combines traditional security with AI-specific controls such as input validation and output filtering.
- AI security is an ongoing process, because attackers adapt and new attacks appear constantly.
What AI security means
AI security covers two directions of harm. The first is attacks on AI systems: attempts to make a model behave badly, leak information, or stop working. The second is attacks using AI systems: using a capable model to commit fraud, create deceptive content, or find vulnerabilities in other software. Both matter, but this guide focuses on the first, because defending an AI system is the responsibility of the people who build and operate it.
AI security differs from traditional cybersecurity because the model itself is part of the attack surface. Ordinary software has clear boundaries: inputs are validated, outputs are checked, and the code does what it was written to do. An AI model has no such clarity. It accepts natural language, images and other unstructured input, and its behaviour is learned rather than specified, which means it can be influenced in ways its builders never anticipated. Our guide to AI safety explains the wider field that AI security sits within, including risks that are not caused by attackers at all.
Prompt injection and jailbreaking
Prompt injection is the most widely known AI attack. It works by hiding instructions inside data the model is asked to process: a web page, a document, or a message from another user. The model treats that data as a source of information, but the hidden instructions tell it to do something else, such as reveal private data, ignore its safety rules, or take an unauthorised action. Because models cannot reliably distinguish instructions from data, this attack is difficult to defend against completely.
Jailbreaking is closely related. It uses carefully crafted prompts to get a model to bypass its own safety rules, often by framing a harmful request as a game, a hypothetical, or a role-play scenario. Jailbreaks are a cat-and-mouse game: developers patch the techniques they know about, and attackers find new ones. The practical lesson is that a model’s safety rules should never be the only defence. If a harmful output would cause real damage, there should be additional controls around the model, such as output filtering and limits on what it can do.

Data poisoning and model extraction
Data poisoning attacks the training process. An attacker inserts malicious examples into the data a model learns from, so that the trained model behaves in a way the attacker wants. A poisoned model might misclassify a specific kind of input, or respond to a hidden trigger phrase with a particular output. Poisoning is hard to detect, because the poisoned data looks ordinary, and the model’s behaviour is normal except when the trigger appears.
Model extraction is a different kind of theft. An attacker queries a model repeatedly, collects its outputs, and uses them to train a copy of the model, or to learn things about its training data. Extraction can steal intellectual property, and it can also reveal sensitive information: a model that memorised personal data during training may leak it when asked the right questions. Defences include limiting how many queries a user can make, adding noise to outputs, and testing models for memorisation before they are deployed. Our guide to confidential computing explains a technology that protects models and data even while they are being used.
Adversarial examples and evasion
Adversarial examples are inputs that have been subtly altered to fool a model while looking normal to a person. A small change to an image, invisible to the eye, can make an image classifier label it as something else entirely. A few extra words in a document can make a spam filter let a malicious message through. These attacks exploit the fact that models learn patterns that are not the same as human understanding, and they can be surprisingly easy to construct.
Evasion attacks are a practical concern wherever AI makes security decisions: spam filtering, fraud detection, malware scanning and content moderation all rely on models that attackers try to fool. The defence is to test models against adversarial examples during development, to monitor them for unusual inputs in production, and to avoid relying on a single model for a critical decision. Defence in depth, using several layers of checks, is as important for AI security as it is for traditional security.
Comparing the main AI attacks
| Attack | Target | Typical harm | Main defence |
|---|---|---|---|
| Prompt injection | Model inputs | Unauthorised actions and leaks | Input validation and least privilege |
| Jailbreaking | Safety rules | Harmful outputs | Output filtering and layered controls |
| Data poisoning | Training data | Hidden backdoors | Data vetting and provenance |
| Model extraction | Model and its data | Theft and privacy leaks | Query limits and output noise |
| Adversarial examples | Model decisions | Evasion of detection | Adversarial testing and layered checks |
Defending AI systems
Defending an AI system starts with the same foundations as any other system: secure the infrastructure, control access, keep software updated, and encrypt sensitive data. AI systems run on servers, use APIs, and store data, and all of those need the ordinary protections of cybersecurity. A model with a brilliant defence against prompt injection is still vulnerable if its API key is leaked or its server is unpatched.
On top of those foundations sit AI-specific controls. Input validation checks what is sent to the model, and filters out content that looks like an injection attempt. Output filtering checks what the model produces, and blocks or flags harmful content before it reaches a user. Least privilege limits what the model can do: if it does not need access to a database, it should not have it, so that even a successful injection cannot cause much harm. Monitoring watches for unusual patterns, such as a sudden flood of queries or a spike in refused requests, which can signal an attack in progress. Our guide to cloud security covers the infrastructure protections that AI deployments depend on.
Zero trust and the human layer
Zero trust is a security approach that assumes no user, device or system should be trusted by default, even inside an organisation’s own network. Every request is verified, every access is limited to what is needed, and nothing is assumed to be safe because of where it comes from. Zero trust applies naturally to AI: a model’s output should not be trusted just because it came from the model, and a prompt should not be trusted just because it came from an internal system.
The human layer matters too. Many AI attacks succeed because a person trusted an output they should have checked, or pasted sensitive data into a prompt without thinking. Training people to treat AI output critically, to keep sensitive data out of prompts, and to report suspicious behaviour is as important as any technical control. Security is a property of the whole system, including the people who use it, and AI security is no exception. Our guide to zero trust for small teams explains how to apply this approach without a large security team.
AI security checklist
- Secure the infrastructure first, including access controls, patching and encryption.
- Validate inputs to the model, and filter out content that looks like an injection attempt.
- Filter model outputs before they reach users, especially for harmful or sensitive content.
- Give the model least privilege, so a successful attack cannot cause much harm.
- Vet training data and track its provenance, to reduce the risk of poisoning.
- Limit query rates and monitor for unusual patterns that may signal extraction or abuse.
- Test the model against adversarial examples and jailbreak attempts before release.
- Train users to check AI output critically and to keep sensitive data out of prompts.
- Review AI security regularly, because attackers adapt and new attacks appear constantly.
Frequently asked questions
What is AI security?
AI security is the work of protecting AI systems from attack, and protecting the people who use them from the harm those attacks cause. It covers attacks on the model itself, such as prompt injection and data poisoning, as well as the traditional security of the infrastructure the model runs on.
What is prompt injection?
Prompt injection is an attack that hides instructions inside data a model is asked to process, such as a web page or a document. The model treats the data as information, but the hidden instructions tell it to do something else, such as reveal private data or ignore its safety rules. It is difficult to defend against completely, because models cannot reliably distinguish instructions from data.
Can training data be attacked?
Yes, through data poisoning. An attacker inserts malicious examples into the data a model learns from, so that the trained model behaves in a way the attacker wants, such as responding to a hidden trigger phrase. Poisoned data looks ordinary, which makes the attack hard to detect.
Is AI security the same as cybersecurity?
AI security builds on cybersecurity but adds new concerns. Traditional cybersecurity protects servers, networks and data. AI security also protects the model itself: its training data, its inputs, its outputs, and the decisions it makes. A secure AI system needs both.
What is an adversarial example?
An adversarial example is an input that has been subtly altered to fool a model while looking normal to a person. A small change to an image can make a classifier label it incorrectly, and a few extra words can make a spam filter let a malicious message through. They exploit the fact that models learn patterns that differ from human understanding.
How do I keep sensitive data out of AI systems?
Do not paste sensitive information, such as passwords, personal details or confidential documents, into prompts unless you understand how the provider handles that data. Use enterprise or private deployments where sensitive work is involved, and check the provider’s data policies before sharing anything you would not want stored or used for training.
The bottom line
AI security explained in one line is this: AI systems can be attacked through their data, their inputs and their outputs, and defending them takes the ordinary discipline of cybersecurity plus AI-specific controls such as input validation, output filtering and least privilege, because a model that cannot be trusted to resist attack cannot be trusted to serve its users. Security is not a feature to add at the end, but a discipline that shapes how AI is built and operated from the start.







