Determinism Profiles: Explore, Guided, Strict
Why This Matters
“How much may the AI do on its own?” has no single answer. While you try out a new application, you want the agent fast and free. For a suite that decides whether a release goes out, you want every change to a check approved by a person, every test proven, and a record of who decided what.
Selenium AI Agent turns that answer into one setting: the determinism profile. Three profiles, explore, guided and strict, switch the guardrails from lesson 4 on and off together, so a team doesn’t have to tune ten settings and forget one.
What you will learn
- The three profiles and every setting they control
- How to choose a profile, and how to switch with
agent_profile - Fine-tuning a profile with
overrides - The spec lock: tests tied to the version of the plan they implement
- The audit log: what it records and how to read it
Three profiles
| Setting | explore (default) | guided | strict |
|---|---|---|---|
Approved plan (planApprovalRequired) | as configured: review on by default, but can be skipped | required: no skipping | required |
Selenium’s rules (allowRuleOverride) | errors block; override allowed | errors block; override allowed | errors block; no override |
Heal policy (healPolicy) | free | assertions-need-approval | locators-only |
Locators (locatorSource) | any | any | locked |
Stability runs (stabilityRuns) | 0 | 3 | 5 |
Fails for the right reason (failCheck) | off | on | on |
Spec lock (specLock) | off | warn | block |
Audit log (audit) | off | on | on |
In one sentence each:
explore: fast and AI-led. Exactly the behaviour of earlier versions, so existing setups don’t change. For trying things out, demos, a spike.guided: a person approves the plan, and every heal that changes what a test checks. Tests are verified before they count. The sensible default for a team.strict: CI-grade. Heals are maintenance only, locators come from a locked set, nothing reaches the main branch unverified. For suites that gate releases, and for audited environments.
Check and switch the profile
agent_profile without arguments shows the active profile. Real output, in a project without a profile file:
{
"profile": {
"name": "explore",
"source": "default (no .selenium-agent.json)",
"rules": [
"Plan review as configured (on by default; SELENIUM_MCP_PLAN_REVIEW=off or skipPlanReview turn it off).",
"Selenium's rules block errors; allowRuleViolations can override when the user asks.",
"Heals may change anything."
]
},
"settings": {
"overridden": [],
"planApprovalRequired": false,
"allowRuleOverride": true,
"healPolicy": "free",
"locatorSource": "any",
"stabilityRuns": 0,
"failCheck": false,
"specLock": "off",
"audit": false
}
}
The agent may switch the profile only when you ask, and must pass your own words. Without them:
Not changed: give the user's own words asking for this profile (userRequest). Switch only when the user asks.
You say “We gate releases on this suite, use strict”, and:
{
"message": "Profile set to strict",
"file": ".../.selenium-agent.json",
"profile": {
"name": "strict",
"rules": [
"Tests only from a plan marked approved (no skipping the review).",
"Selenium's rules block errors; no overrides.",
"Heals may only change locators and waits; other code needs the user's approval, assertions and steps never.",
"Locators only from locators.json, the plan's Elements or teach_selector.",
"New and healed tests need verify_test_stability: 5 green runs + fails-for-the-right-reason check.",
"A plan changed after its tests were written: heals blocked, the gate fails.",
"Every decision goes into .agent-audit.jsonl."
]
}
}
Going back to a looser profile is allowed, but the tool spells out what you give up. Switching from strict to explore:
Less strict than strict: the plan review can be skipped again; rule overrides are allowed again; heal policy
becomes free; locators are no longer locked; stability runs 5 → 0; no fails-for-the-right-reason check;
spec lock block → off; no audit log.
Every profile change is logged, even when switching to explore, which has no audit log otherwise:
{"at":"2026-12-02T10:14:07.849Z","profile":"strict","event":"profile_changed","from":"explore","to":"strict","userRequest":"we gate releases on this suite, use strict"}
The profile file
The profile lives in .selenium-agent.json in the project. Commit it: the profile is a team decision, not a personal one.
{ "profile": "guided" }
You can also set it with SELENIUM_MCP_PROFILE=strict or --profile=strict, which wins over the file. That is useful in CI: developers work under guided, the pipeline checks under strict.
Overrides
Each setting can be changed on top of a profile:
{ "profile": "strict", "overrides": { "stabilityRuns": 3 } }
agent_profile lists overridden settings under overridden. An unknown setting or an invalid value is an error, not silently ignored: a typo in a safety setting must not turn it off.
Use overrides sparingly and say why in the commit. “strict, but 3 stability runs because the suite takes 40 minutes” is a reasonable trade-off. “strict, but healPolicy: free” is explore with a misleading name.
The spec lock
When generator_write_test writes a test for an approved plan, it stores a hash of the plan with the test in .test-manifest.json. The hash ignores the status line and the review comments, so approving a plan doesn’t change it; changing a step or an expected value does.
If the plan changes after the test was written, the test may no longer implement what was approved. The profile decides what happens:
specLock | When the healer touches a test whose plan changed |
|---|---|
off (explore) | nothing |
warn (guided) | the fix is written, with a note: “The plan specs/shopping-cart-and-checkout.md changed since this test was written for it: the test may no longer implement what was approved.” |
block (strict) | the fix is refused: the plan has to be approved again and the test regenerated. The CI gate fails too (lesson 18). |
This closes a subtle gap: someone changes the plan (“the cart now starts with a welcome gift”), and the healer then “fixes” the old tests to match. Under strict that path doesn’t exist: a changed plan means regenerated tests.
The audit log
Under guided and strict, every decision goes into .agent-audit.jsonl in the project, one JSON line per event:
| Event | When |
|---|---|
profile_changed | the profile was switched (always logged), with the user’s words |
plan_approved | a plan was approved, with the user’s words or “in the review page” |
plan_changes_requested / plan_reopened | a reviewer asked for changes, or reopened an approved plan, in the review page |
plan_review_skipped | a test was written from a draft because the user said to skip the review |
test_written / test_refused | the generator wrote a test, or refused one, with the reason |
heal_applied / heal_refused | the healer wrote a fix or was refused, with the kinds of change and who approved them |
rule_override_used | a rule error was written anyway, because the user asked |
stability_verified / stability_failed | the result of verify_test_stability |
Each entry carries a hash of the file it is about, so it is tied to one version.
The log answers the questions that come up after an incident, without anyone having to read old chats: who approved this plan? Did the AI change this assertion, and who agreed? Was this version of the test ever verified?
Should you commit it? For an audited environment, yes: git then also records when each line was added. Otherwise, keeping it out of git and archiving it with the CI artefacts works too.
Choosing a profile
| Situation | Profile |
|---|---|
| Trying the agent, a demo, a throwaway spike | explore |
| A team building a regression suite | guided |
| The suite that gates releases; regulated work (finance, health, public sector) | strict |
Developers locally on guided, CI on strict | .selenium-agent.json with guided, SELENIUM_MCP_PROFILE=strict in the pipeline |
Start a new project on guided. Moving to strict later is easy, because guided already records approvals and verifies tests; moving from explore to strict means verifying a whole suite at once.
Exercise
- In your project, ask the agent for the active profile. Then ask it to switch to
guidedwithout giving a reason (“switch to guided”). Does it work? (It should: you asked. What does it record asuserRequest?) - Open
.selenium-agent.jsonand.agent-audit.jsonl. What is in them? - Add an override that makes
guidedrun 5 stability runs. Check withagent_profilethat it is listed underoverridden. - Add an override with a typo:
"stabilityRun": 5. What happens?
Show suggested answer
- Yes: “switch to guided” is your request, and the agent passes those words as
userRequest. What it may not do is switch on its own initiative. .selenium-agent.jsoncontains{ "profile": "guided" }. The audit log has aprofile_changedline withfrom,toand your words.{ "profile": "guided", "overrides": { "stabilityRuns": 5 } };agent_profileshows"overridden": ["stabilityRuns"]and"stabilityRuns": 5.- The profile doesn’t load: Unknown setting “stabilityRun” in .selenium-agent.json overrides, with the list of known settings. A typo in a safety setting is an error, never a silent default.
Exam-style questions
1. Under which profile may a heal change an assertion with the user’s approval, but not without it?
- A.
explore - B.
guided - C.
strict - D. None
Show answer
assertions-need-approval. Under strict an assertion change is refused even with approval.2. A plan was changed after its tests were written. Under strict, what happens when the healer tries to fix one of those tests?
- A. The fix is written with a warning
- B. The fix is refused; the plan must be approved again and the test regenerated
- C. The plan is reverted automatically
- D. Nothing; the spec lock is off in
strict
Show answer
3. Why does approving a plan not change its spec-lock hash?
- A. The hash is computed before approval
- B. The hash ignores the status line and the review comments, so only changes to the content count
- C. Approved plans are never hashed
- D. Because the audit log stores the hash