Skip to content

Browser Use blocks a local file URL despite “Always allow” approval settings #42679

Open

Description

@genghaoyu235

What version of the Codex App are you using (From “About Codex” dialog)?

26.901.20858 (from desktop app logs)

What subscription do you have?

ChatGPT Pro

What platform is your computer?

Darwin 25.6.0 arm64 arm

What issue are you seeing?

The desktop app's Browser Use tool refuses to open an existing local HTML report via a file:// URL. The same report can be opened manually in the built-in browser.

Error:
“Browser Use rejected this action due to browser security policy. Reason: The browser URL policy blocks this action.”

Current settings:

  • Built-in browser control is enabled.
  • Website approval is set to “Always allow”.
  • No site-specific permission overrides are configured.
  • Full CDP access is enabled.

Restarting the desktop app did not resolve the issue. App logs show browser_use available=true and cua_repl status=ready.

The exact blocking rule is unknown. Please clarify whether this is an intended restriction or a bug, and how access can be restored through supported settings.

What steps can reproduce the bug?

Observed steps in the affected session:

  1. Open an existing local HTML report manually in the built-in browser.
  2. Ask the agent to open the same file:// URL and inspect the rendered report.
  3. The Browser Use tool rejects the request with the URL policy error.
  4. Confirm the browser settings above and restart the app.
  5. Retry the same URL; the rejection persists.

The report and its full path are omitted because they contain private business information. Reproduction with a separate minimal HTML file has not been tested.

What is the expected behavior?

The agent should either access the explicitly authorized local report, or provide a specific explanation of the blocking rule and a supported recovery path.

Additional information

Feedback was successfully uploaded from the desktop app.

Feedback/session ID:
019fa863-d610-73b1-87c5-c0c93acb84fe

Activity

  1. added
    app
    on Sep 4, 2026
  2. added
    bug
    on Sep 4, 2026
  3. github-actions commented on Sep 4, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  4. SankeerthNara commented on Sep 4, 2026

    @SankeerthNara

    Could you assign this to me

  5. gilmanjo commented on Sep 9, 2026

    @gilmanjo

    +1 also blocking some work for me

  6. Shunqu-668 commented on Sep 16, 2026

    @Shunqu-668

    Adding a Windows observation and a question about the supported workflow.

    In our Codex Desktop session, the user can manually view an existing local HTML report in the in-app browser and has confirmed that the report body renders correctly. Browser Use can enumerate the corresponding tab, but its attempt to inspect the file URL is rejected by the Browser Use URL policy. Reading an allowed HTTPS page worked in the same investigation.

    Environment observed on September 16, 2026:

    • Windows x64.
    • The running desktop package path indicates version 26.908.9136.0; this was not verified through the About dialog.
    • Installed bundled Browser plugin: 26.908.70816.

    The error identifies a Browser Use URL policy block. The user explicitly authorized inspection of their own report. Changing the default application for local files has not established a supported way for the agent to inspect it. We have not tested the blocked file operation through Chrome and are not claiming that Chrome itself cannot display the file.

    A read-only inspection of the installed browser-service.mjs found a URL validation function accepting http:, https: and about:blank, with file: excluded. This is consistent with the observed error, but we cannot determine the intended product contract from that implementation alone. No tool code or security settings were modified to bypass it.

    Observed sequence:

    1. The user manually opens an existing local HTML report in the in-app browser.
    2. The user confirms that the report content is visible.
    3. The agent attempts to inspect the same file URL through Browser Use and receives the URL policy rejection.

    The report, local path and session history contain private business information and are omitted. We have not reproduced this with a separate minimal HTML test file. Later GitHub browser connection timeouts are a separate symptom and are not evidence for the file URL restriction.

    Could maintainers clarify:

    1. Is read-only Browser Use inspection of a user-opened local HTML tab intended to be supported in this release?
    2. If so, what documented permission or supported workflow enables it? If not, could the UI and error explicitly distinguish user-visible rendering from agent inspection, rather than sending users to unrelated browser settings?
    3. Should this Windows observation be tracked here or under Codex Desktop Windows Browser Use blocks file:// file-backed previews with URL policy #24847, and is there a release or issue to follow for a supported resolution?

    Related: #24847 and #36552.

  7. Simonxiaoxueboshi commented on Sep 24, 2026

    @Simonxiaoxueboshi

    Root cause located on macOS — this is a built-in protocol rule, not a permission or configuration problem.

    Environment: Codex desktop on macOS, bundled browser plugin 26.917.62051. Reproduced today with both backends (iab and chrome), and with full_cdp_access_enabled = true set.

    The check lives in the shipped bundle <CODEX_HOME>/plugins/cache/openai-bundled/browser/26.917.62051/scripts/browser-service.mjs; the chrome plugin of the same version carries the same code. Minified, lightly reformatted:

    var Mh = Object.freeze(["http:", "https:"]), m3 = new Set(["about:blank"]);
    function Jv(t) {
      if (m3.has(t)) return { allowed: true, reason: "allowed" };
      let e; try { e = new URL(t); } catch { return { allowed: false, reason: "invalid_url" }; }
      return Mh.includes(e.protocol)
        ? { allowed: true, reason: "allowed" }
        : { allowed: false, reason: "unsupported_protocol" };
    }

    Any scheme other than http: / https: (or exactly about:blank) is rejected as unsupported_protocol, and the caller then raises navigation_url_policy_blocked with permissionSource: "builtin_rule".

    That explains why "Always allow", full_cdp_access_enabled, and origin approvals do not help: ~/.codex/browser/config.toml is only read for full_cdp_access_enabled, webmcp_enabled, and origin permissions, and the origin checks run after the protocol rule has already failed.

    Two points worth a look:

    1. The plugin manifest advertises the browser for "local web targets such as localhost, 127.0.0.1, ::1, file:// URLs", which contradicts the runtime rule. One of the two should change.
    2. The only switch that bypasses this check is the internal testing mode BROWSER_USE_SECURITY_MODE=disabled-for-local-testing. It also disables check-url-site-status, browser-origin-access, browser-history-read, file-upload / file-download, full-cdp, page-asset-cross-origin-fetch, and raw-cdp-destination-url, so it is not a usable recovery path for this report — the block stays absolute for file://.

    Practical impact: a locally generated HTML file cannot be verified in the agent browser, so browser smoke tests that are part of an acceptance workflow cannot use the sanctioned tool and fall back to the user's own browser plus screenshots.

    Possibly related: #45230, #24847, #44881, #47280, #41386.

  8. DevGuyRash commented on Sep 24, 2026

    @DevGuyRash

    Adding a Linux reproduction of this issue and read-only implementation evidence.

    • Bundled Browser and Chrome plugin cache versions: 26.917.61114.
    • Browser control is enabled. The agent-permissions table shows default browsing, downloads and uploads set to Always allow, with no site-specific exceptions visible. Enable full CDP access is enabled.
    • The user can manually open the local HTML report in the desktop app's built-in browser. Agent access to the file URL receives the Browser Use URL-policy rejection.
    • The desktop app and its Codex app server use the host filesystem namespace and can see the report. External Chrome has an additional Firejail filesystem restriction, but that does not explain the in-app rejection.

    Both installed scripts/browser-service.mjs files have SHA-256 23792c12a4b6374dc62fa17676e9c0e2a6863b27c9b7e9b6b95546daa8505e26. The URL validator accepts http: and https:, plus exactly about:blank, and returns unsupported_protocol for file:. The navigation check raises navigation_url_policy_blocked; origin-access methods run URL policy before saved origin consent. This accounts for the permission settings having no effect on the file URL.

    Could maintainers clarify whether agent inspection of user-opened file-backed tabs is intended to be supported, and identify a fixed release or supported recovery workflow? In particular, the browser documentation describes local development-server workflows, but the file-URL denial prohibits alternate access paths; issue #47280 describes the resulting recovery gap.

    No installed service code, security mode or browser policy was changed during this investigation. The report content and private filesystem paths are omitted.

  9. CT-2026 commented on Sep 29, 2026

    @CT-2026

    Confirmed on Windows, this time with the blocker actively patched out.

    Environment: Windows 11 x64, Codex desktop, bundled browser plugin 26.924.22138.

    I grew tired of routing a single-file HTML app through a local HTTP server or an external browser merely so Codex could visually inspect a file it had just created. I therefore patched the shipped browser-service.mjs locally.

    The blocker is exactly the protocol allowlist identified above:

    Object.freeze(["http:", "https:"])

    Changing it to:

    Object.freeze(["http:", "https:", "file:"])

    and restarting Codex removes the file:// blocker on my Windows system.

    I applied the edit via PowerShell to:

    %USERPROFILE%\.codex\plugins\cache\openai-bundled\browser\26.924.22138\scripts\browser-service.mjs
    

    This is clearly an unsupported, update-sensitive workaround, but it makes the issue difficult to dismiss as an unavoidable browser limitation. The shipped service rejects file: because the allowlist omits it. Add it, restart Codex, and the blocker is gone.

    This affects a standard workflow: Codex generates or edits a self-contained HTML file, opens it in its own browser, visually checks the result, fixes it, reloads, and repeats. Requiring an extra HTTP server for this adds overhead without providing any functional benefit.

    Since the plugin explicitly advertises file:// local targets, I would like to know why users still need to patch a minified bundled service to enable this workflow.

    For reference, the minimal workaround is simply:

    http:, https:
          ↓
    http:, https:, file:
    

    A proper fix needs to come from the plugin itself, because the cache patch will be overwritten by an update.

  10. foreverwang commented on Oct 18, 2026

    @foreverwang

    Adding a reproduction on a newer macOS build, plus a plugin-description/runtime mismatch observed on October 18, 2026.

    Environment

    • Desktop app version: 26.1013.31256, build 20586 (read from the installed application's Info.plist).
    • macOS 26.3.2, arm64.
    • Bundled Browser/Chrome plugin version: 26.1013.31256.
    • Installed @oai/browser-desktop package version: 0.1.1.
    • Browser automation: cua_repl, using the Chrome backend in this session.

    Observed reproduction

    1. Work on an editable local HTML presentation through its existing HTTP editor.
    2. Export a standalone HTML backup containing the report and its embedded runtime, for offline use.
    3. Ask the agent to reopen that exported backup through Browser Use at a file:///.../backup.html URL to verify offline rendering and interaction.
    4. Browser Use rejects the navigation with a URL-policy error, so offline reopening cannot be visually verified.

    The diagnostic includes:

    Browser Use rejected this action due to browser security policy.
    The requested URL protocol is not allowed.
    Allowed protocols: "http:", "https:".
    

    These are steps from the actual report workflow, not a claim that a separate minimal HTML fixture was tested. The report, private filesystem paths, and business content are omitted. The rejection is not evidence that the exported HTML itself is broken.

    Read-only implementation findings

    The installed application package contains the same restriction previously identified in this issue:

    • In @oai/browser-desktop/scripts/browser-service.mjs, the URL validator uses a frozen HTTP/HTTPS protocol allowlist and an exact about:blank exception. Other protocols return unsupported_protocol.
    • The caller raises navigation_url_policy_blocked.
    • The cached Browser and Chrome plugin bundles contain equivalent logic.
    • No user-facing, protocol-specific configuration entry was found in the inspected plugin configuration and runtime code.

    There is also a product-description mismatch: the bundled Browser plugin's .codex-plugin/plugin.json explicitly mentions file:// URLs among local web targets, while the runtime rejects that protocol.

    Static inspection shows that the internal local-testing mode skips a much broader set of checks and consent flows, rather than granting narrowly scoped local-file access. It is therefore not an appropriate supported end-user solution. No internal mode was enabled, no installed code or security policy was changed, and no alternate access path was used to bypass the rejection.

    Suggested resolution

    Could maintainers clarify whether agent inspection of explicitly authorized local HTML files is intended to be supported?

    If it is supported, please provide a documented file-access flow scoped to a user-selected file or directory, with separate handling for referenced resources and preservation of unrelated browser security checks. Tests should cover allowed and denied paths, symlinks/path traversal, referenced resources, and both relevant browser backends.

    If it is intentionally unsupported, please align the plugin description and error messaging with that limitation, distinguish interactive file previews from Browser Use automation, and document a supported workflow for validating offline HTML exports.

    Simply adding file: to a global allowlist, or using the broad internal testing mode, would not address the authorization boundary. The practical need is a supported way to verify user-authorized offline HTML artifacts.

  11. wilfriedbulgarien-spec commented on Oct 21, 2026

    @wilfriedbulgarien-spec

    Additional verified observations from macOS on 2026-10-21.

    Environment:

    • Desktop app 26.1016.51333, build 21161, production channel.
    • Built-in updater returned up_to_date.
    • Darwin 27.0.0 arm64.
    • Bundled browser@openai-bundled 26.1016.51333; Chrome extension backend.

    Observed behavior:
    An existing local HTML illustration gallery was previously visible through native Chrome-window automation in the same conversation. A later attempt to acquire its existing Chrome tab through cua.getTab(...) was denied before page observation:
    The requested URL protocol is not allowed. Allowed protocols: "http:", "https:".
    This establishes a change of control method, not a proven version regression.

    Read-only checks:

    • Chrome extension diagnostics report installed/enabled.
    • Native-host manifest diagnostics report correct, with no problem.
    • Chrome's stored newAllowFileAccess for the extension is already true.
    • Separate public HTTPS pages were successfully opened/read through Chrome and the in-app browser.
    • Resetting the automation REPL and establishing a fresh Chrome connection also allowed HTTPS access. The denied file URL was not retried or routed through another surface.

    Specific shipped-file evidence:

    • .codex-plugin/plugin.json:56 explicitly lists file:// URLs as a Browser use case; the same manifest identifies OpenAI as author/developer.
    • scripts/browser-service.mjs:1012 contains a protocol predicate accepting about:blank and Object.freeze(["http:","https:"]), otherwise returning unsupported_protocol.
    • At line 1101, LX calls that predicate and raises navigation_url_policy_blocked with source navigation-url-policy.

    Please clarify the mismatch between the packaged description and enforcement, and provide a supported recovery/approval path. The denial explicitly forbids alternate routes to the same outcome, so direct user authorization has not restored the local review workflow. We are not requesting a bypass or removal of safety checks.

    Only this sanitized technical summary is submitted. No private project files, absolute user paths, account data, session transcripts, screenshots or artwork are attached. A separate minimal file reproducer has not been executed.

  12. cleocn commented on Oct 24, 2026

    @cleocn

    Adding a macOS in-app-browser observation from October 25, 2026 (Asia/Shanghai), focused on the recovery gap after a file-URL rejection.

    The task was to visually validate a user-owned local HTML prototype at phone portrait and iPad portrait/landscape sizes, including small-chart readability and click-to-enlarge behavior. No application deployment or production change was requested.

    Observed sequence:

    1. The local HTML was open in the desktop app's built-in browser. The agent attempted to acquire the existing file:// tab through Browser Use.
    2. The tool rejected access before page observation. The diagnostic included:

    The requested URL protocol is not allowed. Allowed protocols: "http:", "https:".

    It also explicitly stated:

    The agent must not attempt to achieve the same outcome via workaround, indirect execution, raw CDP or browser commands, alternate browser surfaces, or policy circumvention. Proceed only with a materially safer alternative that does not require this blocked browser action; if none exists, stop and request user input.

    1. The user clarified that the intended workflow was a local HTTP preview. The agent checked the documented local-web-development workflow, which describes localhost development pages.
    2. At the user's request, a local HTTP server was started, bound only to the loopback interface. Its listening socket was verified, and the user opened its localhost page in the in-app browser. The browser context then showed the HTTP page as the current tab.
    3. The user repeatedly requested actual browser validation of that localhost page. The agent interpreted the earlier anti-workaround instruction as prohibiting access to the same artifact through the new HTTP URL and therefore did not attempt to acquire or inspect that page.

    Important distinction: file:// access was actually rejected by the tool. Localhost automation was NOT attempted, so this is not evidence that the tool rejects HTTP or that the server/page is broken. The resulting blocker is the agent's interpretation of the prior denial, with no supported recovery path identified. No browser policy, installed plugin code, security settings, or internal testing mode was modified.

    Could maintainers clarify:

    • Is moving a user-owned HTML prototype to a loopback-only HTTP preview a supported recovery after this particular unsupported-protocol rejection, or is the denial intended to prohibit it?
    • If supported, can the error distinguish an unsupported protocol from a denied content/destination access request, and explicitly describe the permitted next step so the agent does not remain stuck after user authorization?
    • If not supported in the current session, what documented recovery, re-approval, or tool-state transition should be used? Please identify the relevant setting or fixed release if available.

    This comment contains only a sanitized reproduction summary and error text. No business data, HTML content, resource identifiers, private filesystem paths, account information, screenshots, credentials, or session transcripts are attached. The app/plugin version was not independently verified in this reproduction.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbrowserbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions