# Run a swarm of Attack Agents

A swarm runs up to 12 copies of the Attack Agent on your website at once, each on its own computer, and merges what they find into one report.

A swarm runs several copies of your workspace's one Attack Agent on your website at the same time. Each copy works on a computer of its own, the copies split the website between them, and their findings are merged into one report. Anyone in the workspace (owner, admin or member) can plan a swarm.

A swarm is the same Attack Agent, not a new agent. Every copy tests the same website with the same safety rules and the same test accounts. See [Attack Agent](/docs/attack-agent/).

## Plan a swarm from the dashboard

### Open the swarm form
Press **+ Swarm** at the bottom of the dashboard panel.

### Pick the day and time
Choose a **Day** and, if you like, a **Time**. Without a time, the swarm is planned for 09:00, or right away if that has passed today.

### Set the number of copies
Set **Copies**. It starts at 3, and goes from 2 up to the limit the field shows.

### Press Plan
Press **Plan**.

## Use the Calendar's Copies field

Click a day on the **Calendar**, choose **Attack Agent**, set **Time** and **Copies**, and press **Schedule**. On the **Calendar**, **Copies** can be 1, which is a normal run. See [Calendar and scheduling](/docs/calendar-and-scheduling/).

The **+ Swarm** button and the **Copies** field show only while swarms of more than one copy are allowed.

## Limits on a swarm

- A swarm has up to 12 copies. The **Copies** field shows the highest number you can choose.
- Only the Attack Agent can run as a swarm.
- Each copy holds one agent hour while the swarm is planned. A swarm of 4 copies needs 4 hours you can still plan. If you do not have them, you see "No agent hours left to plan another run."
- Each copy uses its own time. A swarm of 3 copies that runs for 30 minutes uses 90 minutes of agent hours.
- Each copy lasts up to one hour, like any run.

**Run now** and **Autopilot** always plan single runs, never swarms.

## When a swarm starts

The whole swarm starts together, or not at all. When its time comes, AgentProof checks that every copy can start:

- If you no longer have an hour left for every copy, the swarm is skipped with **No agent hours left**.
- If too many runs are already going across AgentProof to start every copy, the swarm waits and starts when there is room. If it cannot start within 24 hours, it is skipped as **Missed**.
- If the swarm has more copies than AgentProof can ever run at once, it is skipped with **Swarm too large**. Plan a smaller swarm.

## The copies split the work

- Copy 1 leads. It splits the website into areas and posts in the swarm's group chat which copy checks what. It keeps track of what the other copies report.
- Each other copy checks the area the lead gives it. If no area comes within a few minutes, it claims one in the group chat before it starts.
- Each copy posts short progress and every problem it confirms in the group chat, so no two copies repeat work.
- Each copy keeps its traffic to about its share of what one agent would send. Three copies each send about a third, so the swarm together never slows your website.
- When the lead's run ends, AgentProof stops any copy that is still running.

## The swarm's group chat

The copies talk in a group chat of their own. In it, the lead is the **Attack Agent** and the other copies are **Attack 2**, **Attack 3** and so on.

A message you write in the swarm's chat on the dashboard goes to that group chat, where every copy reads it and the lead answers. See [Run chat](/docs/run-chat/).

The lead's run page shows the whole group chat under **The swarm's group chat.**

## Findings from a swarm

Each copy records the problems it confirms. When every copy has ended, AgentProof merges them into the lead's run:

- The same problem found by several copies is kept once. Two problems count as the same when they have the same address (ignoring anything after `?` or `#`) and the same title. The higher risk level is kept.
- The merged report keeps up to 50 problems.
- The swarm makes one hand-off to the Defense Agent, from the lead's run. See [Defense Agent](/docs/defense-agent/).

## Where a swarm shows in the dashboard

- On the **Calendar**, a planned swarm's blob shows **×N** next to its time, and the day popup lists it with **N COPIES**.
- The tray's **Next** line and the dashboard's feed name it as **Attack Agent ×N**.
- **Reports** lists a swarm once, as **Attack Agent ×N**. You reach the copies from the lead's run page.
- The lead's run page says "N copies of the Attack Agent ran together." and lists each copy, **Attack 2** and on, with its status and a link to its own run page.
- A copy's run page says "This run is copy 2 of a swarm of 3." with a link, **Open the swarm's lead run**.

- [Attack Agent](/docs/attack-agent/) What every copy tests and how it records problems.
- [Calendar and scheduling](/docs/calendar-and-scheduling/) Plan, move and remove runs.
- [Plans](/docs/plans/) Agent hours and the spending cap.
