Blog · Guide · 25 November 2026

Security Sweeps With Many Agents and One Person Approving

A security sweep is a job many agents can share. A scanner, an audit or a new advisory produces a list: forty findings across twelve services. Each finding needs someone to read the code, decide whether it is real, write a fix and run the tests. One agent per finding, or per service, can do the first pass of all of them at once.

It is also the job where an unsupervised fleet is most dangerous. A security fix touches authentication, secrets and sometimes production configuration. This article is a recipe for running a sweep with the agents a team already uses and one person approving what matters.

This is a design built from features Forkit has. Forkit has not run this exact workflow end to end. The steps below each use a documented feature, and the closest recorded runs are named where they apply.

In this article, "factory" means a Forkit factory, a saved fan-out that can be run again. The company Factory is named as Factory, the company.

What vendors have published

Three products this year run security work with many agents.

Cognition, "Introducing Devin Security Swarm" (1 Jul 2026). It "finds vulnerabilities across the codebase, validates that they are exploitable at runtime, and ships remediation PRs." Parallel agents each review a segment of the codebase. The security team receives confirmed findings with attack paths and steps to reproduce, and Devin opens a pull request "for review." Cognition's own benchmark of 50 real vulnerabilities gives Devin Security 72% recall at $90.23 a run. The post also says some teams see 10 to 100 times more security findings, many of them false positives.

Factory, the company, "Introducing Security Factory" (10 Nov 2026). It helps teams "turn security findings into tested fixes" in three stages: signals, triage and remediation. Organizations can configure autonomy levels, from agents presenting a remediation plan for a person to approve, to agents opening pull requests and deploying fixes within approved policies. It is in private preview, and the post gives no figures.

Cursor, "Securing our codebase with autonomous agents" (Travis McPeak, 16 Mar 2026). Cursor's security agents review "3,000+ internal PRs each week" and have caught "200+ vulnerabilities." One agent, Vuln Hunter, splits the codebase into logical segments and searches each; the security team triages and typically fixes what it finds. Another, Anybump, patches dependencies with reachability analysis and opens a pull request once tests pass.

All three split the codebase into segments, give each to an agent, and put a person at the point where a fix is accepted. The recipe below does the same with whichever agents your team runs, Claude Code, Codex or others, and adds the controls a fan-out needs.

The recipe

1. Choose the unit of work

Two choices work:

  • One agent per service or directory, for an open sweep: "review services/billing for injection and authorization flaws, fix what you can prove."
  • One agent per finding, when a scanner has already produced a list: "confirm or reject this finding; if real, fix it and add a test."

Per-finding runs are easier to judge, because each agent's result answers one question. They also produce more agents in the same file, which step 4 handles.

2. Save the sweep as a factory

forkit factory create --name sec-sweep --prompt-file sweep.md \
  --push --max-cost 40 --max-tool-calls 10000 --ttl 3600 --shadow

The prompt template is filled once per agent from the run's items, for example {{item.service}}, {{item.file}} and {{item.rule}} from a scanner's output. --push means the runner pushes your checkout as the starting repository, so a private repository works and Forkit holds no repository token. Each agent gets its own fork of it and a write token that lasts at most 15 minutes.

A run is asked for with the items:

forkit factory run sec-sweep --items-file findings.json

A CI job can do the same by POSTing the scanner's output to the factory's webhook address. That address can only ask for a run. It starts nothing and reads nothing.

3. Run it as a shadow run first

--shadow makes the runs rehearsals. The agents work in their forks as usual and allow rules still answer, but anything that would have reached a person is refused at once and kept. Afterwards:

forkit factory asks <fanout-id>

lists every such request, grouped, with how many agents asked and the rule that would allow it. For a security sweep, this list is the first deliverable. It tells you what the agents wanted to run before they were allowed anything: which test commands, which package installs, whether any of them reached for a credential or a deploy script.

The closest recorded run: on 21 Nov 2026, on staging, a shadow run from a factory with two items started two real Claude Code agents, each wrote its result and pushed, the one command that needed a person was refused for both and listed as one line, and the run finished in 47 s at about $0.21. That job was a research task, not a security sweep. See shadow runs for coding agents.

4. One owner per file

Two findings in the same file, given to two agents, produce two fixes that collide. Have each agent claim the paths it will change before editing. A file has one owner at a time: a claim that overlaps another agent's is refused and names the holder, and an edit under another agent's claim is denied before it happens. The second agent can wait, take another finding, or send its change to the owner as a patch on a message (forkit share), which the owner applies with forkit apply.

Before an agent finishes, Forkit's Stop hook compares its change with every peer's and holds an agent whose change would conflict, naming the file, the lines and the peer.

5. Write the rules, and know which requests always reach a person

From the shadow run's list, write command rules:

  • Allow what every agent needs and you are happy to grant: the test suite, the linter.
  • Deny what no agent in a sweep should run: deploy scripts, cloud CLIs, outbound network tools. A matching deny always wins.

Some requests never get an automatic answer. Forkit recognizes requests about production, secrets and money by words in the command or file path. Allow rules and the orchestrator never answer them, a person can only allow them once, and they are never grouped with other agents' requests, so each one is seen alone. In a sweep, that is the agent that wants to read .env.production or call a payments API to "verify" a fix. Since recognition is by words, keep the deny rules as well.

Everything else that is identical across agents (same fan-out, tool, subject and repository) is one question, answered once for all of them. If nobody answers in time, a fan-out agent's request is recorded as denied, since it has no terminal to fall back on. See production access for AI agents.

6. Set two budgets

The factory above stops its run at about $40 by Forkit's estimate, with a warning at 80%, and at 10,000 tool calls. Use both. An agent that reports no usage is invisible to the dollar budget, and a fan-out can pass its dollar budget by what its agents spend in about 20 seconds. A person can stop the whole run at once from the fan-outs page or the Mac app.

7. Collect, then review with approval rules

forkit fanout collect <fanout-id> ./sweep --merge

Each agent's fork arrives as agent/<name> and merges into fanout/<name>. An agent whose work conflicts is left as its own branch, and the command exits with code 3.

Then a person reviews, and the rules decide who. Owners map path globs to approvers: src/auth/** to the security lead, infra/** to the platform owner. The files a review covers come from GitHub when Forkit's GitHub App has the pull request, otherwise from every changed path recorded on the agent's thread, including the pushes Forkit verified itself. An agent cannot hide a file by leaving it out of its summary. Each matching pattern needs one of its approvers. If rules exist and the files are unknown, an owner must approve.

Approvals are also guarded against change. An approval carries the last event the reviewer saw, and a new commit or a failed check after that refuses it. See codeowners vs approval rules and how to review agent pull requests.

8. Judge each run

Mark each run good or bad with forkit factory verdict RUN_ID good|bad --note "…". A run where most findings were false positives is a bad run of the prompt, and the note says why. Over several runs, forkit factory show sec-sweep gives the share judged good, the cost per run and the seconds per run, which is how you tell whether the sweep is worth keeping. A recurring sweep can run on a schedule such as weekly mon 09:00 (UTC) on the Pro and Team plans.

What this recipe does not do

  • It has not been run. No security sweep has been recorded with Forkit. The features each have tests and some have recorded runs; the chain as a whole does not.
  • It does not find vulnerabilities. The agents do. Forkit coordinates them and records what they did.
  • Forkit never runs agents. The runner, the sandboxes and the agents are yours.
  • Recognition of sensitive requests is by words. A credential under an unusual name may not be recognized. Deny rules and approval rules on sensitive paths cover that gap.
  • It does not delete sandboxes. Stopping a fan-out stops its agents, not the machines they ran on.

Where Forkit fits

Forkit is the coordination system for agent teams: plans, handoffs, file claims and decisions, shared by every agent and the people behind them. For a security sweep it supplies the keys, the forks, one owner per file, the rule that production, secrets and money always reach a person, the budgets, and approval rules that decide who signs off. It is free to try at forkit-mcp.com.

Sources