AI in cybersecurity: how defenders and attackers use it in 2026

AI in cybersecurity: how defenders and attackers use it in 2026

AI in cybersecurity means using machine learning and language models to detect, investigate and fix threats, and it also means attackers using the same models to write phishing, clone voices and automate intrusions. This guide explains both sides with recent cases and data, then covers the risks of AI tools themselves and the steps that protect you and your team.

In shortTL;DR
  • Defenders use AI to triage alerts, summarize incidents, write detection queries and find and fix vulnerabilities in code; a human still approves every consequential action.
  • Attackers use AI for convincing phishing, cloned voices and, in at least one documented 2025 campaign, to run most of an intrusion with little human input.
  • IBM's 2026 breach report found organizations with extensive security AI and automation saved $1.93 million per breach on average.
  • AI tools are an attack surface too: prompt injection, leaked data and over-permissioned agents are the main risks, and most organizations with AI breaches lacked access controls.
  • Verify unusual requests through a second channel, keep AI agents sandboxed with least privilege, and use only AI tools your organization has approved.

How is AI used in cybersecurity?

AI in cybersecurity works in both directions: defenders use it to spot threats, investigate incidents and fix vulnerable code faster, and attackers use it to write better phishing, impersonate people and automate intrusions. A third front is new: the AI tools companies adopt are themselves targets.

IBM's 2026 Cost of a Data Breach Report, published in July 2026, puts numbers on all three.

$4.99Mglobal average cost of a data breach
56%rise in AI-driven attacks year over year
$1.93Maverage savings per breach with extensive security AI and automation
92%of organizations with AI-related breaches lacked proper AI access controls
Source: IBM, 2026 Cost of a Data Breach Report

The table sums up who uses AI for what.

AreaDefenders use AI toAttackers use AI to
Email and messagingFlag phishing and business email compromiseWrite fluent, personalized phishing at scale
IdentitySpot unusual logins and behaviorClone voices and faces to impersonate people
CodeFind vulnerabilities and draft fixesFind exploitable bugs faster
OperationsTriage alerts, summarize incidents, write queriesAutomate reconnaissance and intrusion steps
AI systemsMonitor and restrict AI tools and agentsInject instructions, steal data through AI tools

How do security teams use AI in a SOC?

In a security operations center (SOC), AI mostly handles the reading: it triages alerts, summarizes incidents into plain language, translates questions into query languages and explains suspicious scripts. Analysts keep the decisions about containment and response.

Microsoft's Security Copilot documentation lists typical uses: turning complex alerts into "actionable summaries", building KQL queries from natural language, analyzing suspicious scripts, managing security posture and writing reports for stakeholders. Other security platforms ship similar assistants. The pattern is the same everywhere.

A sensible AI-assisted triage workflow looks like this:

  1. Enrich. The assistant pulls related alerts, user and device history, and threat intelligence for the indicator.
  2. Summarize. It writes a short timeline of what happened, in plain language, with links to the raw events.
  3. Propose. It suggests a severity and next steps, such as isolating a device or resetting a password.
  4. Decide. An analyst checks the summary against the raw evidence and approves or rejects each action.
  5. Record. The assistant drafts the incident note; the analyst corrects it before it is filed.

Step 4 is where AI errors get caught. A summary can omit the one event that matters, and a model can state a wrong conclusion with confidence, a failure covered in our guide to AI hallucinations. Treat AI output in the SOC like a junior analyst's notes: useful, fast, and checked.

Analysts also use general assistants for one-off tasks: explaining an obfuscated PowerShell command, drafting a detection rule, or turning a vendor advisory into a checklist. Use a workspace your organization has approved for that data, and redact internal hostnames and customer data first.

How does AI find vulnerabilities in code?

AI now finds real vulnerabilities and drafts fixes: research agents discover bugs before attackers exploit them, code scanning tools suggest patches for alerts, and coding agents review changes for security issues before merge.

Three examples show the range:

  • Research agents. Google's Big Sleep agent, built by Google DeepMind and Project Zero, discovered an SQLite vulnerability (CVE-2025-6965) that Google says was known only to threat actors. Google wrote in July 2025: "We believe this is the first time an AI agent has been used to directly foil efforts to exploit a vulnerability in the wild."
  • Fixes for scanner alerts. GitHub's Copilot Autofix suggests code changes for CodeQL code scanning alerts in languages including JavaScript/TypeScript, Python, Java, Go, C#, C/C++, Ruby, Rust and Swift. It does not require a Copilot subscription.
  • Review in the coding agent. Claude Code has a /security-review command that runs a security pass over the changes on your current branch.

GitHub's own responsible use page lists the limits that apply to every AI fix: suggestions are non-deterministic, may be "syntactically valid but change the semantics of the program", may only partly fix a vulnerability, and may suggest unsafe or fabricated dependencies. Review AI security fixes like any other pull request, with tests.

You can also ask a general assistant for a focused review. Narrow prompts work better than "is this secure?":

prompt
Review this Express route handler for security issues. Check specifically:- injection (SQL, NoSQL, command, path traversal)- missing authentication or authorization checks- user input reaching file paths, shell commands or redirects- secrets or tokens in code or logsFor each finding: the line, why it is exploitable, a concrete fix,and your confidence (high, medium, low). Say "no finding" if a category is clean.

For a broader workflow, see our guide to AI code review.

How do attackers use AI?

Attackers use AI to write convincing phishing in any language, clone voices for phone scams, research targets, and in at least one documented case, to carry out most of an intrusion campaign automatically.

Laptop on a desk showing a phishing email asking the reader to re-activate a credit card, with a hand on the trackpad
Phishing like this used to give itself away with clumsy wording; AI-written versions often don't

What's documented so far:

  • Voice and text impersonation. The FBI warned in May 2025 that since April 2025 attackers had impersonated senior US officials with texts and AI-generated voice messages, building rapport before sending links that steal credentials.
  • AI-orchestrated intrusion. Anthropic reported that in mid-September 2025 it detected a campaign, which it attributes with high confidence to a Chinese state-sponsored group, that used Claude Code against roughly thirty targets and succeeded in a small number of cases. The attackers used AI "to perform 80-90% of the campaign", with humans needed only at a few decision points. They got past safeguards by splitting the attack into small, innocent-looking tasks and claiming to work for a security firm.
  • Limits. The same report notes that Claude "occasionally hallucinated credentials" and claimed to have stolen information that was public, which Anthropic says remains an obstacle to fully autonomous attacks.

The practical effect for everyone else: the cost of a targeted, well-written attack has dropped, so signals like bad grammar or an unfamiliar accent no longer separate fake from real. Our guide to AI scams covers the consumer side in detail, including cloned voices.

How do you protect yourself from AI-powered phishing and impersonation?

Verify through a second channel you choose yourself, and slow down on any request that involves credentials, codes, money or a move to another app. Those rules hold no matter how convincing the message is.

The FBI's recommendations from its 2025 warning, plus the controls that make them stick at work:

  • Call back on a number you look up, never the one in the message.
  • Check details closely: slightly altered names, addresses and URLs.
  • Don't click links in unexpected texts or emails until the sender is confirmed.
  • Never share a two-factor code with anyone, by any channel.
  • Agree on a code word with family, and a verification step for payment changes at work.
  • Use phishing-resistant sign-in such as passkeys or hardware security keys, so a stolen password alone isn't enough.
  • Report it. Tell your security team or, in the US, file at ic3.gov.
Tip

For finance teams, make "any change to bank details is confirmed by phone to a number already on file" a written rule. It stops both AI-written emails and cloned-voice calls.

What are the security risks of AI tools themselves?

AI tools add new ways to leak data and new ways to be manipulated: prompt injection, sensitive data disclosure, risky plugins and models, and agents with more permissions than they need. The OWASP Top 10 for LLM Applications 2025 is the standard checklist.

OWASP 2025 riskWhat it means in practice
LLM01 Prompt InjectionText in a page, file or email gives the model new instructions
LLM02 Sensitive Information DisclosureThe model reveals data from its context, tools or training
LLM03 Supply ChainA compromised model, plugin or MCP server
LLM05 Improper Output HandlingModel output runs as code, SQL or HTML without checks
LLM06 Excessive AgencyAn agent can take actions far beyond its task
LLM07 System Prompt LeakageHidden instructions, sometimes with secrets, get exposed

The remaining four cover data and model poisoning, vector and embedding weaknesses, misinformation and unbounded consumption.

The most common real-world problem is simpler: employees pasting confidential data into tools nobody approved, often called shadow AI. IBM found that among organizations with AI-related breaches, 92% lacked proper AI access controls. Our guide to AI privacy at work covers what to paste where.

Coding agents raise the stakes because they can run commands. An agent that reads a malicious README or issue comment can be steered into running something harmful, which is why prompt injection in coding agents deserves its own threat model.

How do you secure AI coding agents and assistants?

Give AI tools the least access that still gets the work done, run agents in an isolated environment, and keep a human approval step for anything irreversible. Filtering prompts alone does not stop injection; limiting what the agent can reach does.

A baseline for teams using coding agents:

  1. Approve tools centrally. Pick AI tools and plans whose terms exclude training on your data, and block the rest.
  2. Isolate. Run agents in a container, VM or dedicated server with no production credentials. See our guide to sandboxing AI coding agents.
  3. Deny secrets and risky commands. Most agents support deny rules. In Claude Code, add them to .claude/settings.json:
.claude/settings.json
{  "permissions": {    "deny": ["Read(./.env)", "Read(./secrets/**)", "Bash(curl *)", "Bash(wget *)"]  }}
  1. Limit network access. Claude Code's docs note that command-pattern rules are fragile and point to sandbox network isolation for enforcement that doesn't depend on how a command is written.
  2. Review MCP servers and plugins before installing them; they run with real access.
  3. Require review before merge. Branch protection and pull request review apply to agent-written code too.
  4. Log activity so you can reconstruct what an agent did.
Warning

Never give an AI agent production database credentials or cloud admin keys "to save time". Read-only, scoped tokens for the task at hand are the ceiling.

How to start using AI safely in security this week

Pick one defensive use and one control, and put both in place before adding more.

  • Turn on phishing-resistant sign-in (passkeys or security keys) for email and admin accounts.
  • Write the "verify by callback" rule for payment and credential requests, and tell your team.
  • List the AI tools people actually use, and approve or block each one.
  • Enable code scanning with AI fixes, or run /security-review on your next feature branch, and review what it finds.
  • Add deny rules for secrets to every coding agent's settings.
  • Read the OWASP Top 10 for LLM Applications before you ship any AI feature.

If you run coding agents unattended, keep them off your laptop and away from production. Orkio runs agents such as Claude Code on an always-on cloud box, isolated from other customers and separate from your own machine.

Frequently asked questions

Will AI replace cybersecurity jobs?

AI takes over repetitive work such as first-pass alert triage, log searching and report drafting, which changes what analysts spend their day on. It does not remove the need for people who understand the environment, make containment decisions and answer for them. Attackers using AI also raises the amount of work defenders face.

Can AI detect phishing emails?

Yes, email security products have used machine learning to flag phishing for years, and language models help catch messages with no obvious red flags. They are not perfect, and AI-written phishing removes the spelling mistakes people used to rely on. Treat any request for credentials, payment changes or codes as suspicious until you confirm it through a separate channel.

Is it safe to paste logs or code into ChatGPT or Claude for security analysis?

Only in a workspace your organization has approved, under business terms that exclude training on your data. Logs and code often contain hostnames, internal IPs, customer data and secrets, so redact them first. Never paste credentials, private keys or tokens into any chat tool.

What is prompt injection?

Prompt injection is an attack where text the AI reads, such as a web page, email, document or code comment, contains instructions that override what the user asked for. OWASP lists it as the top risk for applications built on large language models. The defense is to limit what the AI can do and access, not only to filter its input.

What is the best AI tool for cybersecurity?

It depends on the job. Security teams on Microsoft's stack use Security Copilot inside Defender and Sentinel, developers get AI fixes for code scanning alerts through GitHub's CodeQL, and coding agents such as Claude Code include a security review command. Start with the AI built into tools you already run rather than a new standalone product.

SOURCES

  1. IBM: 2026 Cost of a Data Breach Report
  2. Anthropic: Disrupting the first reported AI-orchestrated cyber espionage campaign
  3. Google: Latest AI security announcements (Big Sleep)
  4. OWASP Top 10 for LLM Applications 2025
  5. FBI IC3: Senior US officials impersonated in malicious messaging campaign
  6. GitHub Docs: Responsible use of Copilot Autofix for code scanning
  7. Microsoft Learn: What is Microsoft Security Copilot?
  8. Claude Code docs: Security
  • #cybersecurity
  • #ai security
  • #phishing
  • #prompt injection
Orkio team

The team building Orkio. We write about putting AI to work: coding agents that run overnight, always-on boxes and pull requests ready by morning.

Keep reading

All posts

07:06 · YOU MERGED #128

Go to sleep. Wake up to pull requests.

Start for $19 a month
© 2026 Orkio · Hosted in Europe TürkçeStatus