OpenSSF Finding and Fixing Vulnerabilities Using AI

3.8 Run AI multiple times

Most modern AI systems are not deterministic. Even if you provide them the same inputs, they won’t necessarily produce the same outputs. That means you need to apply AI multiple times to find and fix vulnerabilities, especially on its first application to a project.

Yan reports that “the first run on a codebase typically has the highest number of findings. Subsequent runs tend to have fewer—though often more complex—vulnerabilities, as the simpler ones were patched in prior runs. However, don’t expect the nth run to have zero new findings. Models are stochastic, and a large codebase can have a long tail of vulnerabilities that continue to trickle in even when the code is unchanged.” [Yan2026]

As a result, once you’ve gone through the process of finding and fixing vulnerabilities for a project for the first time, you’ll need to repeat it several times until it reliably fails to produce useful results across multiple approaches and systems.

One question is whether you should provide past findings as context, so it is more likely to consider different areas. For now, we suggest that you provide past results for some runs so that, on those runs, it doesn’t need to rediscover them. There is a risk that incorrect past results may lead the AI astray, so we expect it’s better to provide that data in only some cases. We hope future research will make this clearer.

A robot in a glowing circuit forest sits next to jars labeled “Run 1”, “Run 2”, and “Run 3” with caught glowing bugs, illustrating how repeatedly running AI can catch additional obvious vulnerabilities.

Quiz

Q1. Why does the material recommend repeating the vulnerability-finding process multiple times on an unchanged codebase?

  1. A single run will always find every vulnerability that’s present
  2. A single run of an AI system may miss something a later run finds
  3. Repetition is needed only when you’re using closed-source models
  4. Running the process twice guarantees zero false positives
Show answer Answer: B