Skip to content

Spike: does Full Disk Access let the vendor's profile enrichment label backends (profileName)? #8

Closed

Description

@SSFSKIM

Question

The vendor's profile enrichment never labels a backend with profileName on either Mac (Phase C report, residue 3), so every profiles bind needs the user's explicit pick. Hypothesis (spec Surprises, 2026-10-05): the enrichment reads Chrome's Local State and settings store, and those reads fail with EPERM when the runtime is launched from a process without Full Disk Access (macOS 27 protects Chrome's user-data directory).

Method

On the mini, where Terminal now has Full Disk Access: run the bounded read-only listBrowsers launch (the same one profiles list uses) from (a) a Terminal shell, (b) an SSH shell (sshd processes read Chrome's directory), (c) a shell without Full Disk Access. Compare profileName on the returned backends. Never pick or bind anything.

Deliverable

A findings comment with the three results. If labels appear with Full Disk Access: a follow-up enhancement so profiles bind shows the profile name beside each candidate id (the explicit pick stays mandatory; no auto-bind). If not: record what the enrichment actually fails on. Either way, a Surprises entry in the spec.

Activity

  1. added
    status:ready-for-implementer
    priority:P2
    spike
    status:in-progress
    and removed
    status:ready-for-implementer
    on Oct 5, 2026
  2. SSFSKIM commented on Oct 5, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-progress: Spike started: running the read-only listBrowsers launch from an SSH shell on the mini (which can read Chrome's user-data directory) and inspecting backend profile fields.

  3. SSFSKIM commented on Oct 5, 2026

    @SSFSKIM
    OwnerAuthor

    Spike #8 findings: Full Disk Access is not what blocks the labels. node_repl's default sandbox is.

    Conclusion: the hypothesis is refuted. Reading Chrome's directory is necessary but not sufficient. On the mini, from an SSH shell (which can read Chrome's user-data directory), the vendor enrichment still returns no profileName. Three things are confirmed:

    1. The enrichment does run.
    2. It reads Local State without error.
    3. It then fails on mkdtemp(<nodeRepl.tmpDir>/codex…) with EPERM.

    The EPERM comes from node_repl's macOS sandbox, not from TCC. cua's tools/call sends no _meta["codex/sandbox-state-meta"], so node_repl applies a restrictive default to the trusted worker: reads are allowed, but writes are denied even to $TMPDIR and /tmp. Sending the same listing with a sandbox state of {"permissionProfile":{"type":"disabled"}} labels the backend: profileName: "ucsd.edu" (Profile 12's display name). With no sandbox state, the result is profileName: null.

    Environment

    • Mac mini: macOS 27.0 (26A428), Node v26.4.0.
    • cua main at 53d817f (ran git pull first), runtime 26.928.40906, its own Node v24.21.0.
    • Live host: pid 9939, cua's placed ChatGPT for Chrome host, parent Google Chrome (30559), up since 11:32 KST. The owner did not wake anything; nothing was bound, picked or registered.

    What the enrichment does

    Source: browser-service.mjs aL/cte/ute/sL (readable chatgpt-26.928.40906/cua_node/@oai/browser-desktop/scripts/browser-service.mjs:67370-67470). The installed runtime's minified copy has the same code.

    1. Guard: the backend's getInfo must carry metadata.extensionInstanceId and metadata.extensionId. The extension (1.26.901 in Profile 12) sends metadata:{extensionId:chrome.runtime.id,extensionInstanceId}.
    2. Read Local State and walk profile.profiles_order.
    3. For each profile whose Local Extension Settings/<extensionId> exists: import("classic-level"), then mkdtemp(nodeRepl.tmpDir + "/codex"), then cp the LevelDB there, then read the key extensionInstanceId.
    4. On a match, set metadata.profileName (and profileIsLastUsed, profileOrdering).

    Errors at each step are swallowed by .catch(gt), which only reports to the vendor's error reporter, so the backend comes back unlabelled.

    Commands and raw results (all from ssh mac-mini)

    1. cd ~/Developer/GitHub/cua && node bin/cua.mjs profiles list --json (the read-only tool)
    school → Profile 12, ready, extensionInstanceId: "34e8eab6-21ea-47de-a4bf-82696e63f903". ssfs → Profile 1, not_bound. profiles list never prints labels, so the next step prints the backend fields directly.

    2. The same liveness launch with the raw backend fields printed. This calls listLiveBackends({home, runtime: resolveRuntime({home}), tabCounts: false}) from src/profiles/inventory.mjs, the call profiles list makes:
    [{"instanceId":"34e8eab6-21ea-47de-a4bf-82696e63f903","family":"chrome"}]: no profileName. Teardown was confirmed, and no elicitations came up.

    3. Each enrichment step, re-run from SSH with the runtime's own node (nothing copied):

    • Local State is readable. profiles_order is an array of 12 entries, last_used = "Profile 12", and info_cache["Profile 12"].name = "ucsd.edu".
    • Local Extension Settings/hehggadaopoacecdllhhajmbjkdcmajg exists for Default, Profile 1 and Profile 12, and not for the other 9.
    • classic-level resolves from the vendor service's location to cua_node/lib/node_modules/classic-level/index.js. Its native binding round-trips a scratch DB. It also imports under an emulation of the trusted worker's registerHooks trusted-path check.
    • grep -c -a on Profile 12's store finds extensionInstanceId and 34e8eab6-21ea-47de-a4bf-82696e63f903 once each in 000003.log.

    4. Watched $TMPDIR during the listing for the vendor's codex* temp copy. I first checked that the watcher catches a quick mkdtemp+rm. Result: no codex* entry was ever created. On the first Mac, whose Chrome directory this shell can read, the same listing over 3 live backends gave the same result: 3 backends, no labels, no temp copy.

    5. Observed which Chrome paths the vendor touches. Script: /tmp/cua-spike8/observe-service.mjs on the mini, a trusted browser service that wraps fs/fs/promises via syncBuiltinESMExports, logs to stderr, and delegates every request untouched to the pinned vendor module. Launched with buildLaunch(... services: {browser: observer}):

    readFile  Chrome/Local State                                                ok
    existsSync Chrome/{Default,Profile 1,Profile 12}/Local Extension Settings/hehgg…  true   (others false)
    mkdtemp   …/codex   error EPERM   (x3)
    

    The observer's first log attempt is itself evidence: writes from the trusted worker to /tmp/cua-spike8/… and to $TMPDIR/… failed with EPERM: operation not permitted.

    6. The same listing with the sandbox state Codex sends per call. Script: /tmp/cua-spike8/sandbox-meta-listing.mjs. It runs the same LIVENESS_CELL, x-codex-turn-metadata and decline-all elicitations as profiles list, plus _meta["codex/sandbox-state-meta"]:

    • none: {"instanceId":"34e8eab6-…","family":"chrome","profileName":null}
    • {"permissionProfile":{"type":"disabled"},"useLegacyLandlock":false,"sandboxCwd":"file://<run dir>"}: mkdtemp ok ×3, cp ok for Profile 12, Default and Profile 1, and {"instanceId":"34e8eab6-21ea-47de-a4bf-82696e63f903","family":"chrome","profileName":"ucsd.edu"}. I repeated this with cua's production src/services/browser.mjs instead of the observer and got the same label.
    • Every run confirmed teardown. No codex* leftovers in $TMPDIR, and <CUA_HOME>/run and the sessions directory are empty afterwards.

    How the mechanism was found: node_repl embeds a SandboxState {permissionProfile, sandboxCwd, useLegacyLandlock} read from codex/sandbox-state-meta, with sandbox-exec / macos_sandbox_failed paths. The pinned codex CLI defines the same struct, with a codexLinuxSandboxExe field, and sends that _meta key on MCP tool calls.

    What I could not test

    • The ticket's three-way comparison (Terminal with Full Disk Access, SSH, a shell without it). Only SSH was run. The console cases need GUI interaction, and I made none.
    • The Full Disk Access requirement in the console. The source implies it still exists: the Local State read happens before the temp copy, so a runtime launched from a console process without Full Disk Access would also hit TCC's EPERM there. Untested.
    • Whether the desktop app labels its own backends. That depends on the sandbox state Codex sends there. Not observed.
    • A narrower profile than disabled. I did not try a managed profile that allows only tmpdir writes. The exact managed / file_system shape should come from openai/codex's PermissionProfile and be checked with a probe, not guessed.

    Recommended follow-up

    1. Enhancement (recommended): profiles bind labels candidates itself, outside the vendor runtime. The CLI process reads Local State, copies each profile's Local Extension Settings/<OpenAI extension id> store to cua's own temp directory, and reads extensionInstanceId with the runtime's classic-level. That maps each live instance id to its profile directory and display name.
      • This beats the vendor label. Display names collide on the mini ("직장" and "l1ngual.com" each appear twice), but the directory is what the registry binds.
      • It does not depend on the vendor's sandbox policy.
      • It needs the same Chrome-directory access chromeFacts already needs, falling back to unlabelled with the Full Disk Access hint when the directory is unreadable.
      • The explicit pick stays mandatory (no auto-bind). Bind could warn when the picked id's directory differs from the key's chromeProfileDirectory.
    2. Separate ticket: cua runs the vendor runtime under node_repl's default sandbox because it never sends codex/sandbox-state-meta. That means no writes to $TMPDIR, /tmp or the session cwd. The same restriction probably affects other vendor paths that need scratch space (downloads, uploads, screenshots to disk; Phase C residue item 4). Whether cua serve should send a scoped sandbox state (tmpdir-only writes, never disabled) is a security-policy call that needs a charter Decision Log entry.
    3. Add a Surprises entry in the spec recording this correction to the 2026-10-05 hypothesis. Not yet written.
  4. added a commit that references this issue on Oct 5, 2026
  5. removed
    status:in-progress
    on Oct 5, 2026
  6. SSFSKIM commented on Oct 5, 2026

    @SSFSKIM
    OwnerAuthor

    [board] done: Findings posted (issue comment): hypothesis refuted; cause is node_repl's default sandbox denying temp writes without sandbox metadata. Follow-ups registered (labelling enhancement, sandbox decision). Docs corrected on main.

  7. added a commit that references this issue on Nov 21, 2026
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

    priority:P2spike

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions