Skip to content

feat: report the browser PAC per device, with an optional compliance check - #162

Open
LutzLange wants to merge 4 commits into
agentdesktop-dev:mainfrom
LutzLange:browser-pac-reporting
Open

LutzLange wants to merge 4 commits into
agentdesktop-dev:mainfrom
LutzLange:browser-pac-reporting

Conversation

@LutzLange

@LutzLange LutzLange commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

agentdesktop points AI tools at the LLM gateway, but the same models are one browser tab away. Enterprises steer browser AI traffic with a PAC file pushed by MDM or GPO, and nobody sees per device whether it landed. This adds that report. Related: #154 (security posture in the desktop view).

What it does

  • Report: per device, PAC absent, PAC found <url>, or differs (browsers disagree), read from Chrome, Edge, Chromium and Firefox machine policy: Linux policy files, Windows registry (HKCU only when the daemon runs as the user). Shown in agentdesktop discover, the desktop app and the fleet UI. Nothing is configured.
  • Identity: the daemon fetches each PAC URL and reports its SHA-256 and size (never the content). The fleet overview groups devices by URL and hash, so devices getting a different PAC, or none, stand out.
  • Compliance (optional): an expected URL in controller.yaml:
    browserEgress:
      compliance:
        pacUrl: https://pac.corp.example/ai-egress.pac
    The controller marks devices compliant or not, with the reason (absent, other URL, user-overridable policy). It lives in the controller config, not the pushed daemon config, so older daemons are unaffected.

Transport: Inventory.browser_pacs = 3 and Inventory.pac_fetches = 4; older controllers ignore them. No new dependencies (Windows adds the Win32_System_Registry feature of windows-sys).

Tested

  • Linux (Chrome 155, Firefox 157) and Windows 11 (Chrome, Edge, Firefox via HKLM): PAC and hash reported; Chrome applies the policy on a non-domain-joined Windows machine.
  • Fleet: a Linux daemon and the Windows service at one controller; a device on another PAC URL shows as a second PAC version and not compliant.
  • Unit tests for the readers (Windows logic behind a registry trait, so it runs everywhere), the fetch and cache, the compliance evaluation and storage.

Notes for review

Possible follow-up

This is meant as a first PR. A second one could add the other half for fleets without MDM (Linux, Windows) and for standalone use: agentdesktop writing the browser PAC policy itself, with the existing managed-file ownership and removal, verified by this report. Happy to hear whether that would fit before starting on it.

🤖 Generated with Claude Code

LutzLange and others added 4 commits October 15, 2026 20:12
…check

Browsers have no per-tool LLM setting; enterprises steer browser AI traffic
with a PAC file pushed by MDM or GPO. The daemon now reports, per device,
the PAC that browser machine policy sets: absent, found with its URL, or
differs between browsers.

- agent: Chrome, Edge, Chromium and Firefox policy readers for Linux
  (policy files) and Windows (registry; HKCU only when running as the
  user); the PAC URL is fetched directly and identified by SHA-256 and
  size, never its content; policy directories are watched
- proto: Inventory.browser_pacs = 3, Inventory.pac_fetches = 4
- controller: migration 0004_browser_pacs; optional
  browserEgress.compliance.pacUrl in the controller configuration, evaluated
  at read time (compliant or not, with the reason); PAC versions grouped by
  URL and hash on the overview
- UI: fleet device column, device card and overview tiles; desktop app card
- README section, regenerated schemas

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Linux: merge the proxy keys across policy files the way Chrome merges
  policies, so ProxyMode and ProxyPacUrl in different files still give a
  PAC; the same key with different values is still a conflict
- Linux: a policy directory that can't be read is reported instead of
  looking like "no policy"
- inventory refresh: resync the file watch after every scan, not only when
  the inventory changed, so a policy file in a directory created empty
  first is seen without waiting for the interval (regression test)
- fleet UI: when browsers set different PACs, the device page lists each
  PAC URL with its hash or fetch error

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Chromium policy files may contain comments and trailing commas, as
  Chromium's loader accepts them (JSON_PARSE_CHROMIUM_EXTENSIONS |
  JSON_ALLOW_TRAILING_COMMAS); the Firefox reader stays strict JSON
- a conflict between legacy ProxyMode/ProxyPacUrl values no longer hides
  a ProxySettings dictionary, which overrides them
- Linux Firefox: only the file Firefox uses counts
  (/etc/firefox/policies/policies.json when it exists, otherwise the
  install's distribution/ file), so a Proxy section in an ignored file
  can't be reported

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dev#160

agentdesktop-dev#160 added 0004_usage.sql; the browser PAC tables move to
0005_browser_pacs.sql. No content change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LutzLange
LutzLange force-pushed the browser-pac-reporting branch from 74e64d9 to 1a59355 Compare October 15, 2026 18:16

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant