Review and Approve a Plan
Why This Matters
The plan says what the tests will check. If nobody reads it, nobody knows what the tests check, and a green build means only that the code does what an AI thought it should do.
That is why Selenium AI Agent makes the review a step you cannot skip by accident: every plan starts as a draft, and the generator refuses a draft. This is guardrail 1 from lesson 4. In this lesson you do the review yourself: in the review page, with comments, and through a round of changes.
What you will learn
- What happens when the generator gets a draft plan
- The review page: what it shows, and what Approve, Request changes and Reopen do
- How a review round with comments works
- What an approval records, and how to approve in the chat or without the AI
- When skipping the review is acceptable, and how teams turn it off
The generator refuses a draft
Ask the generator for tests straight after the planner saved a plan, and this is what you get. Real output:
Test not written. The test plan .../specs/login.md is a draft: nobody has approved it yet,
so no tests are generated from it.
Show the plan to the user and ask them to review it: planner_review_plan opens it as a page
in their browser with Approve and Request changes buttons. When they approve it in the chat
instead, call planner_approve_plan with their words (or they change "Status: draft" to
"Status: approved" in the file), then try again.
Only if the user explicitly says to skip the review, pass skipPlanReview: true.
No file was written. Notice that the refusal also tells the agent what to do next: show the plan to the user. A well-behaved agent stops here and asks you to review.
The same check sits in three tools: generator_setup_page, generator_read_spec and generator_write_test. There is no way around it by calling a different tool.
The review page
planner_review_plan turns the Markdown plan into a page and opens it in your browser. It shows:
- the plan’s title, overview and review status
- each suite and test, with its steps and their expected results
- the Elements table and the Gaps and Questions
- a comment box per test and one for the plan as a whole
- the buttons Approve plan and Request changes
The page runs on your own computer only (127.0.0.1), with a random token in its address, so nobody else on the network can open it or approve a plan. Without a plan name, the same tool opens the overview: every plan in specs/ with its status, its tests, the test files generated from it and the last run.
You can also open the review pages yourself, without asking the AI:
npx selenium-ai-agent review
This is useful for a product owner or a test manager who reviews plans but never talks to the agent. They approve in the page; the agent reads the decision from the plan.
A review round
Reviewing is reading the plan as a specification. Use the checklist from lesson 6, and look hardest at the expected values. Suppose you review the shop plan and write two comments:
- on test 2.1 Totals for two products: “Also check the cart button after opening the checkout: it must still show 2 items.”
- on the whole plan: “Add a test for the PayPal payment method, not only iDeal.”
You click Request changes. The page writes your decision into the plan. The status line becomes:
**Status:** changes requested — the user asked for changes on 2026-12-02 10:12 UTC: see "Review comments" below
and your comments go into a new section at the end:
## Review comments
Requested on 2026-12-02 10:12 UTC:
- Add a test for the PayPal payment method, not only iDeal.
- **2.1 Totals for two products:** Also check the cart button after opening the checkout: it must still show 2 items.
The generator refuses this plan too, with a different message: the user asked for changes, see the Review comments. Tell the planner you’re done; it reads the comments, changes the plan, saves it (a draft again) and opens the review page again.
When the plan is right, you click Approve plan. The status line becomes, for example:
**Status:** approved — approved by the user in the review page on 2026-11-22 14:45 UTC
Now the generator may write tests from it.
What an approval means
An approval is tied to this version of the plan. Three things follow from that.
Reopening. If you approved too fast, open the plan in the review page and choose to reopen it. The status goes back to draft, with a note:
**Status:** draft — reopened for review by the user on 2026-11-22 14:47 UTC: approve it again before more tests are generated
Changing an approved plan. If the planner saves a new version of an approved plan, it is a draft again. Under the guided and strict profiles the agent also stores a hash of the approved plan with every test generated from it: a plan that changed afterwards is reported (guided) or blocks healing and the CI gate (strict). Lesson 16 covers this spec lock.
The audit log. Under guided and strict, every approval goes into .agent-audit.jsonl, with the time and, for an approval in the chat, your own words.
Approving in the chat or in the file
There are two other ways to approve, for when the review page is not convenient:
In the chat. Say so: “I’ve read the plan, it’s good, generate the tests.” The agent calls
planner_approve_planwith your words, and the status line records them:**Status:** approved — approved by the user on 2026-12-02 10:20 UTC: "I've read the plan, it's good, generate the tests."The tool’s own instructions tell the agent never to approve a plan itself: not because it looks complete, and not because you asked for tests in your first message. Approval means a person read this version.
In the file. Change
drafttoapprovedin the status line yourself. Plain, and visible in a git diff.
Skipping the review
Sometimes a review is not worth it: a throwaway test while exploring, a demo. Two switches exist, and both are deliberate:
| Switch | Effect |
|---|---|
| Tell the agent explicitly to skip the review | It passes skipPlanReview: true for that plan, and must say in its answer that the tests come from an unreviewed plan |
SELENIUM_MCP_PLAN_REVIEW=off or --no-plan-review | The team turns the check off for the server; the tools still say a plan is not approved |
Under the guided and strict profiles neither switch works: an approved plan is required, full stop. That is the point of those profiles.
A plan without a status line (written by hand, or by an older version) is accepted under explore, with a note to check it was reviewed. Under guided and strict it is refused like a draft.
Exercise
- Open the overview of your plans:
npx selenium-ai-agent reviewin your project. - Open the plan you made in lesson 6’s exercise (search and filters). Write at least one comment on a test and one on the whole plan, and click Request changes.
- Ask the planner to process your comments. Check the new version in the review page: are your comments handled? Then approve it.
- Open the plan file in your editor. What changed in it during this exercise?
Show suggested answer
After step 2 the plan has **Status:** changes requested with a date, and a ## Review comments section at the end with your comments, the test comments prefixed with the test’s number and name.
After step 3 the planner has changed the tests, removed (or replaced) the Review comments section, and saved the plan as a draft again.
After approving, the status line reads approved — approved by the user in the review page on <date> UTC.
If the plan is in git, git diff shows exactly this history. That is a useful habit: commit the plan when you approve it, so the approval and the content are recorded together.
Exam-style questions
1. The AI wants to generate tests, but the plan is a draft. The user hasn’t said anything about the plan. What should the agent do?
- A. Call
planner_approve_planitself, because the plan looks complete - B. Pass
skipPlanReview: true - C. Open the review page and wait for the user’s decision
- D. Write the tests without linking them to the plan
Show answer
2. Why does the review page run on 127.0.0.1 with a random token?
- A. To make it load faster
- B. So that only the person at this computer can open it and approve plans
- C. Because Hugo requires it
- D. To store the plans in the cloud
Show answer
3. Under the strict profile a team member sets SELENIUM_MCP_PLAN_REVIEW=off. What happens?
- A. The generator accepts draft plans
- B. Nothing: under
strictan approved plan is always required - C. The CI gate is turned off as well
- D. All plans are approved automatically