Skip to content

Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠

Preserve latent On defaults in Auto exports and clarify security model

Emre Sokullu4a6d52cc188e
diff --git a/docs/security-model.md b/docs/security-model.md
index e17323e77..3bcfd54e3 100644
--- a/docs/security-model.md
+++ b/docs/security-model.md
@@ -209,7 +209,7 @@ The primary threat: a malicious page crafts content that, when read by the agent
| **Skill import boundary** | Skills can expose read-only HTTP tools and download-job tools through a `webbrain-tools` manifest. Importing or keeping the skill enabled is the trust decision for the declared HTTPS endpoint; declared skill tools use `credentials: "omit"` and should mark third-party results `resultPolicy: "untrusted"`. Download-job skill tools still require an action mode and the normal Downloads permission gate before saving files. |
| **WebMCP boundary** | Experimental WebMCP is on by default, so its tools and prompt guidance enter ordinary model requests unless the user opts out under Settings → Bridge. Chrome page-registered names, descriptions, schemas, frame URLs, annotations, outputs, and errors are page-controlled and always use the untrusted-content wrapper. Calls use opaque IDs. Ask may list tools but cannot invoke them. Because a callback can run arbitrary page logic, every invocation requires Act/Dev, fresh per-call confirmation, and a permission grant for the actual registration-frame origin; a page-authored `readOnly` hint never bypasses those gates. Missing/opaque frame identity fails closed, and the frame plus effective HTTP(S) security origin are revalidated immediately before dispatch to prevent navigation races from borrowing an old grant. |
| **API mutation override** | A per-conversation `/allow-api` flag, or the default-on persistent setting under General → Advanced, *waives* the permission prompt for write-method network egress (`fetch_url`/`research_url` with POST/PUT/PATCH/DELETE). Neither option waives GET egress or any other capability. Conversation reset clears only the slash-command override. |
-| **Decision models** | Auto (default) uses the downloaded in-browser model for completion and scheduled checks, or Compass's managed route while Compass is the chat provider; Off uses none. In On, OpenRouter, direct TypeSafe and local/custom System One endpoints share independent per-feature switches. Keys are optional for local servers. Compass completion uses its managed decision route unless a local provider is chosen. Bounded/redacted task and fresh page evidence are untrusted data. Judges have no browser executor; ordinary tool calls still pass policy, permission and completion layers. Strict Secret Mode, cancellation, quota and cost limits apply. Unavailable or malformed judgments fall through to the active LLM and existing checks. |
+| **Decision models** | Auto (default) uses the downloaded in-browser model for completion and scheduled checks, or Compass's managed route while Compass is the chat provider; Off uses none. In On, OpenRouter, direct TypeSafe and local/custom System One endpoints share independent per-feature switches. Keys are optional for local servers. Compass completion uses its managed decision route unless D1 or the in-browser chat model is chosen. Bounded/redacted task and fresh page evidence are untrusted data. Judges have no browser executor; ordinary tool calls still pass policy, permission and completion layers. Strict Secret Mode, cancellation, quota and cost limits apply. Unavailable or malformed judgments fall through to the active LLM and existing checks. |
| **`done()` verification** | Decision and tool-free LLM checks prefer vision, then AX. Confident pending/failed outcomes require read-only recovery before another submission. Accepted task-bound proof can satisfy generic evidence despite an unrelated comment form, while explicit recipient, payment, download, authorization and workflow contracts remain required. Existing dialog/form checks are the final fallback. |
| **Grouped search approval** | A same-site GET form with no credential, payment or hidden token field, and no side-effect action address, shares one task-scoped approval for its navigation, typing and submit when the page's structure marks it as a search: a search landmark, a search-typed field or one whose keyboard says search, code names such as `q` or `query`, a search address, or a submit control a model read, in any language, as only searching or filtering. Words in a field's visible label decide nothing. Every other form keeps its fresh confirmation. |
| **Duplicate-submit guard** | A second text click on the same caption within 45 seconds on the same tab and URL is blocked when a model read the caption, in any language, as committing something (sending, saving, paying, publishing, creating, confirming and so on). A caption read as anything else, or that could not be read, stays repeatable; app-observed popups, links, fields and draft tools are always repeatable. Both builds. |
diff --git a/src/chrome/src/config-transfer.js b/src/chrome/src/config-transfer.js
index 8454edcdb..4d28d5e9e 100644
--- a/src/chrome/src/config-transfer.js
+++ b/src/chrome/src/config-transfer.js
@@ -13,7 +13,7 @@ import {
import { AUTO_GROUP_TABS_KEY } from './tab-group-preference.js';
import { normalizeSettings as normalizeSafeSocialSettings, SETTINGS_KEY as SAFE_SOCIAL_SETTINGS_KEY } from './safesocial/config.js';
import { normalizeUiScale, UI_SCALE_STORAGE_KEY } from './ui/ui-scale.js';
-import { DECISION_FEATURE_KEYS, DECISION_MODES, resolveDecisionConfig } from './agent/decision-config.js';
+import { DECISION_FEATURE_KEYS, DECISION_MODES, resolveDecisionConfig, resolveDecisionMode } from './agent/decision-config.js';
export const CONFIG_SCHEMA = 'webbrain-config/1';
export const MAX_CONFIG_IMPORT_CHARS = 10_000_000;
@@ -296,7 +296,10 @@ function normalizeSettings(source, { strict = false } = {}) {
settings.decisionInputRate = source.decisionProvider === 'typesafe' || (!source.decisionProvider && source.typesafeApiKey)
? .042 : ['local', 'webgpu_d1', 'webgpu_chat'].includes(source.decisionProvider) ? 0 : .02;
}
- if (source?.decisionMode === 'on') {
+ const isLegacyPreModeProfile = !DECISION_MODES.includes(source?.decisionMode) && Object.hasOwn(source, 'systemOneEnabled');
+ const isExplicitOn = source?.decisionMode === 'on';
+ const isModernAuto = resolveDecisionMode(source) === 'auto' && !isLegacyPreModeProfile;
+ if (isExplicitOn || isModernAuto) {
for (const key of Object.values(DECISION_FEATURE_KEYS)) {
if (!Object.hasOwn(source, key)) {
settings[key] = true;
diff --git a/src/firefox/src/config-transfer.js b/src/firefox/src/config-transfer.js
index d79046cab..a11c7988f 100644
--- a/src/firefox/src/config-transfer.js
+++ b/src/firefox/src/config-transfer.js
@@ -13,7 +13,7 @@ import {
import { AUTO_GROUP_TABS_KEY } from './tab-group-preference.js';
import { normalizeSettings as normalizeSafeSocialSettings, SETTINGS_KEY as SAFE_SOCIAL_SETTINGS_KEY } from './safesocial/config.js';
import { normalizeUiScale, UI_SCALE_STORAGE_KEY } from './ui/ui-scale.js';
-import { DECISION_FEATURE_KEYS, DECISION_MODES, resolveDecisionConfig } from './agent/decision-config.js';
+import { DECISION_FEATURE_KEYS, DECISION_MODES, resolveDecisionConfig, resolveDecisionMode } from './agent/decision-config.js';
export const CONFIG_SCHEMA = 'webbrain-config/1';
export const MAX_CONFIG_IMPORT_CHARS = 10_000_000;
@@ -312,7 +312,10 @@ function normalizeSettings(source, { strict = false } = {}) {
settings.decisionInputRate = decisionProvider === 'typesafe' || (!decisionProvider && source.typesafeApiKey)
? .042 : ['local', 'webgpu_d1'].includes(decisionProvider) ? 0 : .02;
}
- if (source?.decisionMode === 'on') {
+ const isLegacyPreModeProfile = !DECISION_MODES.includes(source?.decisionMode) && Object.hasOwn(source, 'systemOneEnabled');
+ const isExplicitOn = source?.decisionMode === 'on';
+ const isModernAuto = resolveDecisionMode(source) === 'auto' && !isLegacyPreModeProfile;
+ if (isExplicitOn || isModernAuto) {
for (const key of Object.values(DECISION_FEATURE_KEYS)) {
if (!Object.hasOwn(source, key)) {
settings[key] = true;
diff --git a/test/decision-mode.mjs b/test/decision-mode.mjs
index aa92232ca..15d3d8d15 100644
--- a/test/decision-mode.mjs
+++ b/test/decision-mode.mjs
@@ -118,6 +118,40 @@ for (const build of ['chrome', 'firefox']) {
assert.equal(config.decisionFeatureEnabled(importedConfig, 'browser'), true);
});
+ test(`${build}: fresh or Auto profile preserves implicit On defaults across export and import`, () => {
+ for (const autoProfile of [{}, { decisionMode: 'auto' }]) {
+ const exported = transfer.createConfigExport(autoProfile);
+ assert.equal(exported.settings.systemOneWatchEnabled, true);
+ assert.equal(exported.settings.systemOneCompletionEnabled, true);
+ assert.equal(exported.settings.systemOneFastClassifications, true);
+ assert.equal(exported.settings.systemOneFastBrowser, true);
+
+ const imported = transfer.parseConfigImport(JSON.stringify(exported)).settings;
+ assert.equal(imported.systemOneWatchEnabled, true);
+ assert.equal(imported.systemOneCompletionEnabled, true);
+ assert.equal(imported.systemOneFastClassifications, true);
+ assert.equal(imported.systemOneFastBrowser, true);
+
+ // When the user later switches to On, all four features are enabled
+ const onLater = config.resolveDecisionConfig({ ...imported, decisionMode: 'on', decisionProvider: 'local' });
+ assert.equal(config.decisionFeatureEnabled(onLater, 'watch'), true);
+ assert.equal(config.decisionFeatureEnabled(onLater, 'completion'), true);
+ assert.equal(config.decisionFeatureEnabled(onLater, 'classifications'), true);
+ assert.equal(config.decisionFeatureEnabled(onLater, 'browser'), true);
+ }
+
+ // But a legacy profile keeps its opt-in switches false
+ const legacyExport = transfer.parseConfigImport(JSON.stringify({
+ schema: transfer.CONFIG_SCHEMA,
+ settings: { systemOneEnabled: true, typesafeApiKey: 'legacy' },
+ })).settings;
+ const legacyConfig = config.resolveDecisionConfig(legacyExport);
+ assert.equal(config.decisionFeatureEnabled(legacyConfig, 'watch'), false);
+ assert.equal(config.decisionFeatureEnabled(legacyConfig, 'completion'), false);
+ assert.equal(config.decisionFeatureEnabled(legacyConfig, 'classifications'), false);
+ assert.equal(config.decisionFeatureEnabled(legacyConfig, 'browser'), false);
+ });
+
test(`${build}: scheduled checks follow the mode`, async () => {
let calls = 0;
const judge = { evaluate: async () => { calls++; return { model: 'judge', answers: { condition_met: { noul: .95 }, task_complete: { noul: .95 }, task_completeness: { score: 2 } } }; } };