Repository navigation
Studio: Run scripts setting and per-site Unlabelled clicks rule for the browser agent - #13529
Conversation
… run approved scripts
…endpoints and script prompts current
…hat a point or drop really hits
… and recheck points after the user answers
…hrough shadow roots, and tie screenshot points to scroll and document
…e links, and let any scroll retire screenshot points
…, and size the script cap in UTF-16 units
…fter hover, and find draggable shadow hosts
…he browser agent Settings > Browser gains Run scripts (Ask every time / Never). Never stops offering browser_evaluate and the executor refuses any evaluate that still arrives. Site permissions gain Unlabelled clicks (Requires approval / Always allow), which skips the once-per-site pointer question on canvases and other unnamed targets. Stored values are checked on load: anything unknown reads as ask.
|
@codex review |
|
@codex security review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Stop a drag whose page navigates mid-drag before it touches the new page, land the last step on the end point exactly, refuse to press a disabled control, and recheck the release target after the page's hover and dragover handlers, as the press already does.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…thai#16707) Fixes unslothai#16705 ## What changes The issue asks for a hands-off option for `browser_evaluate`, since Run scripts currently offers only "Ask every time" or "Never". unslothai#13529 left out Allow on purpose, so this keeps "Ask every time" as the default and makes the hands-off choices explicit: - **Settings > Browser > Run scripts** now offers `Ask every time` (default), `Always allow` and `Never`. Picking `Always allow` (or setting the Default row's Scripts rule to `Always allow`, which also covers every site) first opens an "Allow all scripts?" confirmation; Cancel keeps the current setting. With `Always allow` the row's description switches to a warning that models run scripts on any page without asking and that a script can read and change anything on the page. - **Agent permissions** gain a **Scripts** rule, on the default row and per site: `Requires approval` (default) or `Always allow`. With Run scripts on `Ask every time`, a script on a site whose rule is `Always allow` (or a subdomain of it) runs without the prompt; every other site still asks. The most specific site rule wins, as for the other columns, and a page with no host (about:blank) always asks. - `Never` still removes `browser_evaluate` from the turn and the executor still refuses it, whatever the site rules say. - Full access does not cover scripts: only Run scripts or a site's own Scripts rule skips that prompt, as before. - Stored values are still checked on load: `scriptAccess` reads `allow` and `never` as saved and anything else as `ask`; a site rule saved before this change (no `scripts`) or with an unknown value reads as `Requires approval`. - The "auto-allow read-only scripts" idea from the issue is left out: a script's source can't reliably prove it has no side effects. - Two new strings (`scriptsColumn`, `scriptsAllowDescription`) in all 25 locale files. ## Tests - `tests/browser-agent-gate.test.ts`: `scriptRunsWithoutAsking` across Always allow / Ask / Never, site and subdomain rules, a narrower subdomain rule winning, a lookalike host, about:blank; `checkedPermissions` for the new `scripts` field; `browser_evaluate` stays in the turn under Always allow. - `tests/browser-sync-across-windows.test.ts`: `scriptAccess: "allow"` written by another window is kept and saved; an unknown value reads as ask. - Existing rule literals in `browser-agent-steps.test.ts` and `browser-settings.test.ts` gain the new field. ## Verification (Windows 11, Ryzen 5 5600H) - `npm run typecheck`, `npm run i18n:check:strict`: clean. - `npm test`: 14915 pass, 0 fail. - Real Settings dialog in headless Chromium (vite + the `smoke-settings.html` harness): Run scripts lists the three options and saves `allow`; the warning description appears; the default row and a newly added site show a Scripts rule; the site's `Always allow` is saved; both survive a reload; a hand-written `scriptAccess: "yes"` reads as Ask every time; no page errors. Not tested here: a model actually calling `browser_evaluate` end to end in the browser panel (needs a loaded tool-calling model); the skip path is covered by the `scriptRunsWithoutAsking` unit tests. Desktop (Tauri) build not tried. ## Screenshots Settings > Browser, main (`7bf13f21c`) on the left, this PR (`2525437054`) on the right, two separate Studio installs. The Default permissions row gains a Scripts rule (Requires approval by default).  Run scripts menu: Ask every time / Never before, Ask every time / Always allow / Never after.  Picking Always allow asks for confirmation first. Cancel leaves Run scripts on Ask every time.  After confirming, the row's description switches to the warning that models run scripts on any page without asking.  --------- Co-authored-by: Daniel Han <[email protected]>
Stacked on #13505 (base
studio-browser-pointer-actions).What changes
Ask every time(default) orNever. There is deliberately noAllow: approving each script is the only check a script passes. WithNever,browser_evaluateis no longer offered to the model, and the executor refuses an evaluate action that still arrives (The user doesn't let the agent run scripts on pages.).Requires approvalorAlways allow.Always allowskips the once-per-site question before clicking or dragging on a target with no role, name or link (a canvas). A site whose Actions rule isAlways allowstill skips it too, as before.scriptAccess(includingallowwritten by hand) reads asask, and an unknown or missingunlabelledfalls back to the default rule'sask, so rules saved before this change keep asking.Verification
npm run typecheck,npm test(11767 pass),npm run build,npm run i18n:check.tests/browser-agent-gate.test.ts:checkedPermissions/ruleForfor the new field, the turn's tool list withoutbrowser_evaluatewhen scripts are Never, and the durable-gate list still equals the full browser tool set.UNSLOTH_STUDIO_HOMEand port) driven with Playwright, seeded with storedscriptAccess: "allow"and a site withunlabelled: "always": both rendered as ask; the Run scripts menu offers only Ask every time and Never; choosing Never and Always allow persisted and survived a reload.Not tested here
browser_evaluateor clicking a canvas end to end (needs a loaded tool-calling model; this host is CPU only). The gate paths are covered by the unit tests and code reading.Screenshots
Settings > Browser, before (#13505's head) and after this change, each a separate Studio built from its tree: