Repository navigation
Description
Describe the feature or problem you’d like to solve
For security reasons and In corporates especially, it is very important to access the gh token in a secured way
We work with 1Password for keeping all secrets, including gh auth token
This way it is not possible to get the token freely when it is saved in the keychain, and any plugin of VScode or any code running on the machine can get it.
We tested it: we already wrote a "malicious" plugin in VS Code that freely ran gh auth token, stole it and stole all the code available, and even pushed the malicious code to where possible in PRs
This way, IMHO all code of the GitHub itself was stolen and many other companies and open-source projects' code.
We must assume that the attacker is already on our computer, and protect all we have before it can make problems, and until the threat is deleted
That is why we moved to 1Password, and nothing, absolutely nothing, is kept in the way it can be easily accessed, like: gh auth token, that can be ran from any place by an attacker (for cli, vs code, whatever)
The gh token rotation is good, very good, we waited for it
Now if the token is stolen and copied to another computer, that time till expire it.
But it is not enough protection in our days
Keeping the token, even rotated, in free accessible way in the keyring; or keychain, with "gh auth token" extracted from anywhere, is not acceptable in our days and of course, not in security companies or big enterprises that use GitHub
Proposed solution
We already starting using 1Password: gh auth login --op
As an additional way to keep token, in addition to keychain, keyrign and windows store
#14908
Rotated token is saved in 1Password, and all operations I do
gh copilot
gh pr
git push
vim copilot
Asks me to get the token from 1Password with fingerprint protection
How will it benefit CLI and its users?
It will protect the best way each CLI users from any possible attack, even on their computers
Activity
cli-triage commentedon Nov 5, 2026
Thanks for the detailed writeup. This reads as a feature request rather than a bug, so I'm suggesting
enhancement+gh-authfor maintainer review.On investigation:
ghalready stores tokens via the OS-native secret store (macOS Keychain, Windows Credential Manager, Linux Secret Service/keyring) through thezalando/go-keyringwrapper used ininternal/config(e.g.keyring.Get/keyring.Setcalls ininternal/config/config.go, falling back to plaintext config only when secure storage is unavailable or explicitly disabled. The request here is to add 1Password (or similar secret managers) as an alternative/additional backend with its own unlock/biometric gate, which is a materially different mechanism than what's currently supported — I didn't find an existing issue requesting 1Password support specifically, so this doesn't look like a duplicate, though it's related in spirit to concerns about plaintext token storage raised in #8954 and #13872, and to the storage documentation gap in #1773.The issue also references #14908, which appears to already propose an implementation (
gh auth login --op) — worth cross-referencing when scoping this. No reproduction steps are needed since this is a proposal rather than a bug; a maintainer will need to weigh the design tradeoffs (new dependency, UX for the 1Password CLI integration, Enterprise/offline support) before deciding on scope.github-actions commentedon Nov 5, 2026
Thank you for your issue! We have categorized it as an enhancement (feature or improvement) request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.
Unless you see the help wantedContributions welcome
label, we are not currently looking for external contributions for this feature.
If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.
jayganeshdevelopers100100-spec commentedon Nov 5, 2026