> ## Documentation Index
> Fetch the complete documentation index at: https://momentic.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Bug bash with the explore agent

> Point the explore agent at a deployment and have it hunt for product bugs instead of building tests.

The [explore agent](/docs/ai/explore) can dogfood your app for you: it walks the user
journeys it discovers in a live browser and files a potential bug whenever the
observed behavior does not match what a user would expect. Reach for this to bug
bash a staging build before a release, to dogfood a feature branch, or to run a
recurring automated bug bash across the whole product.

<Warning>The explore agent is in beta and may change.</Warning>

## What a bug report contains

Every potential bug the agent files includes:

* A short title and a one-line summary of what is broken, from the user's
  perspective.
* The expected behavior and the actual behavior observed instead.
* A severity: `high` when something is completely broken and blocks user
  progress, `medium` for broken non-essential functionality a user will still
  notice, `low` for minor UI/UX issues a user is unlikely to notice.
* Ordered, concrete reproduction steps from a clear starting point.
* A screen recording of the reproduction when one was captured.

The report describes observable behavior only; the agent never proposes
code-level fixes.

## Run a bug bash

`momentic ai bugbash latest` reuses explore's journey discovery, then verifies
each discovered plan in a live browser and reports bugs instead of building
tests:

```bash theme={null}
npx momentic ai bugbash latest
```

The explorer maps the whole product, and each plan is checked by a dedicated
agent that exercises the flow and files bugs for anything broken along the way.
By default no tests are authored or edited, so nothing needs review or merge
afterwards; the output is the bug list. To also build tests for the same
discovered journeys, run
[`momentic ai explore latest`](/docs/ai/explore#seed-coverage-for-the-whole-app),
which authors tests and reports any bugs it finds along the way.

`bugbash latest` accepts the same flags as
[`momentic ai explore latest`](/docs/cli-reference/momentic/commands/ai#explore-latest):
use `--budget` or `--granularity` to control how many plans are verified,
`--parallel` to verify several plans at once, and `--timeout` to cap the run (60
minutes by default).

## Dogfood a change

To dogfood a specific change rather than the whole app, run
[`momentic ai explore diff`](/docs/ai/explore) over the diff window. Bugs the agent
finds while covering the changed journeys are included in the output alongside
the proposed tests, so a PR or merge to `main` gets both coverage and a bug
report in one run. Pass `--dry-run` to skip building tests and only report what
it discovered. See [Author tests from a diff in CI](/docs/guides/explore/in-ci) for
the workflow setup.

## Steer the bash

The agent needs the same project context a new teammate would: which URL to
target, how to sign in, and what to focus on. Keep that in a committed prompt
file and pass it with `--prompt-file`:

```bash theme={null}
npx momentic ai bugbash latest --prompt-file .momentic/bug-bash.md
```

`--prompt-file` and `--prompt` are repeatable and stack in order, so you can
layer a bash-specific focus on top of a general repo overview:

```bash theme={null}
npx momentic ai bugbash latest \
  --prompt-file .momentic/repo-overview.md \
  --prompt-file .momentic/bug-bash.md \
  --prompt "Focus on the new checkout flow."
```

Useful things to put in the bug-bash prompt file:

* The environment to bash (a staging URL, not production) and the test account
  to sign in with.
* Areas to focus on: a feature that just shipped, a flow customers reported
  problems with.
* Areas to skip: admin screens, third-party embeds, destructive actions.
* Data guardrails: do not send real emails, do not delete records.

See [Write a good prompt file](/docs/ai/explore#write-a-good-prompt-file) for the
general guidance.

## Review the findings

The CLI prints each potential bug with its severity, summary, and reproduction
steps; pass `--json` for a machine-readable result. Every run also appears on
the [Explorations page](https://app.momentic.ai/explorations) in the dashboard,
where each bug's reproduction steps and screen recording can be reviewed and
shared. When Slack notifications are configured for explore, potential bugs are
included in the org-channel notification and the author DM.

## Run it on a schedule

A recurring bug bash against staging catches regressions that no test asserts on
yet. Run it nightly or before each release:

```yaml .github/workflows/momentic-bugbash.yml theme={null}
name: Momentic bug bash

on:
  workflow_dispatch:
  schedule:
    - cron: "0 6 * * *" # every day at 06:00 UTC

env:
  MOMENTIC_API_KEY: ${{ secrets.MOMENTIC_API_KEY }}

jobs:
  bugbash:
    runs-on: ubuntu-latest
    timeout-minutes: 75
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: "npm"

      - run: npm ci
      - run: npx momentic install-browsers chromium

      - name: Bug bash the app
        run: npx momentic ai bugbash latest --prompt-file .momentic/bug-bash.md
```

Because a bug bash never opens a pull request, the job needs no
`contents: write` or `pull-requests: write` permissions; only the
`MOMENTIC_API_KEY` secret.

## Related

* [Explore agent](/docs/ai/explore) for the concept and configuration
* [Author tests from a diff in CI](/docs/guides/explore/in-ci) to build coverage from
  the same discovery
* [`momentic ai explore` CLI reference](/docs/cli-reference/momentic/commands/ai#explore)
