AI
AI in Cybersecurity: How It Helps Attackers and Defenders
AI in cybersecurity: how defenders use it for detection, triage and bug finding, how attackers use it for phishing and deepfakes, real examples and limits.
AI in cybersecurity cuts both ways. Defenders use machine learning and language models to spot unusual behaviour, sort through floods of alerts, analyse malware and find software vulnerabilities before attackers do. Attackers use the same tools to write convincing phishing emails in any language, clone voices and faces for fraud, and speed up reconnaissance and exploit development. The result isn't a revolution so much as an acceleration: both sides do what they did before, faster and at greater scale.
The UK's National Cyber Security Centre put it plainly in a January 2024 assessment: AI will almost certainly increase the volume and heighten the impact of cyber attacks over the next two years, though unevenly, and it can also strengthen defence. This guide explains how AI is used in cybersecurity on both sides, with real examples, a worked example of AI-assisted alert triage, the new risks that AI systems themselves create, and practical steps to use AI to prevent attacks.
AI in Cybersecurity at a Glance
| Side | Use | Example | Maturity |
|---|---|---|---|
| Defence | Anomaly and threat detection | Flagging unusual logins, data transfers or process behaviour | Mature |
| Defence | Malware and phishing classification | Scoring files, URLs and emails | Mature |
| Defence | Alert triage and investigation | Summarising alerts, gathering context, suggesting next steps | Growing fast |
| Defence | Vulnerability discovery | AI agents finding bugs in code | Emerging |
| Defence | Secure coding assistance | Reviewing code and suggesting fixes | Growing |
| Attack | Phishing and social engineering | Fluent, personalised lures at scale | Widespread |
| Attack | Deepfake fraud | Fake voices and video of executives | Real cases |
| Attack | Reconnaissance and exploit development | Faster research and tooling | Growing |
| Target | Attacks on AI systems | Prompt injection, data poisoning, model theft | New and growing |
What Is AI in Cyber Security?
What is AI in cyber security, concretely? It's the use of machine learning, statistical models and, increasingly, large language models in security tools and processes. Three families matter most:
- Machine learning on telemetry: models trained on network traffic, logs, endpoint activity and email to tell normal from suspicious. Security products have used this for years, for example to catch malware variants that signature-based antivirus misses.
- Language models for analysts: assistants that explain alerts in plain language, query logs from a natural-language question, summarise incidents and draft reports.
- Agents for security tasks: systems that take multi-step actions, such as reading code to hunt for vulnerabilities or gathering evidence across tools during an investigation.
How AI Is Used in Cybersecurity for Defence
How AI is used in cybersecurity by defenders breaks down into a few jobs.
Detection
Security teams collect enormous amounts of data from endpoints, networks, cloud services and identity systems. Machine learning models learn baselines, such as which countries a user logs in from, how much data a server normally sends and which processes usually run, then flag deviations. This catches attacks that don't match any known signature, such as a legitimate admin tool being misused.
Triage and investigation
Security operations centres (SOCs) drown in alerts, most of them benign. AI helps by grouping related alerts into one incident, enriching them with context (who the user is, what the asset does, whether the IP is known-bad), ranking them by risk and summarising them for analysts. Language-model assistants let analysts ask questions in plain English instead of writing complex queries.
Email and phishing defence
Classifiers analyse message content, sender behaviour, links and attachments. As attackers use AI to write better phishing, defenders increasingly rely on behaviour, such as an unusual payment request from a new sender, rather than spelling mistakes.
Finding vulnerabilities
AI is starting to find real bugs. In November 2024, Google's Project Zero and DeepMind reported that their Big Sleep agent, built on a Gemini model, had found an exploitable memory-safety bug in SQLite, a widely used database engine. The bug was in code not yet released, was fixed by the developers the same day and had not been found by the project's existing fuzzing. Google described the work as highly experimental, but it points to AI helping defenders find flaws before attackers do.
Secure development
Code assistants can spot insecure patterns and suggest fixes during review. They can also introduce vulnerabilities when generating code, which is why our guide to AI-generated code security recommends treating their output like any untrusted contribution.
AI Cyber Attacks Examples
AI cyber attacks examples show how attackers have adopted the technology:
| Technique | How AI helps attackers | Real-world signal |
|---|---|---|
| Phishing | Fluent, tailored emails in any language; fewer tell-tale mistakes | Security agencies warn that AI lowers the barrier for less skilled criminals |
| Voice and video deepfakes | Impersonating executives or relatives in calls | In early 2024, an Arup employee in Hong Kong made 15 transfers totalling HK$200 million (about US$25.6 million) after a video call with deepfaked colleagues |
| Reconnaissance | Summarising public information about targets quickly | NCSC expects AI to enhance reconnaissance and social engineering |
| Malware development | Help writing or modifying code | Mainstream AI services restrict this, but less controlled models exist |
| Password and CAPTCHA attacks | Automated guessing and solving | Raises the importance of phishing-resistant authentication |
| Attacks on AI systems | Prompt injection, data poisoning, model extraction | A new attack surface as companies deploy AI apps and agents |
The Arup case is a useful lesson: the technical controls weren't breached; a person was persuaded. Our guide on how to spot a deepfake covers practical checks, and the most effective defence is process: verifying payment requests through a separate, known channel.
When AI Systems Are the Target
Companies deploying chatbots, copilots and AI agents create new things to attack:
- Prompt injection: malicious instructions hidden in web pages, emails or documents that an AI system reads, causing it to leak data or take unintended actions. See our guide to prompt injection.
- Data poisoning: corrupting training or retrieval data so the model behaves badly.
- Model and data theft: extracting proprietary models or the sensitive data they were trained on.
- Excessive agency: agents with broad permissions that can be manipulated into harmful actions.
Frameworks such as the OWASP Top 10 for LLM Applications and MITRE ATLAS catalogue these risks and the defences against them.
Worked Example: AI-Assisted Alert Triage
A mid-sized company's SOC receives 10,000 alerts a day. About 1% (100) relate to real malicious activity. Analysts can properly investigate around 1,500 alerts a day, so most alerts get only a glance.
An AI triage system scores each alert and auto-closes those it judges very likely benign, with full records kept for review. Two settings, illustrative figures:
| Setting | Alerts auto-closed | Alerts left for analysts | Real incidents wrongly auto-closed | Incidents reaching analysts |
|---|---|---|---|---|
| No AI triage | 0 | 10,000 | 0 | 100, buried in noise |
| Conservative | 6,000 | 4,000 | 1 | 99 |
| Aggressive | 8,500 | 1,500 | 5 | 95 |
The conservative setting cuts the queue by 60% while missing one real incident a day; the aggressive setting fits analyst capacity but misses five. Neither is free. In practice, teams start conservatively, sample auto-closed alerts to measure misses, and tighten gradually. The real gain is often that analysts finally have time to investigate the alerts that matter properly, rather than skimming everything.
Using AI to Prevent Cyber Attacks: Practical Steps
Using AI to prevent cyber attacks works best on top of strong basics:
- Get the fundamentals right first: patching, phishing-resistant multi-factor authentication, least-privilege access, backups and logging. AI doesn't fix missing basics.
- Use AI where volume overwhelms people: alert triage, email filtering, log search and vulnerability prioritisation.
- Keep humans on decisions with impact: isolating systems, disabling accounts and notifying customers.
- Measure performance: track detection rates, false positives and time to respond before and after.
- Verify unusual requests out of band: especially payments and credential resets, to blunt deepfake and phishing attacks.
- Secure your own AI deployments: limit agent permissions, treat model inputs as untrusted and log what AI systems do.
- Train staff on AI-enabled scams, with realistic examples of voice and video impersonation.
Limits and Risks of AI in Cybersecurity
- False positives and false negatives: no model is perfect; thresholds trade one for the other.
- Adversarial evasion: attackers probe and adapt to detection models.
- Hallucinated analysis: language-model assistants can state wrong conclusions confidently; analysts must verify.
- Data exposure: sending logs or code to external AI services may leak sensitive information.
- Over-reliance: teams that trust the tool blindly lose the skills to spot what it misses.
For Small Businesses
Small companies rarely run a security operations centre, but they benefit from AI in cybersecurity through the products they already use. Email services filter phishing with machine learning, endpoint protection detects suspicious behaviour, and identity providers flag risky sign-ins. The most effective steps for a small team are to turn those protections on, use multi-factor authentication everywhere, keep devices updated, and agree a simple rule that any request to change bank details or send money is confirmed by phone on a known number. Managed detection services can add round-the-clock monitoring without hiring a full team.
Careers: AI vs Cybersecurity?
People often ask whether to study AI or cybersecurity. The fields are converging: security teams need people who understand AI systems and their risks, and AI teams need security expertise. Skills in both, such as securing AI applications, using AI tools in investigations and understanding model risks, are increasingly valuable.
FAQ
Will AI replace cybersecurity jobs?
It's automating routine triage and analysis, but demand for security professionals remains high, especially for people who can investigate, make judgement calls and secure AI systems themselves.
How do hackers use AI?
Mainly to write convincing phishing, impersonate people with deepfake audio and video, research targets faster and get help with code. Security agencies expect AI to increase the volume and impact of attacks.
Can AI stop cyber attacks on its own?
No. AI helps detect and prioritise threats faster, but it works alongside strong basic controls and human analysts, not instead of them.
Is AI-generated phishing harder to detect?
Often, because it removes spelling and grammar mistakes and can be personalised. Defences increasingly focus on sender behaviour, unusual requests and verification processes.
What are the risks of using AI security tools?
False alarms, missed attacks, adversarial evasion, confident but wrong explanations, and exposing sensitive data to third-party AI services.