Skip to main content

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

Settingexplore (default)guidedstrict
Approved plan (planApprovalRequired)as configured: review on by default, but can be skippedrequired: no skippingrequired
Selenium’s rules (allowRuleOverride)errors block; override allowederrors block; override allowederrors block; no override
Heal policy (healPolicy)freeassertions-need-approvallocators-only
Locators (locatorSource)anyanylocked
Stability runs (stabilityRuns)035
Fails for the right reason (failCheck)offonon
Spec lock (specLock)offwarnblock
Audit log (audit)offonon

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:

specLockWhen 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:

EventWhen
profile_changedthe profile was switched (always logged), with the user’s words
plan_approveda plan was approved, with the user’s words or “in the review page”
plan_changes_requested / plan_reopeneda reviewer asked for changes, or reopened an approved plan, in the review page
plan_review_skippeda test was written from a draft because the user said to skip the review
test_written / test_refusedthe generator wrote a test, or refused one, with the reason
heal_applied / heal_refusedthe healer wrote a fix or was refused, with the kinds of change and who approved them
rule_override_useda rule error was written anyway, because the user asked
stability_verified / stability_failedthe 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

SituationProfile
Trying the agent, a demo, a throwaway spikeexplore
A team building a regression suiteguided
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

  1. In your project, ask the agent for the active profile. Then ask it to switch to guided without giving a reason (“switch to guided”). Does it work? (It should: you asked. What does it record as userRequest?)
  2. Open .selenium-agent.json and .agent-audit.jsonl. What is in them?
  3. Add an override that makes guided run 5 stability runs. Check with agent_profile that it is listed under overridden.
  4. Add an override with a typo: "stabilityRun": 5. What happens?
Show suggested answer
  1. 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.
  2. .selenium-agent.json contains { "profile": "guided" }. The audit log has a profile_changed line with from, to and your words.
  3. { "profile": "guided", "overrides": { "stabilityRuns": 5 } }; agent_profile shows "overridden": ["stabilityRuns"] and "stabilityRuns": 5.
  4. 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

Quiz

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
B. assertions-need-approval. Under strict an assertion change is refused even with approval.
Quiz

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
B.
Quiz

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
Show answer
B.