Last Wednesday, several global government websites temporarily went offline following an alarm set off by the National Security Agency and its counterparts in the European Union and the United Kingdom. All three organizations announced major vulnerabilities in PHP, the computer scripting language used by about 70 percent of websites globally. Ryan Austin, a researcher at the cybersecurity company Calif, had used artificial intelligence tools to discover a way for hackers to run code on a server that uses PHP without its operator knowing.
Fortunately, PHP’s developers were able quickly to release a patch. Nevertheless, the incident has added to growing fears about AI’s capacity to enable cyberattacks. Those fears have merit: a recent Google analysis found that monthly vulnerability disclosures doubled between January and August of 2026. This increase almost certainly reflects AI-enabled attacks that were previously impossible.
Finally, a reason to check your email.
Sign up for our free newsletter today.
This kind of heightened threat environment may be the new normal. That’s particularly alarming, given that, as one recent economics paper argues, the firms most at risk of cyberattack systematically underinvest in defense. At the same time, new AI tools may be a way to help these firms catch up, letting them defend themselves from new cyber threats on the cheap.
A new paper, “The Economic Costs of Cyber Risk,” by Aniket Baksy and Daniele Caratelli, models the economic choices of threat actors (attackers) and companies (defenders). Working with a macroeconomic model of cyberattacks, Baksy and Caratelli show which companies are the most vulnerable and which levers can be used to defeat the attackers.
Using LinkedIn data, the authors found that the share of a company’s employees devoted to cybersecurity increases steeply as a company’s size grows, likely because larger firms have more resources to invest and because they have more valuable assets to protect than smaller companies. Theoretically, smaller firms could close the cybersecurity gap through outsourcing, but the authors did not observe this, probably because some fixed amount of cybersecurity cost must be borne internally and cannot be outsourced.
How does this relate to actual cyber risk? The authors found an inverse U-shaped relationship between company size and risk of cyberattacks: midsize firms tended to face the greatest cybersecurity risk, while risk was lower at the high and low ends. This is because small firms are not worth the attackers’ effort, while large firms are too difficult to attack. Medium-size firms are in the sweet spot—their assets are valuable enough to attract attackers’ attention, but they lack the same defensive capabilities as larger firms. Indeed, midsize firms dealt with 36 percent of attacks in 2022, despite accounting for only about 1 percent of total firms.
The costs of cyberattacks are large enough to be seen at the macroeconomic level. The authors estimate that cybersecurity risk reduces firm entry by 3.6 percent, aggregate productivity by 0.6 percent, and output by 1.8 percent. Most of the damage does not come from attacks themselves or ransom payments to hackers but from the resulting disruptions to suppliers and customers. The authors cite a previous estimate of the effects of the 2017 “NotPetya” cyberattack, attributed to Russian government hackers, which found that supply-chain effects—namely, the damages encountered by the buyers and sellers of the company hacked—quadrupled the initial damage.
Since midsize firms don’t bear the full cost of these effects, they tend to underinvest in cybersecurity, in much the same way that firms spend too little on research because they do not capture the full benefit of that spending. The result is that cyberattacks do more damage to the economy than if the firms bore the full costs directly.
The authors propose three options for remedying this structural problem. The first is government bailouts for firms that have experienced costly cyberattacks. This is the worst approach, because compensating firms after an attack reduces their incentive to invest in security.
The second option is for government to subsidize cyber defense. This could work, though government would likely struggle to identify which firms most need the subsidy. Subsidies would also redistribute resources from smaller firms to larger ones, since most of the risk would concentrate at the top.
The third option is a minimum-security requirement: mandating that all firms devote some proportion—the paper proposes 0.2 percent—of their workforce to cybersecurity. Assuming the requirements are economically sustainable, this would be the best approach. It would proportionally raise the capability of firms of all sizes, without redistributing resources from small to big ones.
Of course, if the proportion is set too high, it would dampen productivity and push firms out of the market. But AI can help mitigate that concern by reducing the relative cost of a cybersecurity requirement. Indeed, AI may already be effectively offering a minimum level of security to all firms.
That’s because, as another recent study from the Georgia Institute of Technology’s Lennart Maschmeyer suggests, AI may be a bigger boon to cyber-defenders than cyber-attackers. AI systems, Maschmeyer argues, are better at pattern recognition than they are at tasks involving creativity and deception. The former is more useful in cyber defense because pattern recognition helps find flaws—and once they are patched, they cannot be hacked again, such as in the recent PHP case. An attacker is usually someone who uses creativity and deception; indeed, 80 percent–95 percent of cyberattacks are phishing, in which someone pretends to be another person, such as a colleague, a superior, or a supplier, to capture information. Almost all attacks are quite distant from the cinematic image of a hacker typing green code on a black screen.
As the recent PHP scare shows, AI is adept at scouring source code and finding security holes. But this has a defensive purpose as well as an offensive one: AI can help find the holes that can be patched. If companies have access to nonpublic frontier models, they will get a head start on this process over cyber attackers—a concept that OpenAI refers to as the defender’s window.
Arguably, then, the cyber-defense subsidy for midsize firms is already here. AI can help those firms find vulnerabilities without needing an in-house cybersecurity team. It will also reduce the cost of cybersecurity consulting companies, increasing access for midsize firms.
In truth, most firms are already getting the message that AI will increase attacks. The only way to defend against them is to fix the code where needed. That’s easier than ever with the help of AI.