Skip to content

Building with agents, lesson 7.3

Using an agent to sort and fix security findings

Security scans return a pile, and the pile is where most teams stop. This lesson hands the slow part to an agent: grouping, checking each finding against the code and proposing small fixes, while a person makes every call.

What do you run?

Every example below changes to fit what you pick. The businesses are made up for teaching.

The picture, one step at a time

Each box is one stage. The picture lights up as you scroll.

Step 1 of 6

The pile

Turn on the scans from lesson 7.1 and the first run can return hundreds of findings. Most teams stall here. An agent is good at the slow part, reading each finding against the code. For the shop's order site, give it the full export from each scanner, plus the code, not a screenshot of a dashboard.

Step 2 of 6

Group the pile

The same hole reported by three tools is one item. One old package in twelve places is one item. Ask the agent to group the findings by cause and list where each one appears. The pile usually shrinks a lot before anyone reads a line of code.

Step 3 of 6

Is it real here?

Now the agent reads the code. Is the affected part ever called? Can text from outside, like a form or a request, reach it? It marks each item reachable, not reachable or false alarm, and shows the file and lines that prove it. If it cannot show the path, the item stays open.

The agent says a finding is a false alarm. What should it hand you?

Step 4 of 6

Rank by what could happen

A known hole has a public ID, called a CVE, and a severity score that says how bad it would be. That score does not say how likely it is to be used. So rank by three things together: how bad, whether attackers are using it now, and whether outside input can reach it in your code.

Two free public signals help (as of November 2026). FIRST's EPSS estimates "the probability that a published CVE will be exploited in the wild in the next 30 days". CISA's Known Exploited Vulnerabilities catalogue lists holes already used in attacks.

Step 5 of 6

One small fix in a branch

The agent fixes one item at a time, on its own branch: the smallest change that closes the hole, and a test that fails before the fix and passes after. Usually that is a version bump or a few lines, never a rewrite. The scans from lesson 7.1 run on its pull request like anyone else's.

Step 6 of 6

A person decides

The agent proposes. A person merges the fix, or accepts the risk with a written reason and a date to look again. Keep the closed items and their reasons in one file, and give it to the agent next time, so it stops raising the same false alarms.

Who should be allowed to mark a finding as an accepted risk?

Fix now, queue it, or close it?

Here are four findings in your business. Fix this week: reachable and serious, or already used in attacks. Normal queue: real, but hard to reach. Close: a false alarm or code that never runs, with the reason written down.

  1. 1A hole in your image library is on the public list of holes being used in attacks, and your upload page calls the affected code.

  2. 2A serious hole in a package used only by the script that builds your site. It never runs on the live site.

  3. 3The code scan flags a "password in the code". It is the word "password" as grey hint text on the sign-in form.

  4. 4Your order search pastes customer text into a database query, on a page anyone can open.

0 of 4 right so far, 4 to go.

A triage prompt and workflow

This is what you keep: what to give the agent, what to ask it for, and who makes each call.

A triage prompt and workflow

  1. Give the agent the full export of findings, the code, and your file of items closed before with their reasons.
  2. Ask it to group by cause, then mark each group reachable, not reachable or false alarm, with the file and lines as proof.
  3. Rank by how bad it is, whether attackers are using it now, and whether outside input can reach it.
  4. One finding, one branch: the smallest fix and a test that fails before and passes after.
  5. A person merges the fix, or accepts the risk with a written reason and a date to look again.

The agent sorts, proves and proposes. A person closes.

Next: Lesson 8.1: Agents that work in the cloud while you do something else. What a cloud agent runs on, what fences it in, and which tasks to send there.