feat(auth): separate diagnostics and usage permissions - #9790
feat(auth): separate diagnostics and usage permissions#9790juliusmarminge wants to merge 9 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. |
2eef2bc to
0cd8cfe
Compare
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR introduces a new diagnostics:read permission, changes server RPC authorization and telemetry retry requirements, and adds that permission to standard client defaults. Because it changes authentication boundaries and default grants across server, web, and mobile code, human review is warranted. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
0cd8cfe to
74c727c
Compare
74c727c to
a46a945
Compare
a46a945 to
d4580bc
Compare
d4580bc to
92f7e30
Compare
92f7e30 to
c60d179
Compare
c60d179 to
5e27ae4
Compare
5e27ae4 to
3b1934f
Compare
3b1934f to
85833ae
Compare
afbfcd7 to
7772ff6
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix is ON, but a cloud agent failed to start.
Reviewed by Cursor Bugbot for commit 7772ff6. Configure here.
7772ff6 to
aabaea6
Compare
ede5299 to
4055e63
Compare
4055e63 to
0fd319b
Compare
0fd319b to
4defe1b
Compare
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
4defe1b to
b450779
Compare
b450779 to
c6e88f0
Compare
c6e88f0 to
69b9ac7
Compare
69b9ac7 to
11ff72c
Compare

Workspace read access also exposed trace logs, host process details, resource history, and usage data. Add
diagnostics:readso those diagnostics can be granted independently.Web and mobile queries and subscriptions follow each selected environment's grant. Usage retains a known grant during revalidation, loads environments progressively, and retries only failed environments. Initial or failed permission lookups grant no diagnostics access. Provider limits retain their existing permissions; pricing-override edits separately recheck
settings:writeon the owning environment.New Standard grants and the explicit Read only preset include diagnostics access, preserving the preset's previous behavior. Custom grants can omit it. Existing credentials keep their recorded scopes; older servers must be upgraded before they can issue the new scope, then the client needs a fresh grant.
Earlier focused suites passed for all seven protected RPC reads with allowed and denied credentials, scope-loading failures and retained grants, multi-environment Usage retries, and pricing-edit revocation. Scoped web and mobile typechecks passed during stack verification. The pairing captures below predate the final integration.
Earlier-revision pairing UI, captured before the final stack integration:
Model: GPT 6 Astra. Harness: Codex.
Note
Add
diagnostics-readscope and gate usage/diagnostics access on itdiagnostics-readto the scope schema in auth.ts and to theRPC_REQUIRED_SCOPESmap in RpcAuthorization.ts for trace/process diagnostics, resource history, telemetry subscription, usage summary, and usage-rate RPCsresolveUsageAccessresolver in usageAccess.ts that converts connection state and session scopes into a diagnostics-access result, keeping cached grants usable while offlinediagnostics-readand show per-environment access or connection errors instead of usage datadiagnostics-readindependently, and it is included in the read-only pairing presetdiagnostics-readis added to the standard client scope set; existing clients without this scope in their session will be denied usage and diagnostics RPCs until re-paired or re-authenticatedMacroscope summarized 11ff72c.
Note
High Risk
Authorization boundary changes: clients with only orchestration:read lose usage and diagnostics until re-paired, and several RPCs move to a new required scope.
Overview
Introduces
diagnostics:readso trace/process diagnostics, resource telemetry/history, and usage RPCs are no longer bundled withorchestration:read. Server RPC scope maps andserverRetryResourceTelemetrynow requirediagnostics:read(retry also still needsenvironment:maintainvia dual-scope enforcement inws.ts).Clients use shared
resolveUsageAccessto decide per-environment access from connection phase and session scopes. Web and mobile skip usage/diagnostics queries when the grant is missing, show per-environment error copy instead of charts, and disable refresh when nothing can read diagnostics; pairing UI can delegate the new scope (included in the read-only preset).diagnostics:readis added to standard client scopes in contracts; existing tokens keep their old scopes until re-issued. New server tests cover diagnostics-only vs orchestration-only access.Reviewed by Cursor Bugbot for commit 0fd319b. Bugbot is set up for automated code reviews on this repo. Configure here.