feat(auth): separate filesystem read and write permissions - #9788
feat(auth): separate filesystem read and write permissions#9788juliusmarminge wants to merge 14 commits into
Conversation
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
c80d93e to
3b96a67
Compare
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR changes the authorization model and default grants for filesystem reads and writes, then propagates those permissions through server RPCs and numerous web/mobile file-access paths. The security-sensitive scope migration and changed defaults warrant human review despite the accompanying tests and documentation. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
3b96a67 to
fb4489d
Compare
fb4489d to
d7df773
Compare
bfb151c to
eec5dfb
Compare
38e8814 to
4b73b2d
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
Bugbot Autofix is ON, but a cloud agent failed to start.
Reviewed by Cursor Bugbot for commit 4b73b2d. Configure here.
| return ( | ||
| <> | ||
| <SectionTitle>Browse folders</SectionTitle> | ||
| {!canReadFiles ? <ErrorBanner message="This connection cannot browse host folders." /> : null} |
There was a problem hiding this comment.
Pending grant shown as file denial
Medium Severity
useEnvironmentScope is false while the session is still unresolved, and these surfaces treat that as a confirmed missing filesystem:read grant. The add-project folder picker shows This connection cannot browse host folders before the grant is known, and composer path search returns the same kind of denial instead of staying pending.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 4b73b2d. Configure here.
| explicitMode: selectedProjectDraft.workspaceSelection?.mode, | ||
| projectSetting: selectedProject?.defaultThreadEnvMode, | ||
| projectFilePending: t3ProjectFileQuery.isPending, | ||
| projectFilePermissionPending: fileAccessPending, |
There was a problem hiding this comment.
Offline new-task permission never settles
Medium Severity
fileAccessPending stays true whenever session data and error are both empty. On an offline or unavailable environment that never completes /api/auth/session, default workspace mode never settles, so the auto-branch effect cannot write a default branch.
Reviewed by Cursor Bugbot for commit 4b73b2d. Configure here.


Direct workspace reads and edits currently share task permissions, while viewing local diffs requires
review:write. Addfilesystem:readfor browsing, searching, file previews, and local diffs, andfilesystem:writefor file edits and saving plans. Both scopes remain in the Standard preset so narrower credentials can opt out of direct filesystem access.Host workspace/media asset URLs require filesystem read permission when minted; attachments and project artwork retain their existing authorization. Web, desktop, and mobile controls follow each environment's grant. Losing write access stops pending autosaves and preserves unsaved drafts across closing and reopening the preview; an older editor's completed write cannot clear a newer draft's pending marker. Draft retention is released after confirmation or explicit clearing.
Retire
review:writefrom new grants and the permission picker while keeping old credentials decodable. Existing connections must be paired again to receive filesystem scopes. These scopes govern direct client actions; they do not sandbox provider processes or terminal commands.Validation: 17 filesystem access/browse tests, draft-retention regressions, and web/mobile typechecks pass. Offline file views distinguish connection failure from a pending permission check.
Pairing controls, captured from this layer’s base and head with the same viewport and default selection:
Model: GPT-6. Harness: Codex.
Note
High Risk
Changes authentication and authorization for filesystem and asset access across server and all clients; misconfiguration or incomplete client updates could block file features or leave unexpected access until re-pairing.
Overview
Introduces
filesystem:readandfilesystem:writeOAuth scopes and moves host file operations off broad orchestration/review grants. The server now requires filesystem read for listing, reading, searching, browsing, review diffs, and workspace/media asset URLs; filesystem write forprojectsWriteFile.review:writeis removed from new grants and pairing (AuthGrantScope) but still decodes on old sessions.Web, mobile, and shared client runtime gate browse/search/preview, local git review sections, composer path search, and asset URL minting on
filesystem:read; plan save and file edits needfilesystem:write. Mobile and web file UIs useresolveFilesystemReadAccessfor loading vs clear “cannot read host files” states. Read-only connections skip autosave, show read-only banners, and retain unsaved drafts until write access returns (with coordinator/query-state fixes so stale writes don’t clear newer edits).Pairing settings and docs describe the new scopes; standard client defaults include both filesystem scopes. Server tests cover scope enforcement for RPC and assets.
Reviewed by Cursor Bugbot for commit 4b73b2d. Bugbot is set up for automated code reviews on this repo. Configure here.