-
Notifications
You must be signed in to change notification settings - Fork 67
Description
Summary
We need a configuration mechanism to let users control which services and scopes the extension requests. This solves two problems:
-
Contributor PRs that need new scopes — PRs like feat(tasks): add support for Google Tasks #106 (Google Tasks), fix(slides): enable reliable Slides tool usage and write operations #237/feat(slides): add write tools for Google Slides #235 (Slides write), and Feat sheets insert text #233 (Sheets write) add features requiring scopes that aren't enabled in the published GCP project. Contributors should be able to develop and test these features with their own GCP projects, while the features remain opt-in for other users.
-
Users want scope control — Issue Gemini CLI Workspace Extension wants additional access to your Google Account #86: users who only need a few services don't want to auth for all scopes. Issue Feature Request: Add Support for Customizable OAuth Scopes to Prevent Unintended Email Operations #111: users want to restrict Gmail to read-only to prevent accidental sends.
Proposed Design: Read/Write Feature Groups
Each service is split into read and write groups. Read groups have no side effects and use readonly scopes. Write groups perform mutations and require elevated scopes.
| Service | Group | Scopes | Default |
|---|---|---|---|
docs |
read | documents |
✅ ON |
docs |
write | documents, drive |
✅ ON |
drive |
read | drive.readonly |
✅ ON |
drive |
write | drive |
✅ ON |
calendar |
read | calendar.readonly |
✅ ON |
calendar |
write | calendar |
✅ ON |
chat |
read | chat.spaces.readonly, chat.messages.readonly, chat.memberships.readonly |
✅ ON |
chat |
write | chat.spaces, chat.messages, chat.memberships |
✅ ON |
gmail |
read | gmail.readonly |
✅ ON |
gmail |
write | gmail.modify |
✅ ON |
people |
read | userinfo.profile, directory.readonly |
✅ ON |
slides |
read | presentations.readonly |
✅ ON |
slides |
write | presentations |
❌ OFF |
sheets |
read | spreadsheets.readonly |
✅ ON |
sheets |
write | spreadsheets |
❌ OFF |
time |
read | (none) | ✅ ON |
tasks |
read | tasks.readonly |
❌ OFF |
tasks |
write | tasks |
❌ OFF |
Key points:
- Services whose write scopes aren't in the published GCP project (Slides write, Sheets write, Tasks) default to OFF
- Disabling a write group keeps the read tools available
- Auth tools (
auth.clear,auth.refreshToken) are always registered
Configuration via Environment Variables
# Disable specific feature groups (even if default ON)
WORKSPACE_DISABLED_FEATURES=gmail.write,chat.write
# Enable experimental feature groups (default OFF)
WORKSPACE_ENABLED_FEATURES=slides.write,tasks.read,tasks.writeRules:
WORKSPACE_DISABLED_FEATUREStakes precedence — disables even default-ON featuresWORKSPACE_ENABLED_FEATURESenables default-OFF features- Disabling a feature group removes both its tools and its OAuth scopes
- Re-enabling a previously disabled feature may require re-auth for the new scope
Impact on Contributors
Contributors adding new services would:
- Define read and write feature group entries in the feature config registry
- Set their default state (ON for scopes in the published project, OFF otherwise)
- Gate their tool registrations on the feature config
This lets contributors develop and merge new features without being blocked by the published GCP project's scope configuration.
Questions for the Community
- Is the read/write split the right granularity? Or would you prefer per-tool toggles?
- Are environment variables sufficient for configuration, or would you also want a config file?
- Are there other services or scopes you'd like to see supported?
Related Issues & PRs
- Gemini CLI Workspace Extension wants additional access to your Google Account #86 — Extension requests access to more services than needed
- Feature Request: Add Support for Customizable OAuth Scopes to Prevent Unintended Email Operations #111 — Customizable OAuth scopes for Gmail
- feat(tasks): add support for Google Tasks #106 — Google Tasks support (new scope)
- Feat sheets insert text #233 — Sheets write support (scope upgrade)
- feat(slides): add write tools for Google Slides #235 — Slides write tools (scope upgrade)
- fix(slides): enable reliable Slides tool usage and write operations #237 — Slides write operations fix (scope upgrade)