# Kane Exploration: instructions for AI coding agents

Instructions for any AI coding agent that can run a terminal command (Claude Code, Codex CLI, Gemini CLI, Cursor, GitHub Copilot and others). Use them when a task needs the whole context of a running web app: what screens it has, how its flows connect, what is broken, and what should be tested.

Kane Exploration is part of Kane, the testing agent from TestMu AI. From one URL, a swarm of browser agents explores the app like real users. It returns an application map, findings with evidence, and designed tests. It needs no test scripts, no assertions and no requirements document.

Source: https://www.testmuai.com/kane-exploration/ · Docs: https://www.testmuai.com/support/docs/kane-cli-exploration/ · Index: https://www.testmuai.com/kane-exploration/llms.txt. Commands and flags last checked against kane-cli 0.10.12 and the Kane CLI docs on 2026-11-30; `kane-cli explore run --help` lists the options of the installed version.

## Why it exists

Most teams do not have the whole context of their application, and a coding agent has even less. You know the files you changed. You do not know every screen the app has, which flows pass through the page you touched, or what the business expects each flow to do. Tests cover the flows someone wrote down. Users walk through all the others.

Exploration closes that gap. It discovers the app's flows from the running app itself, and it keeps that context current on every release.

## When to use it

Engineering use cases:

- After a change reaches a preview, staging or local URL: find broken flows, failed requests, console errors and accessibility issues across the whole app, including the parts you did not touch.
- You shipped a new feature or page: see which flows it sits in and what it changed.
- An app with no documentation or tests: get its screens, its flows and a first test design.
- Before a release: see new screens, changed flows and failures that are back since the last run.
- You already have a Playwright, Cypress or Selenium suite: map the screens and flows the suite never touched. Exploration works beside the suite.

Business use cases:

- Get the business context of the app. Kane groups what it explored into business entities (the areas of the product, such as payments or onboarding) and writes the use cases and acceptance criteria for each, so everyone knows what must hold true.
- Find coverage risk. See which entities are covered by tests, and where the gaps sit in the connections between them.
- Pick the critical paths. See every user journey on one map and choose the ones that matter most to test.
- Keep quality checks continuous. Each run checks every screen it reaches, so new issues surface on the next run and do not wait for a bug report.

Use `kane-cli run` instead when you only need to verify one specific behaviour (https://www.testmuai.com/kane-cli-agent/AGENTS.md). Use Kane Assurance (`kane-cli context`, `kane-cli design`) when the user has a PRD or spec. Exploration and assurance write to the same project.

## Rules

1. Pass `--policy read_only` on every run unless the user tells you this environment is safe to change. Kane CLI defaults to `mutating`. Every run takes its options again, so a later run without the flag is mutating.
2. Always pass `--project <id>`. Without it, kane-cli uses the configured project, which may not be the user's.
3. Always pass `--agent`. It prints one JSON event per line on stdout, with the result last.
4. Ask the user for the project and the URL if you do not have them. Do not guess a URL.
5. Never ask for a password, access key or token in chat, and never echo one back. Sign-in values go in a variables file the user fills in. Never use a real customer's account.
6. A finding is a lead with evidence, not a confirmed bug. Say so. A person promotes it to a bug, discards it or marks it resolved. Do not change a finding's status yourself.
7. Exploration designs tests. It does not run them. Ask the user before you run any designed test.
8. Explore only apps the user owns or has permission to test.

## Before the first run

```bash
npm install -g @testmuai/kane-cli     # or: brew install LambdaTest/kane/kane-cli
kane-cli whoami                       # check sign-in
kane-cli login --oauth                # opens the sign-in page in the user's browser and waits
kane-cli balance                      # exploration and each design job use credits
kane-cli projects list --search "<name>"    # find the Test Manager project
kane-cli projects create "<name>"           # or create one
```

- Exploration needs kane-cli 0.10.0 or newer.
- One project holds one exploration of one URL. Use a separate project for each app or environment.
- The user needs permission to create test cases in the project. Without it the map still builds, but no tests are designed.
- Kane Exploration is available on the KaneAI Max plan. If `kane-cli balance` shows no credits, point the user to https://www.testmuai.com/kane-exploration/ (launch offer: 25,000 credits) or https://www.testmuai.com/pricing/.
- A person can also start an exploration from the browser at https://www.testmuai.com/kane-exploration/ by pasting the app's URL.

## Run an exploration

```bash
kane-cli explore run --project <project-id> \
  --url https://staging.example.com \
  --prompt "Explore sign-up, the dashboard and the settings pages" \
  --policy read_only \
  --max-leases 40 \
  --agent
```

- `--url` is the app's entry URL. The exploration keeps it. A re-run does not need it, and a different URL for the same project is refused.
- `--prompt` says what to explore and why, in plain words. The default is "Explore the app".
- `--max-leases` stops the run after that many pieces of explorer work. Use it to bound cost.
- The run is queued on HyperExecute and the command exits once it is queued. The run continues without your machine.

### An app behind sign-in

```bash
kane-cli explore run --project <project-id> --url https://app.example.com \
  --prompt "Explore the account area" --policy read_only \
  --deps "Logged in as {{username}} / {{password}}" \
  --allow-domain login.example.com \
  --variables-file ./explore-vars.json --agent
```

The variables file is JSON the user fills in:

```json
{ "username": { "value": "" }, "password": { "value": "", "secret": true } }
```

- `--deps` needs `--allow-domain` for every host the app signs in or writes on.
- Keep `--max-parallel` at 1 if the app allows one session per account.
- Kane masks secret values in logs and evidence.
- Without a test account, Kane stops at the login and reports those screens as not explored.

### A local or private app

Cloud browsers reach a local app through an LT tunnel the user starts and keeps running:

```bash
LT --user "$LT_USERNAME" --key "$LT_ACCESS_KEY" --env ht-prod --tunnelName dev
kane-cli explore run --project <project-id> --url http://localhost:3000 \
  --prompt "Explore checkout" --policy read_only --tunnel-name dev --agent
```

Pass the tunnel flag on every run. Keep the tunnel and the machine up until the run ends.

### Bound the run

| Goal | Option |
|---|---|
| Allow hosts beyond the `--url` host | `--allow-domain <host>` (repeatable; subdomains included) |
| Never press a control | `--deny "<control name>"` (repeatable, under any policy) |
| Let a read-only POST through, such as GraphQL | `--allow-post <host/path>` (read_only only) |
| Cap the work | `--max-leases <n>` |
| More browsers | `--max-parallel <n>` (default 1; up to 20 cloud browsers) |
| Start from one screen of the existing map | `--focus "<screen>"` on a later run |
| Run from this machine | `--local-orchestration` (up to 4 local Chrome windows, or `--browser remote`) |
| Map only, no designed tests | `--no-context` on a new exploration |

A run also ends at a built-in limit: one hour, 400 actions or 800 model calls.

## What the policy does

| | `read_only` | `mutating` (default) |
|---|---|---|
| POST, PUT, PATCH, DELETE requests | Blocked, on every allowed host | Allowed |
| Delete, sign out, pay and similar controls | Never pressed | Pressed |

Read-only does not make every interaction free of side effects: `--deps` setup steps run as written, and an ordinary page load can still change data. Tell the user this before exploring a sensitive environment. Use `mutating` only on a test or staging copy. If pages come back empty under `read_only`, the app probably reads data over POST: add `--allow-post`.

## Follow the run

```bash
kane-cli explore list --project <project-id> --agent        # the running exploration and its id
kane-cli explore sessions <exploration-id> --agent          # its runs, newest first
kane-cli explore sessions <exploration-id> --run <run-id> --agent
kane-cli explore stop <exploration-id> --agent              # a queued run stops at once, a running one cleanly
```

Only one run at a time per exploration. Starting another while one is queued or running is refused with `RUN_ACTIVE`.

Exit codes for `explore run` with `--agent`:

| Code | Meaning |
|---|---|
| `0` | The run is queued on HyperExecute |
| `1` | Refused (`RUN_ACTIVE`) or the launch failed |
| `2` | Bad input, not signed in, or a secret problem |

With `--local-orchestration` the command waits for the end: `0` completed or budget, `1` failed, `2` could not start, `3` stopped.

Why a run ended:

| Reason | Meaning |
|---|---|
| `completed` | Nothing left to explore |
| `budget` | It reached `--max-leases` or a built-in limit |
| `user_stop` | A user stopped it |
| `failed:setup_failed` | The `--deps` sign-in failed. Check the values and the `--allow-domain` hosts |
| `failed:secrets_missing` | A needed secret is missing or empty |
| `failed:vm_never_started` | HyperExecute never started it. Run again |

## Read the result

```bash
kane-cli explore view --project <project-id>
```

This serves the map on 127.0.0.1 for the user to open in a browser. It follows a live run.

- Areas, then screens and the flows between them, then each screen's details and controls.
- Flows: open one to see its steps, screen by screen.
- Findings: each one names its screen and flow and carries evidence: the steps that led there, a screenshot, and the network and console logs. Kane checks each screen for console errors, failed network requests, broken links, slow requests and accessibility violations, and walks a new finding's path once more to see if it reproduces.
- A person can add notes, mark a flow or finding correct or incorrect, and mark a screen or control "do not touch". The next run reads these.

## Tests designed from the map

Design jobs turn the map into use cases, scenarios and tests, with a Test Manager test case for each scenario. They run when a run ends, and during long runs.

```bash
kane-cli explore context status <exploration-id> --agent    # on or off, job state, what the last job designed
kane-cli explore context sync <exploration-id> --agent      # ask for a design job now
```

Designed use cases are proposed. A person has not reviewed them yet. To bring the tests into a folder and check coverage:

```bash
mkdir explore-tests && cd explore-tests
kane-cli context pull --project <project-id>
kane-cli cover
```

The pull lists the tests and the variables they need. Tests arrive without recorded steps: the first run of each records them in a real browser and uses more credits, and later runs replay them. Ask the user before running one: `kane-cli testrun run .testmuai/tests/<name>_test.md --agent`.

## Report back

Tell the user, in this order:

1. How many screens and flows were found, and the areas they fall into.
2. The findings, most severe first. For each: what happened, the screen and flow, and the evidence.
3. The flows that are broken or changed since the last run.
4. What Kane could not reach, for example screens behind a login with no test account.
5. What was designed: use cases and test cases waiting for review.
6. Why the run ended, and the credits used if the status shows them.

Keep exploration, findings and test design separate from test execution in the report.

## Explore again on every release

Run the same command for the same project after each release. The run adds to the same map and shows new screens, changed flows and failures that are back. This is how the app's context stays current.

```bash
kane-cli explore run --project <project-id> --policy read_only --max-leases 40 --agent
```

## Limits

- Web applications only. Mobile apps are not supported yet.
- Kane covers breadth: every screen it can reach within the run limits. A person decides which flows need deeper tests.
- Kane does not know the business rules. It cannot judge on its own whether a finding breaks one.
- Kane stops at a login it has no account for.

## Common errors

| Message or symptom | Fix |
|---|---|
| `required option '--url <url>'` | Pass `--url` on the project's first run |
| `a remote run needs a project` | Pass `--project <project-id>` |
| `RUN_ACTIVE` | Wait, or `kane-cli explore stop <exploration-id>` |
| `--url ... is not exploration <id>'s URL` | Use another project, or delete this exploration |
| `--deps needs --allow-domain` | Add `--allow-domain` for each sign-in host |
| `no variable "name" is defined` | Add it to the variables file |
| `no running LT tunnel found` | Start LT with `--env ht-prod` and match `--tunnel-name` |
| Empty pages under `read_only` | Add `--allow-post` for the read-only POST endpoints |
| No tests in the project | Check `kane-cli explore context status <exploration-id>`: it may be off or blocked |

## More

- Docs: https://www.testmuai.com/support/docs/kane-cli-exploration/
- Agent mode and NDJSON: https://www.testmuai.com/docs/kane-cli-agent-mode
- Kane Assurance: https://www.testmuai.com/docs/kane-cli-assurance
- Kane CLI for coding agents: https://www.testmuai.com/kane-cli/agents/
- Kane CLI AGENTS.md: https://www.testmuai.com/kane-cli-agent/AGENTS.md
- TestMu AI for agents: https://www.testmuai.com/agents.md
