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 permission and changes authorization requirements for existing diagnostics, usage, and telemetry RPCs, with corresponding web and mobile access gating. Because it modifies authentication and authorization behavior across the contract, server, and clients, the access policy and compatibility impact require human review. 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
85833ae to
81b28f8
Compare
81b28f8 to
2c50f4d
Compare
b39eefc to
3d7689d
Compare
3d7689d to
344da99
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 344da99. Configure here.
344da99 to
9c7d0db
Compare
9c7d0db to
02bfe1f
Compare
02bfe1f to
83294bf
Compare

orchestration:readexposed trace logs, host process details, resource history and usage data along with workspace activity. Clients could not receive workspace read access without those diagnostics.Adds
diagnostics:readfor trace and process diagnostics, process/resource history, live resource telemetry, usage summaries and pricing refreshes. Web and mobile query and subscribe only when that environment grants access. Usage remains visible during revalidation of a known grant; initial or failed permission lookups grant nothing. Provider limits remain available under their existing permissions.New Standard grants include the scope. The explicit Read only pairing preset includes it to preserve that preset's previous diagnostics access; custom grants can omit it. Existing clients must pair again to receive the scope. Existing grants are never expanded automatically.
RPC tests cover all seven protected reads with allowed and denied credentials, including denial of unrelated operations to a diagnostics-only client. Targeted formatting and diff checks passed.
Pairing controls with the default selection:
Eight focused access-state tests cover connected checks, unavailable environments, retained grants, and session failures. Web and mobile typechecks pass.
Model: GPT-6. Harness: Codex.
Note
Separate
diagnostics:readscope fromorchestration-readfor diagnostics and usage RPCsdiagnostics:readenvironment scope in auth.ts and reassigns trace diagnostics, process diagnostics, resource history, usage-summary, and usage-rate refresh RPCs to require it in RpcAuthorization.tsresolveUsageAccessutility in usageAccess.ts that maps connection phase and session scopes into a deterministic access state (canReadDiagnostics,isPending, error message)diagnostics:readis absentdiagnostics:read; telemetry retry additionally requiresenvironment:maintainat the handler in ws.tsorchestration-readlose access to diagnostics reads, usage summaries, and resource telemetry; theRead onlypairing preset now grantsdiagnostics:readwhen delegatableMacroscope summarized 83294bf.
Note
High Risk
This is an authorization boundary change: existing
orchestration:readclients lose diagnostics/usage unless re-paired withdiagnostics:read, and RPC enforcement affects sensitive host/process data.Overview
Introduces a dedicated
diagnostics:readscope so trace/process diagnostics, resource telemetry, and usage RPCs are no longer bundled withorchestration:read. Server RPC authorization maps those methods to the new scope;serverRetryResourceTelemetrynow requires bothenvironment:maintainanddiagnostics:read.Clients use shared
resolveUsageAccessto decide whether to call usage/diagnostics APIs. Web and mobile usage state skipsusageSummarywhen access is missing, while still allowing cached totals when a known grant is revalidated. Usage and diagnostics UIs show per-environment denial messages, disable refresh when appropriate, and surfaceenvironment.errorin coverage notices. Pairing settings add View diagnostics and usage and include it in the Read only preset.Server tests assert diagnostics-only vs orchestration-only token behavior and the dual-scope requirement for telemetry retry.
Reviewed by Cursor Bugbot for commit 83294bf. Bugbot is set up for automated code reviews on this repo. Configure here.