# What the Attack Agent does

The Attack Agent tests your live website the way an attacker would, records each problem it can prove and hands it to the Defense Agent.

The Attack Agent is one of the two agents in every workspace. It tests the website saved in **Settings > Website** the way an attacker would, on a computer of its own, and records each problem it can prove. Anyone in the workspace (owner, admin or member) can start or plan its runs.

## Start an Attack run

There are several ways to start one. All of them test the website saved in **Settings > Website**.

- Press **Run now** in the dashboard sidebar or in the **Agents** tray on the **Calendar**. The run starts within seconds.
- Press **+ Attack** in the dashboard panel, then pick a **Day** and a **Time** and press **Plan**.
- Drag the Attack Agent from the tray onto a day on the **Calendar**.
- Let **Autopilot** plan your runs for the month. See [Calendar and scheduling](/docs/calendar-and-scheduling/).
- Press **+ Swarm** to run several copies at once. See [Swarm mode](/docs/swarm-mode/).

Before any of these work, three things must be true:

1. Your website is saved in **Settings > Website**.
2. Its domain is verified, and you confirmed that you own the website or have written permission to test it. See [Website and domain](/docs/website-and-domain/).
3. Your workspace has an active plan with agent hours left. See [Plans](/docs/plans/).

To have the Attack Agent read a repository or an app file instead of your website, use **+ Code** or **+ App**. See [Code and app audits](/docs/code-and-app-audits/).

## What the Attack Agent tests

Only your website's own address is in scope: its `https://` (or `http://`) part and its host, such as `https://shop.example.com`. Links, scripts and API addresses on other hosts are out of scope.

The agent works in this order:

1. It opens your website in a browser and saves a picture of the first screen as `homepage.png`.
2. It maps the site: its pages, forms, sign-in, the JavaScript it sends and the API calls the pages make.
3. It tests the ways in.

These are the ways in it checks:

- secret keys and passwords left in the code your website sends to browsers
- files that should not be public
- security headers and cookie settings
- CORS, the setting that says which other websites may read your site's answers
- API calls that return private data without signing in, or that return another user's data
- input that reaches your server without being checked
- software versions with known security flaws (CVEs)

Before it finishes, it works through each page and form it found, each API call (signed out and as each test account), one account's records asked for as another account, and every item in the list above. Its final report ends with a **Coverage** section that marks each item as tested, not tested or not applicable, with one line on why.

While it works, the run page shows every command, its output and the agent's thinking in a live terminal. The agent also posts short notes in the run's chat. See [Run chat](/docs/run-chat/).

## The safety rules it follows on your live site

Your website is live, so every Attack run is told to keep it safe:

- never place real orders or payments, and never contact your customers
- never change or delete real customer data
- never send enough traffic to slow your site: no fast fuzzing, no password guessing and no port scans
- sign in only with the test accounts and keys you gave it, and never print their passwords, keys or tokens
- stop testing a path once one request proves the point

## Test accounts and keys

The Attack Agent can sign in to your website with test accounts and use API keys you create for it. Owners and admins add them in **Settings > Agents**. Once saved, a value is never shown again.

Only Attack runs on your website receive them, and only while the website's domain is verified. They are placed on the agent's computer for that run, and their values are hidden in every record the run leaves. Code and app audits and the free website test never receive them. See [Test access](/docs/test-access/).

## Problems the Attack Agent records

The agent records each problem in a file named `findings.json`. Each problem has a title, a risk level, the address where it happens, what is wrong in plain English, the evidence (what it sent and the part of the answer that shows the problem, with secrets hidden), the steps to show it again and how to fix it.

A run records at most 50 problems.

### Risk levels

| Risk | What it means |
|---|---|
| High | Other people's data or accounts are at risk, or money is, or someone could take over an account. |
| Medium | A real weakness that needs one more step to cause harm. |
| Low | A setting that would make the site harder to attack. |
| Info | A note, not a problem. |

If the agent writes "critical", AgentProof records it as High. A risk level it does not know is recorded as Info.

### Confirmed and unconfirmed problems

A problem is **confirmed** only when a request the agent made showed it. Anything the agent suspects but could not prove is recorded as unconfirmed.

Only confirmed problems count. The run page's heading counts them ("Attack Agent found 3 problems on shop.example.com. The worst is high risk."), the dashboard's **Done** list shows **Found 3**, and only confirmed problems with a risk other than Info go to the Defense Agent.

The run page lists the problems under **The agent found these problems.** with each one's risk, title, address and summary. The agent's final report, and the `report.md` file it saves, give the evidence and the fix for each one. See [Runs and reports](/docs/runs-and-reports/).

## Kinds of Attack run

Each run carries a label in **Reports**, in the **Calendar**'s day lists and in the dashboard's **Done** list.

### Labels for each kind of run

| Kind of run | How it starts | Label |
|---|---|---|
| Planned run | The **Calendar**, **+ Attack**, **Run now** or **Autopilot** | SCHEDULED |
| Swarm | **+ Swarm**, or **Copies** on the **Calendar** | SCHEDULED, listed as **Attack Agent ×N** in **Reports** |
| Started through the API | The [API](/docs/api-runs/) or an assistant connected to the [MCP server](/docs/install-mcp-server/) | MANUAL |
| Retest | A pull request with a fix was merged | RETEST |
| Deploy test | A production deploy of your connected repository | DEPLOY |
| Code audit | **+ Code** | CODE |
| App audit | **+ App** | APP |

Retests are explained in [Defense Agent](/docs/defense-agent/). Deploy tests are explained in [GitHub Action](/docs/github-action/).

## How long a run lasts

Each run lasts up to one hour. It uses the time it actually runs from your plan's agent hours, rounded up to the minute. While a run is waiting to start or running, it holds a full hour of your hours. When it ends, only the minutes it used count.

A run that reaches its one-hour limit ends as **Failed**, with the reason **Time limit**.

**Warning:**
AgentProof records the problems of a run that finished or that someone stopped. A run that ends because it reached its one-hour limit is marked **Failed**, and its problems are not recorded and do not go to the Defense Agent. Its saved files and its log stay on the run page.

### The token budget

Each run may also use up to 120 million model tokens. Tokens are the pieces of text the AI model reads and writes. A busy hour uses well under that.

When a run has used 90% of its tokens, AgentProof tells the agent to stop starting new checks, record its confirmed problems and finish with a summary. The terminal shows `[90% of the model token budget used: wrapping up]`. If the run still uses every token, it ends as **Completed**, its problems are recorded, and the terminal shows `! The run used its whole model token budget.`

The tokens a run used, out of its budget, are listed as **MODEL TOKENS** under **More about this run** on the run page.

## The Attack Agent's computer

Every run gets a new computer of its own. AgentProof deletes it when the run ends. As a backstop, each computer turns itself off 80 minutes after it starts.

The computer has the tools the agent needs, including:

- a Chromium web browser
- REA, a set of tools for taking apart and studying websites and apps
- SearchSploit with a local copy of the Exploit Database, to look up public exploit records
- PoC Index, to look up known security flaws (CVEs) and how they are used

Besides its instructions, the computer receives only what this run needs: the test accounts for your website, the agents' notes about your website (see [Agent memory](/docs/agent-memory/)) and any files you attach in the run's chat.

## Look-only tests and full tests

The free test on AgentProof's home page also uses the Attack Agent, but in a much smaller way. Nobody has proven they own the website, so it only looks.

### How the two kinds of test differ

| | Free website test | Full Attack run |
|---|---|---|
| Who can start it | Anyone, from the home page | Your workspace |
| Website | A public website, except the most visited sites on the web | Only the website in **Settings**, on a verified domain |
| Length | 20 minutes | Up to one hour |
| What it does | Reads what any visitor can see: pages, the JavaScript the site sends, headers, cookies, the certificate, a short list of well-known files | Everything on this page, including signing in with your test accounts and sending test input |
| What it never does | Sign in, send forms or test input, guess passwords, scan or fuzz | The safety rules above |
| Agent hours | Does not use your hours | Uses your hours |
| Defense Agent | No hand-off | Hands confirmed problems to the Defense Agent |

See [Free website test](/docs/free-website-test/).

## Hand-off to the Defense Agent

When an Attack run on your website ends as **Completed**, AgentProof checks its confirmed problems. If at least one has a risk other than Info, and your website's code is connected in **Settings > Code**, a Defense Agent run starts on its own to fix them. That run is labelled REPAIR.

Retests, code audits, app audits and the free website test never start a Defense run. Deploy tests do.

Without connected code, the problems stay open on the run page. Connect a GitHub repository or upload a copy of your code to have them fixed next time. See [Connect your code](/docs/connect-your-code/) and [Defense Agent](/docs/defense-agent/).

## Messages when a run cannot start

These are the messages you may see when you plan or start an Attack run, and what to do.

- **Add your website in Settings.** Save your website in **Settings > Website**.
- **Verify this domain in Settings first.** Verify the domain, and confirm that you may test the website, in **Settings > Website**.
- **Choose a plan to plan runs.** An owner or admin chooses a plan in **Settings > Billing**.
- **No agent hours left to plan another run.** Your hours, and the extra hours your spending cap allows, are used or already held by planned runs. Remove a planned run, wait for your hours to reset, or ask an owner or admin to raise the spending cap in **Settings > Billing**.

A planned run that cannot start is marked **Skipped** on the **Calendar** with the reason. See [Calendar and scheduling](/docs/calendar-and-scheduling/) for every reason.

- [Defense Agent](/docs/defense-agent/) How fixes are written, delivered and retested.
- [Calendar and scheduling](/docs/calendar-and-scheduling/) Plan runs, start one now and let Autopilot plan the month.
- [Swarm mode](/docs/swarm-mode/) Run several copies of the Attack Agent at once.
- [Test access](/docs/test-access/) Give the Attack Agent test accounts and keys.
