Repository navigation
Agent-safety features: least-privilege login, access token, introspection, confirmation gate, suggest-time - #230
Conversation
…spection, confirmation gate, suggest-time - auth login --readonly requests only read-only scopes; --add merges services into the existing authorization (incremental auth). Per-service access levels are recorded and shown by auth status, and an insufficient-scope failure on a read-only service prints the login that grants write access. (#225) - --schema and --show-scopes describe any command as JSON without running it or needing credentials. (#226) - GWS_ACCESS_TOKEN / --access-token use an externally managed access token as-is, taking precedence over the stored login and service-account modes. (#227) - Opt-in confirmation gate (GWS_CONFIRM_SENSITIVE / confirm_sensitive) for commands that send, share or delete; --yes skips it, and without a terminal the command fails closed instead of hanging. (#228) - calendar suggest-time finds free meeting slots across calendars inside working hours. (#229) Adds golang.org/x/term for terminal detection. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
…ement Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryThe PR adds read-only and incremental OAuth login, external access tokens, command introspection, and an opt-in confirmation gate. It also adds The shallow checkout hid the merge base. I verified that What looks good
Issues found
|
…kspace CLI Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryThe PR adds read-only and incremental OAuth login, external access tokens, command introspection, an opt-in confirmation gate, and The shallow checkout prevented Git from finding a merge base. I reviewed What looks good
Issues found
|
…sing, duration bound - A replacing login no longer falls back to the previous refresh token, so narrowing access (e.g. --readonly) cannot keep refreshing with the old, wider grant. Only --add may reuse it. - Confirmation gate now covers calendar update-acl and chat update-member. - --schema / --show-scopes are detected with real flag parsing on a throwaway flag set, so a flag value that reads "--schema" still runs the command, and the command's own flag state is untouched. - suggest-time rejects durations over 24h before multiplying, closing an overflow into a negative duration. - Free/busy handling is extracted into queryBusySpans with httptest coverage for the request, per-calendar errors, API errors and malformed periods. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
The consent screen lets a user untick scopes, so the access recorded at login is now checked against the token response's scope list: a full request that only received read-only scopes is recorded as read-only, and a service that received neither is dropped with a warning. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryThe PR adds read-only and incremental OAuth login, external access tokens, command introspection, and opt-in confirmation for sensitive operations. It also adds The shallow checkout had no merge base. I verified that What looks good
Issues found
|
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryPR #230 adds read-only and incremental OAuth login, externally managed access tokens, command introspection, and an opt-in confirmation gate. It also adds The shallow checkout prevented the three-dot diff from resolving. I reviewed the merge commit against its recorded first parent, which matches What looks good
Issues found
|
SummaryThis PR adds read-only and incremental OAuth login, externally managed access tokens, command introspection, and an opt-in confirmation gate. It also adds The three-dot diff failed because the checkout is shallow. I compared What looks good
Issues found
|
…ive commands by name, clear metadata on logout - Every login, including --add, must return its own refresh token. The previous one is never reused: it could carry a wider grant, lack the newly added scopes, or belong to a different account. - The confirmation gate now covers every command whose name starts with delete, trash, remove, clear, empty or batch-delete, in addition to the explicit list of send and access-changing commands. A tree-walking test keeps new destructive commands from being added ungated. - Logout removes the granted-services and granted-access metadata, and --add ignores metadata when no authorization is stored. - The read-only upgrade hint is only printed when the stored OAuth login is the credential in use (not an external token or service account). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryThe PR adds read-only and incremental OAuth login, external access tokens, command introspection, and an opt-in confirmation gate. It also adds What looks good
Issues found
The shallow checkout prevented a three-dot diff. I verified that |
…rive update --trashed - suggest-time tracks civil dates instead of stepping a local-midnight timestamp, so a DST change that skips midnight cannot shift or drop a day's working window. - Touching daily windows are merged, so with --working-hours any a slot can span midnight between two eligible days. - The confirmation gate covers `drive update --trashed`. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryThe PR adds read-only and incremental OAuth login, external access tokens, command introspection, and an opt-in confirmation gate. It also adds What looks good
Issues found
The shallow checkout prevented the three-dot diff. I compared |
…d scopes - The confirmation gate covers commands that are sensitive only when a flag is used: chat setup-space --members, calendar create --attendees, calendar update --add-attendees, and drive update --trashed, driven by one table with a test that every rule resolves and triggers. - The recorded access level follows the granted scopes in both directions, so an incremental read-only login that returns previously granted write scopes is reported as full. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryThe PR adds read-only and incremental OAuth login, external access-token support, command introspection, an opt-in confirmation gate, and What looks good
Issues found
|
…y boundaries, whole-minute durations - Access levels are derived from the complete scope set Google returned, across every service, so write scopes from an earlier grant are never hidden behind read_only: true. - Date-only --from/--to and whole-day windows use the first real instant of a civil date, so a DST change that skips midnight no longer moves the range cutoff. - --duration must be a whole number of minutes, matching what the output can represent. - The confirmation gate covers calendar rsvp --message. - Removed a stale comment about refresh-token reuse. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
…tional sensitivity in --schema, keep access metadata consistent - Workspace Events subscriptions are authorized by read scopes, so the read-only guarantee is now stated with that exception in the README, the auth skill and the --readonly help text. - --schema reports `sensitive_when` (flag and effect) for commands that need confirmation only when a flag is used. - Granted-access metadata is written atomically, and if recording it fails after a login both metadata files are removed rather than left describing the previous token. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryThe PR adds read-only and incremental OAuth login, external access tokens, command introspection, and an opt-in confirmation gate. It also adds The requested three-dot diff failed because the checkout had no visible merge base. I compared What looks good
Issues found
|
SummaryThe PR adds read-only and incremental OAuth login, external access-token support, command introspection, opt-in confirmation for sensitive operations, and What looks good
Issues found
|
…resh-token docs - Flag-conditional gate rules judge a flag by its type, so an RSVP message of "false" or "[]" still requires confirmation. - A service that holds some write scopes but not the full set is recorded as "partial" and never as read-only, so read_only: true means no write scope was granted anywhere. - The auth skill's token-management notes describe the new refresh-token behaviour. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
…oundaries out of DST gaps - A service's full and read-only scope sets are compared by membership rather than length, so a previously granted `spreadsheets` scope is recorded as full Sheets access. - Working-hour and day boundaries that fall in a spring-forward gap move forward to the first real instant, so a suggestion can never start before the requested lower bound. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryThe PR adds read-only and incremental OAuth login, external access tokens, command introspection, an opt-in confirmation gate, and What looks good
Issues found
|
SummaryThe PR adds read-only and incremental OAuth login, external access tokens, command introspection, and an opt-in confirmation gate. It also adds What looks good
Issues found
Both three-dot diff attempts failed because the checkout is shallow. I compared the PR merge commit’s tree against |
…s, gate Drive approval requests - suggest-time works in whole seconds end to end: the range is shrunk inward and busy periods widened outward, so the free/busy query, the slot calculation and the RFC3339 output always agree. - auth login --add requires a service selection, so it cannot fall back to requesting full access to every service. - The confirmation gate covers drive start-approval and reassign-approval. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryPR #230 adds read-only and incremental OAuth login, external access tokens, command introspection, and an opt-in confirmation prompt for sensitive actions. It also adds What looks good
Issues found
The shallow checkout had no merge base, so I reviewed the diff from the PR merge commit’s verified first parent, |
…al read grants - The granted-access record carries a fingerprint of the refresh token it describes and is ignored unless it matches the stored token, so metadata left by an interrupted or concurrent login can never describe a different grant. - A requested service that received only some of its read scopes is recorded as partial-readonly, so the scope hint still fires for it; the login as a whole still counts as read-only. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryThe PR adds read-only and incremental OAuth login, external access tokens, command introspection, and an opt-in confirmation gate. It also adds What looks good
Issues found
The shallow checkout prevented the three-dot diff. I reviewed the diff from |
…guous times, token-bound service list - A blank --services value (`--services=`, `--services ,`) is no selection: --add rejects it, and it never widens a login to every service. - civilInstant explicitly returns the first occurrence of a wall-clock time repeated by a fall-back change, so a working-hours end in the repeated hour cannot extend the window. - The scope-warning service list is read from the token-bound access record when one exists. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
…isclaimer New title and intro, install above the fold, a comparison with Google's gwscli and googleworkspace/cli, a note on the shared gws binary name, and a Disclaimer section. Command documentation, flags and the license notice are unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryPR #230 adds read-only and incremental OAuth login, external access-token support, command introspection, an opt-in confirmation gate, and What looks good
Issues found
The shallow merge checkout had no merge base with |
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryThe PR adds read-only and incremental OAuth login, external access tokens, command introspection, and an opt-in confirmation gate. It also adds What looks good
Issues found
The shallow checkout prevented the three-dot diff. I verified that |
…jected token auth logout acts on the stored login and now refuses to run while an external access token is in use. auth status reports authenticated: false when Google rejects the stored token with 401. The skill's --show-scopes note matches the README. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryThe PR adds read-only and incremental OAuth login, external access tokens, serialized token refresh, command introspection, and an opt-in confirmation gate. It also adds What looks good
Issues found
|
…ill wording civilInstant now finds the first occurrence of a local time even when the repeated stretch is nearly a day long (Kwajalein, 1969). The auth skill's quick reference describes --show-scopes accurately. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryThis PR adds read-only and incremental OAuth login, external access tokens, command introspection, and an opt-in confirmation gate. It also adds What looks good
Issues found
The shallow checkout prevented the three-dot diff. I verified that |
…on its dates If the config file exists but cannot be loaded, sensitive commands are refused unless the policy is set in the environment or --yes is given, so a broken file cannot silently switch the confirmation gate off. With a date-only --to, no slot falls on a later date even where that date begins before the end of the requested day. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryThe PR adds What looks good
Issues found
The shallow checkout prevented the three-dot diff. I used |
GWS_CONFIRM_SENSITIVE and confirm_sensitive accept only unambiguous on/off values. Anything else (a typo, an empty override) leaves the policy unknown: sensitive commands are refused until it is corrected or --yes is given, and the gate itself treats it as on. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryThe PR adds What looks good
Issues found
The shallow checkout prevented the requested three-dot diff. I compared |
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryThe PR adds Calendar meeting-time suggestions, external OAuth access tokens, incremental and read-only login, command introspection, and an opt-in confirmation gate. It also changes how OAuth refreshes and grant metadata are persisted. What looks good
Issues found
I reviewed the diff from |
…gate approval messages confirm_sensitive written with no value (or null) is now detected in the config file itself and leaves the policy unknown, so sensitive commands are refused. drive approve, decline and cancel-approval need confirmation when they carry a --message. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryThe PR adds What looks good
Issues found
|
The setting comes from viper's own snapshot (YAML, TOML or JSON); the YAML file is consulted directly only to tell an empty key from an absent one. A TOML or JSON config that enables the gate is honoured again. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryThe PR adds What looks good
Issues found
The three-dot diff failed because the shallow checkout had no merge base. I reviewed the diff between |
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryThis PR adds What looks good
Issues found
The shallow checkout had no merge base. I compared |
… once Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryThe PR adds What looks good
Issues found
The shallow checkout had no merge base. I reviewed |
A marker written under the OS lock can only belong to a process that no longer holds it, so the next holder replaces it immediately instead of waiting for it to go stale. README: --readonly follows a configured services list. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh
SummaryPR #230 adds What looks good
Issues found
|
Summary
Five features prompted by a comparison with Google's official
gwscli, plus a README positioning update. No version bump here — that goes in the release PR.gws auth login --readonlyrequests only read-only scopes;--add --services Xextends the existing authorization instead of replacing it (same account required, previous scopes re-requested and verified, unrequested scopes rejected). Per-service access levels (full,readonly,partial,partial-readonly) are recorded ingranted_access.json, bound to the stored token, and shown byauth status. Insufficient-scope errors carry a hint naming the login that grants the missing access.--schemaand--show-scopesprint JSON describing a command and exit. They call no Google API and need no credentials.--schemareportssensitive/sensitive_whenfor the confirmation gate. Scope output is per service, not per command.GWS_ACCESS_TOKEN/--access-tokenare used as-is (no refresh, nothing stored, never printed) and take precedence over the stored login and the service-account modes. Read only from the flag and the environment, never the config file.GWS_CONFIRM_SENSITIVE/confirm_sensitive. Commands that send, share, delete or destroy data prompt on stderr and show the invocation;--yesskips the prompt; without a terminal the command fails closed withconfirmation required. Off by default, so existing automation is unchanged.gws calendar suggest-time(closes feat(calendar): suggest-time — find free meeting slots across calendars #229) — finds free windows across calendars and attendees inside working hours, built on the free/busy query. Unreadable calendars fail the command unless--allow-partialis given.gwscliandgoogleworkspace/cli, and a Disclaimer section. Existing command documentation and the license notice are unchanged.Behaviour changes to review
flock/LockFileExlock on a.flockfile, held for the whole operation; the.lockfile older versions understand is still created and honoured, so mixed versions exclude each other. Other platforms keep the lock-file scheme and now report a stale lock instead of removing it. The Windows path is compiled but was not run.auth logoutreturns"revoked": trueonly when Google confirmed the revocation, otherwise"revoked": falsewith instructions; local credentials are removed either way.versionand completion), never a fallback to the stored login. A blankGWS_ACCESS_TOKEN=in a shell profile must be unset.chat build-cache,chat find-groupandchat find-spacerefuse to run,chat membersskips its name cache and enrichment, andgws hooksadds no Workspace context.spreadsheets.readonly,drive.metadata.readonly, the Chat*.readonlyset andcalendar.acls.readonly.PersistentPreRunbecamePersistentPreRunE(required-flag validation, the empty-token check and the gate run there).auth.AllScopes, exactly as before.golang.org/x/termv0.44.0 andgolang.org/x/sysv0.46.0, both already in the module graph; the Go 1.25 toolchain requirement is unchanged.Testing
go vet ./...,go test ./...andgolangci-lint runpass; cross-compiles for linux, darwin, windows and solaris.--readonly/--addconsent flow (including whether Google acceptscalendar.acls.readonly), andsuggest-timeagainst real free/busy data.Review notes
calendar suggest-time" was declined as not reproducible; see the PR comment andTestQueryBusySpans_NullEntriesDoNotPanic.Skills
skills/authandskills/calendar(SKILL.md andreferences/commands.md) are updated, with the Codex mirrors re-synced.🤖 Generated with Claude Code
https://claude.ai/code/session_016GB34RWVbYYwb6ihVx6xzh