Leveraging AI in Cyber Defense
How defenders use AI tools to review security settings, find flaws in code, and write detection rules, and why a person must check every suggestion.
1Why defenders use AI
Attackers use AI, and so do defenders. A security team may be responsible for thousands of firewall rules, millions of lines of code, and a constant flood of activity records. AI tools can read through all of it quickly and point out what looks risky. That lets a small team cover far more ground.
Three jobs where AI helps defenders:
- Reviewing security configurations, such as firewall rules and access controls, and recommending safer settings.
- Analyzing application code to find vulnerabilities and recommend fixes.
- Suggesting rules for automated detection systems, the tools that watch for attacks.
In all three, the AI tool makes recommendations. A knowledgeable person reviews each one before it is put in place.
2Reviewing security settings
A security configuration is the set of settings that decides what is allowed. Two common kinds:
- Firewall rules: a list that decides which network traffic is allowed in or out. Rules are usually checked from top to bottom, and the first rule that matches decides.
- Access controls: settings that decide who can open, change, or delete which files, folders, and systems.
Over time these settings pile up. Someone adds a quick fix and forgets it; an employee changes jobs but keeps old access. An AI tool can read the whole list and flag problems: rules that allow far too much, rules that can never take effect, accounts with access they no longer need.
Here is a small firewall rule list an AI tool might review:
Rule 1: ALLOW from any to web server port 443 (HTTPS) Rule 2: ALLOW from any to web server port 80 (HTTP) Rule 3: ALLOW from any to any port any Rule 4: ALLOW from office network to file server port 445 (file sharing) Rule 5: DENY from any to any port any
An AI review would likely flag Rule 3: it allows any traffic from anywhere to anywhere. Because rules are checked in order, everything that reaches Rule 3 is allowed, so the “deny everything else” Rule 5 never gets a chance. It might also flag Rule 2, which allows unencrypted web traffic.
The AI cannot know why Rule 3 was added. Maybe someone added it while fixing a problem and forgot it, or maybe a system really depends on it. A security technician who knows the network checks before anything changes.
3Finding flaws in code
Applications are built from code, and code has mistakes. Some mistakes are vulnerabilities that attackers can use. AI-powered tools can scan large amounts of code, point to risky lines, explain the problem, and suggest a fix.
# Risky: the user's typed name goes straight into the database command query = "SELECT * FROM students WHERE name = '" + typed_name + "'" # Safer: the database treats the typed name only as data, never as a command query = "SELECT * FROM students WHERE name = ?" run(query, [typed_name])
In the risky version, whatever a user types becomes part of the command the database runs, so a cleverly written “name” could change what the command does. The suggested fix keeps the user's input separate from the command. A programmer still reviews it: the fix has to match how the rest of the program works, and AI tools sometimes suggest fixes that break something else or miss a related flaw nearby.
4Suggesting detection rules
A detection rule tells an automated system what to watch for and when to raise an alert. For example: alert when one account has more than 10 failed logins within one minute. AI tools can study past attacks and normal activity and suggest new rules, or point out attacks that current rules would miss.
A detection engineer, the person who builds and tunes these rules, reviews each suggestion. A rule that is too sensitive buries the team in false alarms (alerts about harmless activity). A rule that is too loose lets real attacks through. Only someone who knows what normal looks like on that network can judge the balance.
| Where AI helps | Who reviews before it is used | What they check |
|---|---|---|
| Firewall rules and access controls | A knowledgeable security technician | Is the change correct? Will it block something the organization needs? |
| Application code | A knowledgeable programmer | Is the flaw real? Does the fix work without breaking other features? |
| Detection rules | A knowledgeable detection engineer | Will it catch the attack? How many false alarms will it cause? |
5Why a human always checks
AI tools make mistakes, and they make them confidently. They may misread what a setting is for, invent a fix that does not work, or miss the business reason a rule exists. They do not know the organization: which server must stay reachable for the payroll system, which old program cannot handle a change, which odd-looking activity is a normal monthly job.
A wrong security change can cause real harm: blocking the hospital's records system, locking every teacher out of the gradebook, or opening a door that was meant to stay shut. So the rule is: AI recommends, a knowledgeable person reviews, and only then is the change made.
AI makes defenders faster, not unnecessary. It finds the needles in the haystack; a person who understands the system decides what to do with each one.
6Worked examples
The rule that allows everything
An AI tool reviews the firewall rule list shown above and recommends deleting Rule 3. What should the security technician do?
- 1Confirm the AI's reasoning: Rule 3 allows any traffic, and because rules are checked top to bottom, Rule 5 (deny everything else) can never apply to traffic that Rule 3 matches. The AI is right that this is risky.
- 2Find out why Rule 3 exists. Check change records or ask the team. Maybe it was added during an outage and never removed.
- 3Check what depends on it: are there services that only work because of Rule 3? If so, write narrow rules for those first.
- 4Make the change, test it, and watch for anything that breaks.
The access the AI wanted to remove
An AI tool reviews access controls at a school and recommends removing a counselor's access to the student-records folder, because the counselor has not opened it in 11 months. What should happen?
- 1The AI is applying a sound idea: people should have only the access they need.
- 2But the AI does not know the school calendar. Counselors use those records heavily during college-application season, which may not have started yet.
- 3A technician checks with the counselor's supervisor before removing anything.
Tuning a suggested rule
An AI tool suggests a detection rule: alert when any account has more than 10 failed logins in one minute. The detection engineer knows that the school's shared library computers often see bursts of typos as many students log in at the start of class. What should the engineer consider?
- 1The rule targets a real sign of password guessing: many failures in a short time.
- 2On shared library computers, many students failing logins at once could trigger it every morning: false alarms.
- 3Possible adjustments: count failures per account rather than per computer, add a check for unusual source addresses, or handle the library computers separately.
The fix that broke search
An AI tool finds a flaw in a website's search feature and suggests a fix. A programmer applies it without review. The flaw is gone, but searches with apostrophes (like “O'Brien”) now fail. What went wrong?
- 1The AI's fix addressed the security flaw but did not account for how the search feature had to work.
- 2No knowledgeable programmer tested it against normal use before it went live.
- 3A review would have caught the broken case and adjusted the fix.
7Common mistakes
Every recommendation needs review by someone who knows the system: a security technician for settings, a programmer for code, a detection engineer for detection rules.
AI sees settings and code, not the reasons behind them. It cannot know that a rule supports payroll or that records are only used in one season.
AI speeds up reviewing and spotting. People still decide, test, and take responsibility for changes.
AI tools explain wrong answers as smoothly as right ones. Check the reasoning, not just the tone.
“An AI tool can review the firewall rules and flag Rule 3, which allows all traffic and prevents the final deny rule from ever applying. Before anything changes, a knowledgeable security technician should confirm the finding, check whether any service depends on the rule, and test the change, because the tool does not know how the network is used.”
Say what the AI tool does, what it recommends, and who must review the recommendation before it is used.