@@ -9,8 +9,23 @@ import "path/filepath"
99// - Files & Folders (Catalina+): Desktop, Documents, Downloads
1010// - Removable / Network (Catalina+): handled via opt-in search dirs
1111// - Photos / Music / Movies (Sequoia hardened): Pictures, Movies, Music
12- // - Full Disk Access subtrees: ~/Library/Mail, Messages, Safari, etc.
13- // - Cloud sync (Sonoma+): Mobile Documents, CloudStorage
12+ // - Everything under ~/Library: Mail, Messages, Safari, Mobile Documents,
13+ // CloudStorage, Containers, plus the long tail of Apple-private
14+ // subtrees that gain new TCC services with each macOS release.
15+ //
16+ // ~/Library is skipped wholesale rather than per-subpath. Every macOS
17+ // release adds new Apple-managed subtrees behind new TCC services
18+ // (Sonoma's App Management, Sequoia's hardened Pictures/Music/Movies,
19+ // Tahoe's expanded Media Library scope into
20+ // ~/Library/Application Support/com.apple.avfoundation/, and so on),
21+ // so a curated allowlist of "Library/X" entries goes stale on every
22+ // upgrade — at which point a previously-silent walk into one of those
23+ // subtrees starts firing a prompt at end users. ~/Library is the wrong
24+ // place for developer projects / lockfiles / npmrc files anyway; the
25+ // detectors that DO need to read specific paths under ~/Library
26+ // (JetBrains plugins, Claude desktop MCP config, pip global config)
27+ // use targeted ReadDir/ReadFile calls that don't consult this skipper,
28+ // so they're unaffected.
1429var protectedSuffixes = []string {
1530 "Desktop" ,
1631 "Documents" ,
@@ -20,34 +35,7 @@ var protectedSuffixes = []string{
2035 "Music" ,
2136 "Public" ,
2237 ".Trash" ,
23-
24- "Library/Mail" ,
25- "Library/Messages" ,
26- "Library/Safari" ,
27- "Library/Calendars" ,
28- "Library/Reminders" ,
29- "Library/HomeKit" ,
30- "Library/Suggestions" ,
31- "Library/Application Support/AddressBook" ,
32- "Library/Application Support/CallHistoryDB" ,
33- "Library/Application Support/CallHistoryTransactions" ,
34- "Library/Application Support/com.apple.TCC" ,
35- "Library/IdentityServices" ,
36- "Library/Metadata/CoreSpotlight" ,
37- "Library/PersonalizationPortrait" ,
38-
39- // App sandbox containers — skipped wholesale because any descent into
40- // these triggers per-service prompts (Photos for com.apple.Photos,
41- // Media Library for com.apple.Music, the macOS Sonoma "App Management"
42- // / "Data from other apps" prompt for arbitrary <app>/Data subdirs).
43- // Nothing inside an app's sandbox is meaningful inventory data for
44- // dev-machine-guard's purpose, so the broader skip is a clean win.
45- "Library/Containers" ,
46- "Library/Group Containers" ,
47- "Library/Application Scripts" ,
48-
49- "Library/Mobile Documents" ,
50- "Library/CloudStorage" ,
38+ "Library" ,
5139}
5240
5341// protectedAbsolutePrefixes are matched with strings.HasPrefix. Time
0 commit comments