Repolock allows you to limit your coding agents' GitHub access to just one repo. It lets you store many single-repo access tokens and easily switch between them, using the gh CLI for login and logout.
Coding agents run gh with whatever login it has. A normal gh auth login
gives them every repository you can reach, so one wrong command or one
prompt injection can modify (or delete) them. A single-repo
token potentially narrows disaster to just that repo.
Requires macOS 15, Swift 6, and GitHub CLI.
./install.sh
The first run will ask you to choose a certificate to sign with, or none, and will remember your choice.
Signing with a certificate lets macOS remember your permission for repolock to read a token across reinstalls. Otherwise repolock will ask for access to Keychain after every reinstall.
Run repolock for the picker, or:
repolock add
repolock switch <nickname>
repolock remove <nickname>
Scope your tokens as narrowly as you can. Repolock won't check.
Create a fine-grained token at https://github.com/settings/personal-access-tokens/new. Under "Repository access" choose "Only select repositories" and pick one repo, then grant the permissions your agent needs.
MIT. See LICENSE.