Repository navigation
Agent Safety: Least-Privilege Login, External Tokens, Introspection, Confirmation Gate, Suggest-Time
- Least-privilege login (#225):
gws auth login --readonlyrequests only read-only scopes, and--add --services Xextends the stored authorization instead of replacing it (same account required; previously granted scopes are re-requested and verified).gws auth statusreports per-service access (full,readonly,partial,partial-readonly). Insufficient-scope errors carry a hint naming the login that grants the missing access. - Introspection (#226): global
--schemaand--show-scopesprint JSON describing a command (flags, subcommands, whether the confirmation gate covers it, the scopesgws auth loginrequests for its service) and exit without calling any API or needing credentials. - External access token (#227):
GWS_ACCESS_TOKEN/--access-tokensupply an externally managed OAuth token, used as-is (no refresh, nothing stored). A supplied-but-empty token is an error, never a fallback to the stored login. While one is set, the Chat space-cache commands andauth logoutrefuse to run,chat membersskips its name cache, and session hooks add no Workspace context. - Confirmation gate (#228): opt-in via
GWS_CONFIRM_SENSITIVE/confirm_sensitive. Commands that send, share, delete or destroy data show the invocation and ask before running;--yesskips the prompt; without a terminal they fail withconfirmation required. A setting that cannot be understood, or a config file that cannot be loaded, stops sensitive commands rather than switching the gate off. Off by default. gws calendar suggest-time(#229): finds free meeting slots across calendars and attendees inside working hours. Unreadable calendars fail the command unless--allow-partialis given.- Token refresh and locking: refreshes of the stored login are serialized across processes with an OS-held lock (
flock/LockFileEx), including refresh-token rotation; older gws versions sharing the config directory are still excluded through the existing.lockfile. An expired token is no longer refreshed when the lock cannot be taken (for example a read-only config directory): the command fails with a message saying so. gws auth logoutreturns"revoked": trueonly when Google confirmed the revocation, and"revoked": falsewith instructions otherwise.gws auth statusreports a token Google rejects as not authenticated.- README: retitled as the unofficial Go CLI for Google Workspace, with a comparison against Google's
gwscliandgoogleworkspace/cliand a Disclaimer section. - New direct dependencies
golang.org/x/termandgolang.org/x/sys(both already in the module graph). - All of the above shipped in #230.
Upgrade notes
- A blank
GWS_ACCESS_TOKEN=in a shell profile now makes commands fail with a "set but empty" error until it is unset. Not affected:gws version, shell completion,--help, and the--schema/--show-scopesintrospection flags, which are answered before the check. - With a malformed
config.yaml, sensitive commands are refused until the file is fixed,GWS_CONFIRM_SENSITIVEis set, or--yesis given. - Upgrade every gws binary that shares a config directory: the refresh guarantee holds only between copies of this version or later.