AI agents · Defensive security

Find the Weakness First: Prevention at the Attacker's Pace

Watch on YouTube ↗

Defensive security divides into three jobs, and each one picks up where the one before it leaves off.

The first is prevention, where we try to keep intruders from getting onto our network at all. The second is detection, where we find the intruders who are already inside. And the third is response, where we deal with the intruders we have found.

The earlier articles in this series introduced ideas such as compressed reasoning and attack density, and argued that they change what defenders are up against. This article and the two that follow look at what that change means for each of the three jobs in turn, starting here with prevention.

For most organizations, prevention runs on a calendar. Their defenses are tested once or twice a year, and patches go out on a regular cycle.

Attack density puts that calendar under pressure, because attacks that once needed skilled people now run on compute, so an attacker with agents can make far more attempts than before and keep making them. Such an attacker does not work to a schedule, so any weakness that opens up in the months between one test and the next is there for it to find.

So what does it take for prevention to keep pace with an attacker that has agents?

My answer is that we have to find our weaknesses before the attacker does, and then keep finding them as fast as new ones appear, instead of waiting for the next scheduled test.

At that pace there is more work than skilled people can get through on their own, so we need agents of our own to take it on.

§01

The Closing Window

When a vulnerability is published, a race begins, because from that moment defenders have to apply the fix before attackers start using the flaw. A regular patch cycle assumes there is time to win that race, since it leaves each fix waiting until the next cycle comes around.

The trouble is that attackers now exploit a published flaw far sooner than they used to. The gap between a flaw being published and the first attacks against it keeps shrinking, while a regular patch cycle is as long as it always was.

In Verizon's 2026 Data Breach Investigations Report, exploiting a vulnerability overtook stolen credentials as the most common way attackers got in, the first time that has happened in the report's 19 years. Verizon also says AI is shrinking the window for defense from months to hours, and a window of hours leaves almost no room for a fix that is still waiting its turn.

Someone discovers a flaw, it is disclosed together with its patch, and the patch is applied at the next regular patch cycle.discovereddisclosedpatchedpatch cycleyears agorecentlytodayas agents spreadfirst attackfirst attackfirst attackfirst attack
A FLAW AND ITS PATCH Someone discovers a flaw, it is disclosed together with its patch, and the patch is applied at the next regular patch cycle.

Mandiant's measure of the average time to exploit points the same way. That average has now dropped below zero, which means that, on average, attackers start exploiting a flaw about a week before its patch is released.

An average can only fall below zero if many flaws are exploited before anyone discloses them. In those cases the attackers found the flaw first, which points to a change in who is finding them.

When the Attacker Finds the Flaw

Finding a new flaw and building a working exploit for it is highly specialized work, and outside a small number of well-resourced groups, most criminal groups could not do it. They waited for someone else to disclose a flaw, and then raced to get into systems before the patch went in.

Agents change that, because the search for new flaws and the work of building an exploit can now be handed to them. Groups that never had the skill or the people to find flaws of their own can now do it, so attackers find more of the flaws themselves.

Who finds a flaw matters, because a researcher or bug bounty hunter who finds one reports it so that it can be patched, while an attacker keeps it quiet and uses it. Nothing is disclosed, and no patch is on the way until someone notices the attacks.

Even for flaws that are disclosed, an attacker's agents can reach every affected system as soon as the flaw becomes known, so a patch applied on schedule may arrive after the attacker is already in.

And a flaw the attacker found first cannot be patched in time at all, however quickly we move once the patch appears. Prevention that waits for patches will therefore lose the race more and more often.

Other Ways In

Exploiting a flaw is one way onto a network, and agents speed up the other ways in as well. Two of them stand out.

The first is phishing and other forms of social engineering, which go after people instead of systems.

A convincing lure used to take time to research and write, so attackers either sent the same generic message to many people or spent that effort on a few important targets. Now an attacker's agents can research every employee and write a message that fits each one, so everyone in the organization gets the kind of attention that was once kept for a few.

The second is the supply chain, which is everything we depend on that someone else builds or runs. That includes the software we install, the open-source packages our own code pulls in from registries like npm, and the service providers connected to our network.

Each of them is trusted inside our systems, so an attacker who compromises one can come in through it. A poisoned package runs inside every system that installs it, and a breached provider can reach us over the connection we gave it.

With agents, an attacker can search that whole chain for its weakest point and reach us through it. That point might be a package maintainer with a poorly protected account, a widely used library that nobody looks after anymore, or a provider whose defenses are weaker than ours.

Servers, appliances, staff and suppliers can all be tried from outside. A patch on the usual schedule assumes there is time to apply it before a published flaw is used.OUTSIDEINSIDEweb serverVPNmailstaffsupplieranalystone published flawexploitedpatchedin timepublishedtime
EVERY EXPOSED SYSTEM IS A DOOR Servers, appliances, staff and suppliers can all be tried from outside. A patch on the usual schedule assumes there is time to apply it before a published flaw is used.

Finding Weaknesses First

Taken together, an attacker with agents has more ways in than before and finds them sooner, often before there is a patch to apply. Prevention that waits, whether for the next patch cycle or the next scheduled test, leaves each of those openings to the attacker for as long as the wait lasts.

So prevention cannot wait for a weakness to be announced. It has to find each weakness first, as quickly as the attacker would, and that is more work than skilled people can do alone, which is why it takes agents of our own.

Our agents can do that in three ways, and the rest of this article takes them in turn. The first is to test our systems the way an attacker would, far more often than once or twice a year.

The second is to aim that testing at whatever changes, including each newly published flaw, so that every change is checked as soon as it lands. The third is to read our own code, and the code it depends on, for flaws that nobody has reported yet, and to fix them before an attacker can use them.

§02

Offense Trains Defense

Testing our own systems the way an attacker would is one of the oldest practices in prevention. It shows us where we are actually weak before a real attacker finds out.

Security teams have long done this at three depths.

A vulnerability scan checks systems for known weaknesses and reports what might be open. A penetration test goes further and tries to exploit those weaknesses, within an agreed scope, to prove which of them are real. A red team pursues an objective from start to finish, which also shows whether the defenders notice anything along the way.

Exposed services on the edge, systems in zones behind them, an objective worth stealing, and a detection station watching for anyone who gets in.scopeobjectivedetection
ONE NETWORK, THREE WAYS TO TEST IT Exposed services on the edge, systems in zones behind them, an objective worth stealing, and a detection station watching for anyone who gets in.

Each step deeper needs more skilled people for longer, so each test costs more, and that cost has decided how often each kind of test runs. A scan is cheap enough to run every week. A penetration test costs enough that most organizations run one once or twice a year, and a red team exercise runs less often still.

So the deeper the test, the longer the gap between one and the next, and an attacker can arrive on any day in that gap and go after whatever the last test did not cover.

What Agents Take On

Agents change that pattern for the same reason they change attacks: compute can now do part of the work that used to take skilled people's time, so each test costs less.

How much of a test agents can take on depends on its depth. Scanning was automated long before agents arrived, so at the shallow end they take on the work around a scan instead, such as checking which of its findings are real. That work suits them, because each check is short and much the same from one system to the next.

Penetration tests and red team exercises are different. They run longer and lead the tester across many different systems and situations, and agents still fall short of skilled people at that kind of work, most of all in a red team exercise.

So at those depths, agents work under the tester's direction. They take on much of the legwork, such as working through the hosts, following up each lead and writing up what they find, while the tester decides where to go next and checks what comes back. That way one tester gets through far more testing than they could alone.

Agents Against Professionals

One study shows both what agents can do here and where they still need a person. It put AI agents up against ten cybersecurity professionals on a university network of about 8,000 hosts.

The best agent setup came second overall, with 82% of its submissions valid, and cost about $59 an hour, close to the $60 an hour the authors estimate for a professional penetration tester. A cheaper version of the same agent cost about $18 an hour and made as many findings, although fewer of them held up.

The agents in the study also produced more false positives than the professionals and struggled with graphical interfaces, so a skilled person still had to check their results before anyone acted on them.

Every Depth, More Often

An agent also brings to testing the quality that makes it so dangerous in an attack, which is that it can try every route into a network instead of following one careful path, so each test covers more of the network.

With agents multiplying what each tester can do, every depth of testing costs less per run, and since cost is what limited how often each kind of test could run, each of them can now run far more often.

A scan, a penetration test and a red team exercise, each going deeper into the network than the one before, set against one year.cost of one testtests in one yearscanpen testred team
THREE DEPTHS OF TESTING A scan, a penetration test and a red team exercise, each going deeper into the network than the one before, set against one year.
§03

Test What Changes

Testing far more often might sound like attacking every system all the time. Even with agents, that would cost too much, because every attack an agent runs still uses compute, and across a large network that adds up quickly.

It is not necessary either. Kevin Mandia describes an alternative approach with two parts.

The Map and the Heartbeat

The first part is a map of everything an attacker could see, both from outside the network and from inside it, down to every service, route, system and asset.

The second part is a cheap, frequent check against that map for anything that has changed, whether it is a new version of an application, a changed route, an updated service or a machine that was not there yesterday.

The check itself is light. It is a quick, repeated look at each part of the network, compared against what the map says should be there, and Mandia likens it to a heartbeat that keeps asking what has changed.

A Baseline Instead of a Fresh Start

Together, the two parts turn the map into a baseline of our attack surface, meaning everything an attacker could reach and try. Once that baseline exists, each round of testing only has to look at how the network differs from it.

A penetration test or a red team exercise has no such baseline to work from. Each one starts from scratch, so the testers rediscover the network every time and retest systems that the last test already covered and that have not changed since.

One network over time, and the test that comes back to it on a schedule: a penetration test or a red team exercise.timenewrepeated
A TEST ON A SCHEDULE One network over time, and the test that comes back to it on a schedule: a penetration test or a red team exercise.

With a baseline, that discovery is done once and then kept current, so only the change gets tested. That keeps the cost down, because the agents attack what is new instead of the whole network every time.

The same network over the same stretch of time, with the test ready at the start.timemap
THE SAME NETWORK, THE SAME TIME The same network over the same stretch of time, with the test ready at the start.

What Agents Make Possible

The check has to run often, because a large network changes all the time, and an exposure opened by one change stays open until something tests it.

Parts of this were possible before agents. Tools that map what an organization exposes to the internet and flag changes to it have existed for years, since spotting a change is routine work that ordinary automation handles well.

What was missing was the rest. Building the map from the inside, the way an attacker sees the network, took a penetration test, and the map went stale as soon as the test ended. Attacking each change to find out whether it can actually be exploited took a skilled tester too, and no team had enough testers to send one after every change as it landed.

Agents take on both. They can build and refresh the map the way Mandia describes, and since each change is a far smaller target than the whole network, testing it is work they can keep doing around the clock.

I would call the result continuous, targeted offensive security, because it never stops watching the network and spends its effort only where something has changed. You will also come across related ideas under other names, such as continuous threat exposure management (CTEM) and continuous automated red teaming.

A Truer Picture of the Network

Over a year, the difference between testing on a calendar and testing each change adds up.

Take a network with a penetration test in April and another in October. Each test catches whatever is open on its day, but an exposure that opens between them can stay open for months. If each change is tested as it lands, the same exposure can be found and closed within days.

Each row is one system you run, over one year. As the year plays, each change lands as a dot: a new version, a new route, a new machine.pen testpen testJFMAMJJASONDno testingtwo tests a yeareach change tested
A YEAR OF CHANGE Each row is one system you run, over one year. As the year plays, each change lands as a dot: a new version, a new route, a new machine.

Some exposures never appear during a test at all. A firewall rule opened for a migration, or a test server left online for a few weeks, can come and go between April and October, so neither test ever sees it, even though an attacker could have used it for as long as it was there.

That happens because a scheduled test is a sample. It shows the network as it was while the test ran, and two tests a year give us two short windows on a network that changes every week, so whatever happens to be open during those windows is all we learn about.

Testing each change takes a much larger sample, because it looks at the network every time the network changes. The picture it gives covers our exposure across the whole year, so it shows the weaknesses an attacker could actually have found, and not only the ones that happened to be open while a test was running.

When a New Flaw Is Published

A newly published vulnerability is also a change, only in the threat rather than in the network, and we can handle it the same way.

When one appears, the map shows at once which of our systems it might affect, and testing those systems shows whether we are actually exploitable. We need to know that before the attacker does, because its agents can reach those same systems as soon as the flaw is known.

That proof matters because not every bug gives an attacker stable access to a system. A scan of the affected systems returns a long list of findings, but the list alone cannot tell us which of them an attacker could actually use.

Trying to exploit each finding shows the few that give real access, and those few go to the front of the queue, so proving what is exploitable is also how we decide what to fix first.

A scan finds every known issue it can see: a long list, with no way to tell which ones an attacker could actually use.scanfindingstarget123reads dataruns commandsreaches more
A SCANNER'S LONG LIST A scan finds every known issue it can see: a long list, with no way to tell which ones an attacker could actually use.
§04

Inoculation

Testing shows us which known weaknesses are open in the systems we run. With our own software, and the open-source code it depends on, we can go a step further, because we have the code itself and can read it for flaws that nobody has reported yet.

Agents that hunt for vulnerabilities can work through that code and find flaws while nobody outside knows they are there.

If a flaw is fixed in time, no attacker ever gets to use it, which makes this a kind of inoculation against zero-days, the flaws that attackers exploit before any patch exists.

Inoculation depends on having the code to read, and commercial software that we buy and run ourselves usually does not give us that. It arrives compiled, and its license often forbids taking it apart, so for those products the search for unreported flaws falls to the vendor.

That makes it worth asking each vendor whether it searches its own code this way, and how quickly it fixes what it finds. When we have the choice, it is also a reason to favor products whose source code we can see, so that we can run the search ourselves.

Inoculation in Practice

Defenders are already doing this. About six weeks after launching Project Glasswing, Anthropic and its roughly 50 partners reported that they had found more than ten thousand high- or critical-severity vulnerabilities in critical software.

Google's Big Sleep agent found a flaw in SQLite that, according to Google, only attackers knew about, and it got there before they could use it.

Fixing Has to Keep Up

When agents find flaws at that rate, the bottleneck shifts to what comes after. Anthropic now says the limit is how quickly vulnerabilities can be verified, disclosed and patched, rather than how quickly they can be found.

Its disclosure dashboard shows the gap. As of October 2, 2026, it lists 6,157 vulnerabilities reported across 591 open-source projects, of which 516 have been patched upstream, and it names human triage as the step that limits the rate.

This matters for prevention, because if finding speeds up and fixing does not, the backlog of known but unfixed flaws keeps growing, and an attacker's agents could find any flaw in it as well.

So fixing has to keep up with finding, and at that speed it needs agents as well, for the same reason finding does.

Google's Chrome team now uses agents at every step, from finding bugs to fixing them, and its results show what fixing at that speed can look like. In Chrome 149 and 150, the team fixed 1,072 security bugs, which is more than in the previous 23 milestones combined.

An agent harness found many of the bugs, and triage was increasingly automated. Agents wrote the fixes, critic agents checked their work, and developers reviewed what the agents proposed.

Agents find flaws in the software you build and depend on far faster than people used to. Every finding still has to be verified and fixed.findingwaiting to be fixedfixeddraftscritiquesanalystfixes each onefalling behind
FINDING AT AN AGENT'S TEMPO Agents find flaws in the software you build and depend on far faster than people used to. Every finding still has to be verified and fixed.
§05

Conclusion

So, back to the question we started with: what does it take for prevention to keep pace with an attacker that has agents?

The short answer is agents of our own. An attacker's agents make more attempts, find more flaws and move faster than people alone can keep up with, so the only way to meet that pace is to put the same capability to work on our side.

That does not mean using as many agents as we can, wherever we can. They cost money to run and they still make mistakes, so their value comes from choosing carefully where they fit and how they work under the people who direct them.

Broadly, agents change prevention in two ways.

The first is that they make the work we already do cheaper and quicker, so we can do it far more often. Penetration tests and red team exercises were expensive because they took skilled people's time, and once agents multiply what each tester can do, they can run many times a year instead of once or twice. Searching our own code for unreported flaws was rarer still, since few organizations could afford a team for it, and agents bring that within reach too.

The second is that they make new approaches practical. Continuous, targeted offensive security was a good idea before agents arrived, but it needed skilled attention on every change as it happened, and no team had enough people for that. With agents, testing can run alongside the network all the time and follow each change as it lands, instead of arriving on a date in the calendar.

Both come from the same shift. Prevention was held back for as long as it depended on skilled people's hours, and agents now give defenders the same reach they have already given the attacker.

Even with agents of our own, prevention will not keep every attacker out, and some will still get in. Once inside, an attacker with agents brings problems of its own, because it raises more alerts than people can investigate, sets up several footholds instead of one and spreads far faster than a person could. Dealing with that will take our own agents too, working in new ways, and that is the subject of the next article, on detection.

Go furtherAvailable now

Build Your Own Agentic Defense

Audience
Designed for defenders who want to master agents.
Format
Start your journey now with a self-paced, online, on-demand course.
Outcome
By following one intrusion from raw telemetry to an evidence-cited report, you’ll learn the foundational primitives of agents, and how to use, adapt and build them for your own security workflows.
  • 131 lessons, 30+ hours: Written and video
  • 28 hands-on labs: Configure, run and extend each system
  • 7 Build It Yourself guides: Build a piece yourself, complete code included
  • Lifetime access: One-time purchase, all future course updates included
  • 14-day money-back guarantee: A full refund within 14 days, no reason required

Price: $499 USD

References13
  • Vulnerability exploitation top breach entry point, 2026 industry-wide DBIR finds. Verizon, May 19, 2026. Announcement ↗
  • M-Trends 2026: Data, Insights, and Strategies From the Frontlines. Mandiant, Google Cloud, March 23, 2026. Key findings ↗
  • The Biggest Shift in Cybersecurity in 30 Years. Kevin Mandia in conversation with David George, a16z, October 6, 2026. a16z is an investor in Mandia's company, Armadin. Mapping and testing change from 11:40, and new vulnerabilities from 12:59. Interview ↗
  • Technical Guide to Information Security Testing and Assessment (SP 800-115). NIST, September 2008. Guide ↗
  • Red team. NIST Computer Security Resource Center glossary, from CNSSI 4009-2022. Definition ↗
  • A Guide to Penetration Testing. CREST, December 2022. Guide ↗
  • Gartner Identifies the Top 10 Strategic Technology Trends for 2024. Gartner, October 16, 2023. Defines continuous threat exposure management (CTEM), which Gartner introduced in a 2022 research note for its clients. Press release ↗
  • How continuous automated red teaming (CART) can help improve your cybersecurity posture. Evan Anderson, Randori, IBM, August 16, 2023. IBM sells a CART product, Randori. Blog post ↗
  • Comparing AI Agents to Cybersecurity Professionals in Real-World Penetration Testing. December 10, 2025, revised March 3, 2026. Preprint. Paper ↗
  • Project Glasswing: An initial update. Anthropic, May 22, 2026. Update ↗
  • A summer of security: empowering cyber defenders with AI. Kent Walker, Google, July 15, 2025. Includes Big Sleep's SQLite finding. Blog post ↗
  • Anthropic's coordinated vulnerability disclosure dashboard. Anthropic, updated October 2, 2026. Dashboard ↗
  • Stronger with every update: How we're making Chrome and the web safer in the AI Era. Chrome Security Team, Google, July 30, 2026. Blog post ↗