
# AI browser verification

`agc verify` has an AI browser agent try each `[[verify]]` goal in a real browser against your app on the mirror. The verdict rides along with the next `agc ship` to the release page and never blocks it. It runs only once an organization owner turns on **AI browser checks**.

```toml
[[verify]]
name   = "a parent books a camp"
goal   = "Find a camp for an 8-year-old, book it with made-up parent and child details, and see the booking confirmed."
path   = "/"
expect = "SELECT 1 FROM bookings WHERE created_at > now() - interval '15 minutes'"
```

Success is `"ok": true` with each result `"ok": true`, and `"proven": true` when `expect` found a row.

## Ask your agent

```text
Describe the app's main feature as an Agent Cloud [[verify]] goal and run agc verify on the mirror. If it says AI browser checks are off, tell me exactly what it would send before I ask an owner to turn it on.
```

If it's off, an organization owner turns it on ([below](#ai-browser-checks-policy)).

## Steps

```bash
agc up --detach
agc verify
agc ship
```

`agc verify` needs the browser agent jev-ultrafast in `~/jev-ultrafast` (or `AGC_E2E_DIR`) and `uv` on the machine. Recordings of every step are saved locally, in the folder `data.recordings` names.

## How it works

**Asked first, every time.** Before anything runs, agc asks Agent Cloud `GET /v1/apps/<app>/verify-policy`. Unless the answer is `allowed`, it exits 12 with `verify.not_enabled`, sends nothing, and its `fix` and `data.setting_url` point at the setting. An app in no organization can't verify, and if Agent Cloud can't be reached nothing is sent either.

**What leaves your machine.** Each step of each try sends the following to an outside model:

| Sent | Detail |
|---|---|
| The goal | The `[[verify]]` goal text from `agentcloud.toml` |
| The URL and page title | Of the page the agent is on |
| Visible page text | Up to 6,000 characters |
| Interactive elements | The page's controls |
| Recent actions | The last 10 |

Only pages on the app's own origin and its mirror's test sign-in are sent. A step that reaches any other page stops that try, sends nothing from it, and fails with "the agent left the app's origin". The agent drives agc's own browser, never your Chrome profile.

It goes to Fireworks (`api.fireworks.ai`), using `AGC_VERIFY_MODEL` (default `glm-5p3-flash`), when `FIREWORKS_API_KEY` is set in the environment or in jev-ultrafast's `.env`. Otherwise, or with `AGC_VERIFY_MODEL=typesafe`, it goes to jev-ultrafast's own models. `data.sent_to` names the provider.

Only the mirror's database is masked. Text from repo files, outside APIs or rows a connection reads through its mirror credential goes as the page shows it, and numbers are never masked. If your app displays revenue figures, or reads a connection whose mirror credential points at production, that content reaches the model. If the app shows something sensitive that isn't in the database, don't run verify against that page.

**Tries and verdicts.** Each goal runs in a fresh private browser context, so no goal inherits another's sign-in. A try gets up to 120 actions (`AGC_VERIFY_MAX_STEPS`) and 6 minutes. Browser agents aren't deterministic, so a goal that fails gets a second, independent try.

| Result | Meaning |
|---|---|
| `ok: true, proven: true` | The agent finished and `expect` returned a row on the mirror |
| `ok: true, proven: false` | The agent says it finished; there is no `expect`, so the release page says it's only the agent's word |
| `ok: false` | Failed twice: stuck, timed out, `expect` found nothing, or the app wasn't serving |
| `inconclusive: true` | The browser agent itself crashed on both tries while the app answered: no verdict on the app |

`expect` runs read-only as a single statement on the mirror. Goals may use rows from your [seed data](/docs/data/mirror-db-tools.md#seed-data); checks may not.

**With a ship.** `agc ship` attaches the last local verification, tied to the code it saw, and whether its snapshot matches the code being shipped. It warns when `[[verify]]` exists but never ran, or ran on different code. `agc ship --from-git` skips verify and says so. The release page shows **Release verification** with each goal's result, how many actions it took, and whether an `expect` query confirmed it. Agent Cloud didn't re-run it: agc reported it from the agent's machine.

## AI browser checks policy

The switch is off by default and only owners can change it. It covers every app in the organization at once, with no per-app switch.

1. In the console's left menu, open **Settings** (the organization's General page, `/console/o/<org>/general`).
2. In the **AI browser checks** card, choose **On: page text may go to the model**, or back to **Off: agc verify sends nothing**.
3. Press **Save**.

It worked when the page says "Saved." and the organization's Activity records the change. From then on `agc verify` runs for every app in the organization instead of exiting with `verify.not_enabled`.

Turn it on when your mirrors run on masked or sample data and the connections' mirror access is **None** or a development credential. Leave it off for organizations whose apps render real customer data from connections. Verification never blocks a ship either way, and `agc check` does not send page content to the browser AI provider. App code its smoke flows exercise can still call permitted outside services, so review those side effects separately.

## Reference

| Key | Type | Meaning |
|---|---|---|
| `name` | string | Defaults to `verify <n>` |
| `goal` | string | Required; an entry with an empty goal is skipped |
| `path` | string | Where the browser starts; must start with `/` (not `//`), default `/` |
| `expect` | string | Optional SQL that must return a row once the goal is done |

| Variable | Effect |
|---|---|
| `AGC_E2E_DIR` | Where jev-ultrafast lives (default `~/jev-ultrafast`) |
| `FIREWORKS_API_KEY` | Sends decisions to Fireworks |
| `AGC_VERIFY_MODEL` | Fireworks model; `typesafe` keeps jev-ultrafast's own |
| `AGC_VERIFY_MAX_STEPS` | Actions per try, default 120 |

## Errors

| `code` | Exit | Cause | Fix |
|---|---|---|---|
| `verify.not_enabled` | 12 (`denied`) | The organization hasn't turned on AI browser checks, or the app has none | Ask an owner to turn them on in General; or skip verify, checks don't need it |
| `verify.no_agent` | 1 | jev-ultrafast isn't installed where agc looks | Install it in `~/jev-ultrafast` or set `AGC_E2E_DIR` |
| `verify.failed` | 11 | A goal didn't work in two tries | Look at the screenshots; say the goal more plainly, or fix the app |
| `verify.inconclusive` | 11 | The browser agent crashed both times (retryable) | Run `agc verify` again |
| `mirror.not_running` | 1 | No mirror | `agc up --detach` |

```json
{
  "ok": false,
  "product": "agent.cloud",
  "command": "verify",
  "data": { "org": { "name": "Camp Co", "slug": "camp-co-1a2b3c" }, "setting_url": "https://agent.cloud/console/o/camp-co-1a2b3c/general" },
  "error": {
    "code": "verify.not_enabled",
    "message": "Camp Co hasn’t turned on AI browser checks. agc verify sends each step's page (the goal, URL, title, up to 6,000 characters of page text, its controls and the last 10 actions) to an outside model, and only the mirror's database is masked, so it stays off until an owner chooses it.",
    "fix": "Ask an owner to turn on \"AI browser checks\" in the organization's General settings (https://agent.cloud/console/o/camp-co-1a2b3c/general). Only an owner can change it (builders see the page read-only): on General, find the \"AI browser checks\" card, choose \"On: page text may go to the model\", then press Save. Or skip verify: checks don't need it.",
    "retryable": false,
    "docs": "agc help verify"
  },
  "next": [{ "cmd": "agc check", "why": "the app’s own checks run without sending anything out" }]
}
```

## Agent notes

- `verify.not_enabled` is a person's decision, not a failure to retry. Relay what is sent, word for word. Don't set `FIREWORKS_API_KEY`, call the browser agent directly, or look for another way to run it.
- One goal per main feature, in a person's words, with made-up details. A failed verify is information for the person approving, not a gate; don't weaken a goal to make it pass.
- Change the code after `agc verify` and the release page says the verdict is stale. Run it again right before `agc ship`.

## Related

- [Checks overview](/docs/checks/checks-overview.md)
- [Invariants](/docs/checks/invariants.md)
- [Seed data](/docs/data/mirror-db-tools.md#seed-data)
- [Masking](/docs/concepts/masking.md)
- [Connections](/docs/owners/connections.md)
- [Activity log](/docs/owners/activity-log.md)

<!-- feedback:start -->
---
Wrong, outdated or unclear? Run `agc feedback docs "checks/ai-browser-verification: <what is wrong>" --body <file>` with the sentence quoted in the file. No code or app data is sent.
<!-- feedback:end -->
