# Test your website after every deploy

Connect GitHub and AgentProof tests your website each time you ship to production, then puts the result on the commit as a check.

AgentProof can test your website every time you ship. Each production deploy starts an Attack Agent run on the website in **Settings**. The result shows on the deployed commit in GitHub as a check named **AgentProof**.

Each run uses agent hours like any other run. A run only starts when the website's domain is verified and you have confirmed you may test it.

## Connect GitHub

1. Open **Settings**, then **Repositories**, and press **Connect GitHub**.
2. Install the AgentProof GitHub App on the repository for your website.
3. Pick the repository and press **Add repository**.

## Choose what starts a test

In **Settings**, under **Repositories**, **Test after every deploy** has three choices:

- **Production deployment**: a test starts when GitHub records a successful deployment to your production environment. GitHub Actions jobs with `environment: production` do this. So do hosts that report deployments to GitHub, such as Vercel. This is the default.
- **Push to your branch**: a test starts when someone pushes to the branch you linked, usually `main`. Use this when your host deploys on every push but does not report deployments to GitHub.
- **Off**: no automatic tests.

## Add the GitHub Action

You can also start the test from your own workflow, right after your deploy step. The Action signs in with the job's GitHub ID token, so there is no AgentProof secret to store. The job needs `id-token: write` permission.

```yaml
name: Deploy
on:
  push:
    branches: [main]
jobs:
  deploy:
    runs-on: ubuntu-latest
    environment: production
    permissions:
      contents: read
      id-token: write
    steps:
      - uses: actions/checkout@v4
      - run: ./deploy.sh
      - uses: GravyPouch/agentproof-action@v1
```

The Action works on your linked branch, on tags, and in any job with an `environment`. It does not run for pull requests. If both the Action and a deployment report the same commit, AgentProof tests it once.

To make the workflow wait for the result and fail when the Attack Agent finds a problem, add `wait`:

```yaml
      - uses: GravyPouch/agentproof-action@v1
        with:
          wait: true
          timeout-minutes: 75
```

| Input | Default | What it does |
|---|---|---|
| `wait` | `false` | Wait for the test and fail the step when the AgentProof check fails. |
| `timeout-minutes` | `75` | How long to wait. A run lasts up to one hour. |
| `api-url` | `https://isagentproof.com` | The AgentProof address. |

The Action sets the outputs `deploy-id`, `run-id`, `run-url` and, with `wait`, `conclusion`.

## Read the check

The **AgentProof** check on the commit shows what happened:

- **Queued**: another deploy is being tested. Only the newest waiting deploy is tested next. Older ones are marked as tested with the newer deploy.
- **In progress**: the Attack Agent is testing the website. **Details** opens the run.
- **Success**: no confirmed problems at the risk level you chose.
- **Failure**: the Attack Agent confirmed at least one problem at that risk level or above. The check lists each problem's title and risk. The evidence stays in AgentProof.
- **Neutral**: the run did not finish, or the deploy was not tested, for example because the domain is not verified.

**Fail the check at** in **Settings** sets the risk level: High (the default), Medium or Low. Press **Re-run** on the check to test the same commit again.

When you merge a fix the Defense Agent opened as a pull request, AgentProof's own retest checks that deploy, so it does not start a second run.
