Skip to content

feat(browser): inspect native enterprise policy and report browser denials - #167706

Draft
jesse-merhi wants to merge 8 commits into
mainfrom
feat/native-browser-policy
Draft

jesse-merhi wants to merge 8 commits into
mainfrom
feat/native-browser-policy

Conversation

@jesse-merhi

@jesse-merhi jesse-merhi commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Operators need to understand which native enterprise policies govern the browser OpenClaw controls and why an administrator restriction blocked a browser action.

User Impact

openclaw browser policy reports the running Chromium browser's native policy values, sources, scope and diagnostics. Native navigation and startup denials explain how to inspect policy and contact the administrator; snapshots of denied tabs remain readable.

Existing MDM and local OS policies remain browser-owned. OpenClaw does not override restrictions or switch browsers to avoid them. Automatic inspection is verified on Linux Chrome/Chromium 144 and Chrome 154. Other operating systems, browser products and unsupported transports do not advertise automatic verification. effective means loaded entries were observed, not that every entry provides protection.

Why This Change Was Made

Read native policy through the protected browser inspection flow rather than introduce an OpenClaw policy file or duplicate Chromium's URL matching. Passive status opens no inspection tabs, and Doctor reports a summary without exposing raw policy values. Native denial reporting covers navigation, created tabs and action flows while preserving SSRF checks and closing only a failed tab created by the current request.

This is the first of two dependent PRs. Guided local setup and verification are in the second part.

Evidence

On the isolated Ubuntu demo with Google Chrome 154, the actual CLI/browser flow changed from an empty native policy report to a loaded mandatory machine policy. An allowed page loaded; navigation and a newly created tab at the blocked destination produced readable denial guidance. The fixture received zero requests to the blocked destination, and only the failed newly created tab was closed. Removing the task-owned policy and activating the native change restored access.

openclaw-demo browser policy
before: state=none, browser=Google Chrome, version=154.0.8037.97, os=Linux
after native installation: URLBlocklist=["127.0.0.1:18999/blocked"]
level=mandatory, scope=machine, source=platform

blocked navigation:
Chromium blocked this navigation through enterprise policy.
Run openclaw browser policy or inspect chrome://policy ...

Independent correctness and standards reviews cover the complete story and the later integration repairs. No supported production findings remain. The registered CLI timeout repair was reproduced through the real command. Doctor, dashboard and connection fixtures now exercise native inspection/navigation without weakening authority, cancellation, ordering or cleanup assertions. These fixture repairs were independently reviewed and add no permanent cases.

All six mapped Linux Node jobs pass with their full native-planner selections. The browser/database job passed 161 database cases and 1,574 browser cases, with 101 browser skips (224.63s wall). The provisioning/config job passed in 738.24s after diagnosis established that the VM lacked the wrapper's existing jq prerequisite; installing it resolved the fixture failure without changing assertions or product code. Four unchanged job definitions retain their passing results (245.14s total).

The combined stack builds with pnpm build:ci-artifacts on macOS/Node 24.18.1 (3m27.6s). Generated plugin assets match; all eight built native-host E2E cases pass (49.49s wall), and built CLI help/status checks pass with Node 24.18.1 and Bun 1.4.2 in isolated state. The successful build emits an unrelated advisory UI request-budget warning.

The final combined revision also builds on Ubuntu/Node 24.21.0 (278.77s wall); generated plugin assets match, built Node/Bun 1.4.2 help/status checks pass, and all eight built native-host cases pass (55.56s wall). The initial SDK declaration attempt was killed at the VM's 12 GiB cgroup limit. The diagnosed retry used the existing Go runtime's GOMEMLIMIT=6GiB and GOMAXPROCS=4 without changing source, dependencies or command scope; no additional OOM occurred. The retained manual demo Gateway remained healthy.

Extension production/test types, all five core and four root test-type stripes, full selected browser lint, formatting, documentation, import-cycle checks, all 18 additional boundary checks, protocol and architecture guards pass. The final line-cap ratchet passes for all 33 changed source files. Core lint stripes 1–4 report the nine untouched inherited violations listed below; stripe 5 passes. The Linux lint process hit its 12 GiB cgroup limit; the remaining static checks completed on macOS with a bounded Go heap.

Focused policy/setup/CLI coverage previously passed 17 cases in 78.125s including SDK preparation. Three routine cases were removed; the remaining consequential passing cases retain that evidence. Independent Doctor owning/sibling coverage passed 58 cases (134.11s wall, 23.14s summed test time); the real endpoint reports ok: true, policy unverified, and live snapshot pass. All 31 connection cases passed on Mac (10.22s wall, 385ms summed test time). Hosted CI timing is unavailable while the PRs remain draft.

Automatic hosted CI remains pending. The fresh ClawSweeper review failed before producing a verdict: its input scanner reports an unverified finding with a literal mismatch in the pinned-base version of the connection fixture. This does not establish a secret in this change; no scanner qualification or bypass was applied. The independent correctness and standards reviews remain completed. The PRs remain draft while the recorded core-lint and automated-review readiness gates are unresolved. Native macOS/Windows inspection and live MDM deployment were not exercised. The Ubuntu/Chrome 154 manual demo remains available for testing.

Inherited core lint failures at the pinned base

All listed files and .oxlintrc.json are byte-identical to the pinned main base. These are observed local lint results, not a claim that current main CI is red.

Stripe File Counted lines (limit 700)
1 src/cli/update-cli/update-command-post-update.ts 702
2 src/plugin-state/plugin-state-store.ts 713
2 src/agents/worktrees/checkout.ts 731
2 src/agents/tools/sessions-send-tool.ts 703
3 src/plugins/registry-runtime-session-ownership.ts 755
3 src/state/openclaw-agent-db-validation-cache.ts 706
4 src/auto-reply/reply/dispatch-from-config.choose-route.ts 768
4 src/config/sessions/transcript.ts 749
4 ui/src/pages/chat/components/chat-detail-panel.tsx 706

Core lint stripe 5 and all five core/four root test-type stripes pass. The separate Linux lint process hit its 12 GiB cgroup memory limit; the remaining static gates were executed on macOS with a bounded Go heap.

Part Files +LOC -LOC
Implementation 17 +758 -102
Tests and fixtures 10 +283 -101
Documentation 2 +40 -2
CI, config, and tooling 1 +0 -2
Total 30 +1081 -207

@clawsweeper

clawsweeper Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review blocked

Automated review did not run, so no review verdict was produced.

Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here.

Automatic review is on hold, including after source changes. Request a fresh re-review after resolving the failure; maintainers can also release the hold through an intentional scanner-policy update.

Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: browser size: L labels Oct 9, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 9, 2026
@clawsweeper

clawsweeper Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

The browser plugin adds native enterprise-policy inspection and explains when Chromium administrator restrictions block browser actions.

Example: An operator navigates to a destination blocked by Chromium enterprise policy.

  • Before: The failure lacks a dedicated native-policy reason and inspection guidance.
  • After: The response explains that Chromium blocked the navigation and directs the operator to openclaw browser policy or chrome://policy and the administrator.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful and supported by a real browser trace, with product scope awaiting owner direction and one added test that does not exercise the change.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The complete PR body supplies copied output and observed results from the actual CLI on isolated Ubuntu with Google Chrome 154, covering policy inspection, allowed and denied navigation, failed-created-tab cleanup, and restored access after removal. This supports the changed inspection and denial owners; macOS, Windows, and live MDM coverage are expressly unclaimed.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Needs a maintainer decision
User problem: Operators cannot readily inspect the controlled browser's enterprise policy or distinguish administrator denials from ordinary browser failures.
Reason: The diagnostics address a clear operator problem and preserve browser-owned enforcement. The new command and broader failure-result semantics need direction from the browser area's owner.

Merge readiness

⛔ Blocked before merge - 2 items remain

This PR contains distinct, useful work absent from current main and is maintainer-authored, so cleanup closure is inappropriate. No concrete introduced correctness or security defect was established.

Priority: P2
Reviewed head: 47f1d657029e079cfaf0c15329652286ed65560a
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should the bundled browser plugin add Linux native-policy inspection and treat committed Chromium error pages as failed browser actions?
  • Recommendation: Accept the scoped diagnostics: Adopt inspection and native-denial reporting with the documented Linux support boundary and browser-owned enforcement.
  • Why: This adds a new diagnostic command and changes existing action results; the inspected discussion contains no explicit browser-owner acceptance of that scope.

Before merge

  • Complete next step - Resolve GitHub's reported merge conflicts and verify the affected browser paths against the resulting branch.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

None.

Tests

  • Low-value test extensions/browser/src/browser/pw-session.create-page.navigation-guard.test.ts: allows read-only inspection of a committed native browser error page: Remove this added helper test: it calls the unchanged safety checker, which never reads the supplied native CDP error fixture, so it passes without exercising the introduced denial handling or a snapshot entry point.
Agent review details

How this fits together

The browser plugin turns CLI and agent requests into browser-control operations. Chromium remains responsible for enterprise-policy enforcement; OpenClaw reads its diagnostic pages and translates observed denials into actionable responses.

flowchart TD
  A[CLI or agent request] --> B[Browser plugin admission]
  B --> C[Selected Chromium browser]
  C --> D[Native policy inspection]
  C --> E[Navigation result]
  D --> F[Policy report or Doctor summary]
  E --> G[Success or administrator denial guidance]
Loading

Technical review

Best possible solution:

Keep native enforcement with Chromium and place supported inspection and denial translation in the existing browser plugin owners.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a feature proposal; the supplied Ubuntu/Chrome 154 trace exercises native inspection and blocked navigation through the actual CLI.

Is this the best way to solve the issue?

Yes for ownership and scope: reading Chromium's own policy state avoids duplicating enforcement rules or introducing an OpenClaw policy store; acceptance of the new command and action-result behavior remains a product choice.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 96d37e971f03.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Distinct current-main capability: Current-main searches found no native-policy inspection command, RemoteDebuggingAllowed diagnostic, or ERR_BLOCKED_BY_ADMINISTRATOR handling in the browser plugin and browser documentation. (96d37e971f03)
  • Native inspection owner: Inspection discovers the selected browser's CDP endpoint, checks request authority before creating and navigating its diagnostic target, reads browser-owned pages, and closes that target in finally; no policy installation or stored-state migration is introduced. (extensions/browser/src/browser/native-policy.ts:210, 47f1d657029e)
  • Recorded real browser result: The complete PR body records an isolated Ubuntu/Google Chrome 154 CLI run: native inspection changed from state=none to a mandatory machine URLBlocklist, allowed navigation worked, blocked navigation returned administrator guidance, the blocked destination received zero requests, and removing the task-owned policy restored access. Captured body source identity: 337097774c7003a728079b0339d14771b44af98dccd4a275906ac8ad22d64623. (47f1d657029e)
  • Write-capable cancellation cleanup: The shared CDP socket owner removes its abort listener after connection establishment for write-capable operations, allowing the new inspection path's compensation to run after caller cancellation. (extensions/browser/src/browser/cdp-websocket.ts:424, 47f1d657029e)
  • Browser lifecycle history: History connects navigation ownership to the session-manager split and interaction-tool split, whose introducing PRs explicitly preserve lifecycle, cancellation, SSRF, and cleanup contracts. (extensions/browser/src/browser/pw-session-navigation.ts, aba0b12014a3)
  • Launch diagnostic provenance: The introducing launch-diagnostic PR explains why recovery signals are retained independently of bounded stderr storage; this branch extends that established owner with a native-denial signal. (extensions/browser/src/browser/chrome.ts, a522e4309cbb)

PR surface

Source +573, Tests +191, Docs +38. Total +802 across 23 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 13 593 20 +573
Tests 8 208 17 +191
Docs 2 40 2 +38
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 23 841 39 +802

Review metrics

Metric Value Why it matters
Production versus tests Production +594/-20; tests and fixtures +207/-17 The growth primarily implements native inspection and denial translation within the existing browser plugin rather than adding a separate enforcement owner.
Diagnostic command 1 new command: browser policy This creates a user-facing diagnostic surface without adding a configuration setting.

Labels

Label changes:

  • add P2: Enterprise-policy diagnostics improve a bounded browser workflow without evidence of an urgent regression.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: Enterprise-policy diagnostics improve a bounded browser workflow without evidence of an urgent regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

Reviewed October 9, 2026, 4:12 AM ET / 08:12 UTC.

@jesse-merhi
jesse-merhi added this pull request to stack #169461 October 11, 2026 23:57
@jesse-merhi

Copy link
Copy Markdown
Member Author

/clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: browser P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant