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.

By OmniAI Editorial · Nov 23, 2026 · 9 min read

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

SideUseExampleMaturity
DefenceAnomaly and threat detectionFlagging unusual logins, data transfers or process behaviourMature
DefenceMalware and phishing classificationScoring files, URLs and emailsMature
DefenceAlert triage and investigationSummarising alerts, gathering context, suggesting next stepsGrowing fast
DefenceVulnerability discoveryAI agents finding bugs in codeEmerging
DefenceSecure coding assistanceReviewing code and suggesting fixesGrowing
AttackPhishing and social engineeringFluent, personalised lures at scaleWidespread
AttackDeepfake fraudFake voices and video of executivesReal cases
AttackReconnaissance and exploit developmentFaster research and toolingGrowing
TargetAttacks on AI systemsPrompt injection, data poisoning, model theftNew 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

Many log lines with an arrow into a chip, which outputs three cards, one orange, to a person
AI sits between raw telemetry and analysts, filtering noise and adding context before a person decides.

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:

TechniqueHow AI helps attackersReal-world signal
PhishingFluent, tailored emails in any language; fewer tell-tale mistakesSecurity agencies warn that AI lowers the barrier for less skilled criminals
Voice and video deepfakesImpersonating executives or relatives in callsIn 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
ReconnaissanceSummarising public information about targets quicklyNCSC expects AI to enhance reconnaissance and social engineering
Malware developmentHelp writing or modifying codeMainstream AI services restrict this, but less controlled models exist
Password and CAPTCHA attacksAutomated guessing and solvingRaises the importance of phishing-resistant authentication
Attacks on AI systemsPrompt injection, data poisoning, model extractionA 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

Three bars shrinking from left to right with a small orange square above the shortest bar
Auto-closing low-risk alerts frees analysts, but every threshold trades workload against missed incidents.

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:

SettingAlerts auto-closedAlerts left for analystsReal incidents wrongly auto-closedIncidents reaching analysts
No AI triage010,0000100, buried in noise
Conservative6,0004,000199
Aggressive8,5001,500595

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:

  1. Get the fundamentals right first: patching, phishing-resistant multi-factor authentication, least-privilege access, backups and logging. AI doesn't fix missing basics.
  2. Use AI where volume overwhelms people: alert triage, email filtering, log search and vulnerability prioritisation.
  3. Keep humans on decisions with impact: isolating systems, disabling accounts and notifying customers.
  4. Measure performance: track detection rates, false positives and time to respond before and after.
  5. Verify unusual requests out of band: especially payments and credential resets, to blunt deepfake and phishing attacks.
  6. Secure your own AI deployments: limit agent permissions, treat model inputs as untrusted and log what AI systems do.
  7. 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.

All articles

Read next

Language

EnglishEnglish · en TürkçeTurkish · tr DeutschGerman · de العربيةArabic · ar

Account

Enter your email. We’ll send you a sign-in link and a 6-digit code. No password needed.

Sign in

Theme

Language

Show our email address

To keep spam out of our inbox, please confirm your own email first. We will send you a 6-digit code.

We send codes only to these providers: gmail.com, googlemail.com, outlook.com, hotmail.com, live.com, msn.com, proton.me, protonmail.com, pm.me, icloud.com, me.com, mac.com, yahoo.com, aol.com, gmx.de, gmx.net, web.de, t-online.de, yandex.com, omniai.blog