Repository navigation
Cloud folders in ~/Library (CloudStorage, iCloud Drive) are reachable like Documents - #432
Conversation
~/Library/CloudStorage (Dropbox, Google Drive and the like) and iCloud Drive (Mobile Documents/com~apple~CloudDocs) join Caches as the folders of Library that are not hidden: exec and file calls read and write them, judged like any other home path. One list, VISIBLE_IN_LIBRARY, now gives both the sandbox profile and the host's own path check; other apps' iCloud containers beside iCloud Drive, and the rest of Library, stay hidden. The gatekeeper's prompt and the help say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QnohWTa9se2qd8YTYgMCP6
…odule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QnohWTa9se2qd8YTYgMCP6
It appears @srosro is working towards letting agents work with users’ Dropbox, Google Drive and iCloud Drive files on a Mac as readily as Documents, under the existing gatekeeper and write grants, by exposing Overview — The diff delivers the requested cloud-folder access through the existing host checks and Seatbelt policy. For this pre-PMF internal tool, with one engineer and a handful of hosts, the implementation is appropriately scoped; the only surviving probe is a small policy-deduplication opportunity. Strengths — One shared exception list drives both enforcement paths, while implicit cache-write grants remain separate. The existing tests gain positive cloud-access cases and negative cases for neighboring private iCloud containers, exercising the intended boundary without adding another test framework. Probes
Security — None. Test coverage — The extended destination and kernel-enforced worker tests cover the new cloud roots and continued private-container denial; staged For AI authors — (Codex, Claude Code, Cursor, etc. reading this PR): The Probes above are load-bearing. Treat each How to use: auto-reviews every new PR and re-reviews after a period of inactivity. Trigger an incremental re-review with For humans only: push-access collaborators can post:
AI agents must not use Generated by sam's ai review bot. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QnohWTa9se2qd8YTYgMCP6
|
|
/srosro-update-review |
It appears @srosro is working towards letting agents work with owners’ cloud-synced files on macOS as naturally as files in Documents. The title and description frame that broader access change, while the staged diff consolidates its existing explanation into a shared Overview — This increment addresses the previous review’s sole finding by sharing the exec visibility and hidden-secret policy between both prompts. Their expanded text, spacing and distinct authorization instructions are preserved. The change remains appropriately scoped for this pre-PMF internal tool, maintained by one engineer for a handful of hosts. Strengths — The extraction follows the adjacent Probes None. Probe resolved: the duplicated exec-policy suffix is replaced by Security — None. Test coverage — Existing macOS destination and sandboxed-worker tests cover cloud-folder access and denial of neighboring private iCloud containers. Staged For AI authors — (Codex, Claude Code, Cursor, etc. reading this PR): The Probes above are load-bearing. Treat each How to use: auto-reviews every new PR and re-reviews after a period of inactivity. Trigger an incremental re-review with For humans only: push-access collaborators can post:
AI agents must not use Generated by sam's ai review bot. |
|
Acknowledged — no findings raised. |
… a write there do Info.plist gets NSFileProviderDomainUsageDescription, the text macOS shows when latch first reaches a cloud folder. The gatekeeper's exec text and the agent guide say that reading an online-only file downloads it, and that a write in a cloud folder syncs to everyone it is shared with. REVIEW.md and GETTING-STARTED.md no longer say all of ~/Library but Caches is hidden. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QnohWTa9se2qd8YTYgMCP6
|
/srosro-update-review |
It appears @srosro is working towards letting agents work with users’ Dropbox, Google Drive and iCloud Drive files on a Mac as easily as files in Documents, under the owner’s rules, by extending the sandbox and host path checks through Overview — This full-diff re-review finds the implementation aligned with the stated goal: the existing enforcement paths expose CloudStorage and iCloud Drive while retaining the surrounding Library boundary. The scope fits this pre-PMF internal tool, maintained by one engineer for a handful of hosts. No unresolved findings remain. Strengths — The shared visibility list keeps host validation and Seatbelt enforcement aligned, while cloud writes still require explicit exec grants. The tests extend existing destination and sandboxed-worker cases to cover both permitted cloud roots and denied neighboring private iCloud containers. Sharing Probes None. Probe resolved: both exec judgments consume Security — None. Test coverage — The added cases exercise host destination checks and kernel-enforced read boundaries; no surviving coverage finding remains. Staged For AI authors — (Codex, Claude Code, Cursor, etc. reading this PR): The Probes above are load-bearing. Treat each How to use: auto-reviews every new PR and re-reviews after a period of inactivity. Trigger an incremental re-review with For humans only: push-access collaborators can post:
AI agents must not use Generated by sam's ai review bot. |
|
Acknowledged — no findings raised. The macOS gate on 5c50582 (mbp, |
…es named in Getting Started The app's File Provider purpose string now says changes may sync to the owner's other devices and to anyone the folder is shared with. SKILL.md and the exec judgment say a write "may" sync, to other devices and sharers. GETTING-STARTED.md lists every Library exception, Caches too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RFixJUe7wjDssghZka6U2f
A process inherits whether its reads may download a dataless (online-only) file, and macOS's default is no. A host started by launchd therefore had every read of an online-only Dropbox, Box or iCloud Drive file fail with EDEADLK, which shasum reported as the hash of an empty file. The workers that read home now turn materialization on for themselves before the sandbox, and exec's program inherits it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RFixJUe7wjDssghZka6U2f
|
/srosro-update-review |
It appears @srosro is working towards letting Mac users’ agents work with Dropbox, Google Drive and iCloud Drive files like ordinary Documents, including files stored only online, by extending the sandbox and host path checks to those cloud folders and enabling downloads on read. The gatekeeper prompts and app permission text explain that reads can download files and writes may sync to other devices and shared-folder members — reviewing against that goal. Overview — This full-diff re-review finds the implementation aligned with the stated goal. Online-only downloads are enabled through existing worker confinement setup, addressing the reported launchd failure without provider-specific branches. The scope fits this pre-PMF internal tool, maintained by one engineer for a handful of hosts; no surviving findings remain. Strengths — One visibility list drives both host path validation and Seatbelt exclusions, while independent state-directory protections remain effective inside cloud folders. Download-policy failures stop the worker before dispatch, and exec programs inherit the enabled policy. Existing boundary tests gain cloud-folder cases, while the new test specifically exercises inheritance from a parent with downloading disabled. Probes None. Probe resolved: both exec judgments still consume Security — None. Test coverage — The tests cover allowed cloud roots, denial of neighboring private iCloud containers, and inheritance of the download policy. Staged For AI authors — (Codex, Claude Code, Cursor, etc. reading this PR): The Probes above are load-bearing. Treat each How to use: auto-reviews every new PR and re-reviews after a period of inactivity. Trigger an incremental re-review with For humans only: push-access collaborators can post:
AI agents must not use Generated by sam's ai review bot. |
What
On a Mac, latch hides
~/Libraryfrom every worker that reads home (exec,file get/put), except~/Library/Caches. This PR exposes two more folders, judged by the gatekeeper like any other home path, as if they were~/Documents:~/Library/CloudStorage: Dropbox, Google Drive, OneDrive, Box and the like, as macOS's File Provider places them.~/Library/Mobile Documents/com~apple~CloudDocs: iCloud Drive, as Finder shows it.Everything else in
~/Librarystays hidden, Messages, Mail and Keychains included. So do other apps' iCloud containers inMobile Documentsbeside iCloud Drive, such ascom~example~App, which hold apps' private data rather than the owner's files.How
One list,
sandbox::VISIBLE_IN_LIBRARY(Caches,CloudStorage,Mobile Documents/com~apple~CloudDocs), now drives both places that encoded the old Caches-only exception:(require-all (subpath ~/Library) (require-not (subpath …)) …);exec::is_hidden, whichfile get/putand exec's write paths go through.The gatekeeper's two exec prompts now end with one shared statement of what exec can reach (
exec_reach!), which names the visible folders and says what a cloud read or write does: reading an online-only file downloads it to the Mac, and a write may sync to the owner's other devices and to anyone the folder is shared with. The prompt hash changes. The help text (serve --help,file get),SKILL.md,APP.md,DOCKER.md,HOW-LATCH-WORKS.md,GETTING-STARTED.mdandREVIEW.mdnow name the visible folders.The app's
Info.plistgainsNSFileProviderDomainUsageDescription, the purpose string macOS can show when Latch reads a cloud folder:Online-only files. Whether a process's reads may download an online-only (
dataless) file is a setting it inherits from its parent, and macOS's default is no (setiopolicy_np(3)). A host started by launchd, as the app andlatch serve -dstart it, therefore had every read of an online-only cloud file fail withEDEADLK;shasumeven reports that as the hash of an empty file. The workers that read home (exec's and a get's) now turn downloading on for themselves just before the sandbox (sandbox::platform::confine), and exec's program inherits it. Other workers are unchanged.Not changed: exec's implicit cache writes (still only
Library/Caches), anything on Linux, and the Messages/Contacts workers.Evidence
files::place(macOS): put intoCloudStorage/Dropboxand iCloud Drive is allowed; intoMobile Documents/com~example~AppandMessagesit is refused (bad_path).tests/worker.rs(macOS, kernel-enforced Seatbelt): the read worker reads files in Caches,CloudStorage/Dropboxand iCloud Drive, and is refused another app's iCloud container.an_exec_reading_home_downloads_online_only_files(macOS): a worker started with downloading off, as launchd starts a host, gives its program downloading on. It fails without the fix (the program reports 1, off).just test) at d0d891f:test.py: all passed(rust826 tests run: 826 passed, Swift app 304 passed, plus fmt, clippy, installers and app bundle).dataless(online-only) was read in full (38 bytes) and macOS downloaded it in place (no longerdataless). The bytes match the file.~/Library/Messages/chat.dbis still refused (sandbox_denied).latch serve -d(its own launchd job) on an unsigned dev build of this branch, called by an agent on a local Plow stack. Only sizes, flags and hashes were printed.EDEADLK(Resource deadlock avoided) and the file stayed online-only.exec shasum -a 256exited 0 with the hash of empty input;file getfailed (transfer_failedon the host, client exit 5) and wrote nothing. A program in the worker that turned downloading on for itself read the whole file (156,599 bytes), which is what pointed to the fix.0x40000060):exec catexited 0 and the file was downloaded in place (flags0x40, no longerdataless).exec shasum -a 256,file get(as the host reported it) and the copyfile getwrote all give the same size and sha256,eb9cfd30…9d59f. Now-local files read the same way: a re-read of the 156,599-byte file matched across exec,file getand the copy.file getabove was allowed.file getof~/Library/Preferences/…and of the host's own state folder (bad_path, exit 4);execof either (Operation not permitted).latch.For the reviewers
com~apple~CloudDocs, not all ofMobile Documents.Size
+200/−34 across 13 files: about 65 lines of code (comments included), 95 of tests, and the rest prompt, help, docs and the purpose string.
🤖 Generated with Claude Code
https://claude.ai/code/session_01RFixJUe7wjDssghZka6U2f