kubefleet-dev/kubefleet/gh-auth-isolation
- community
Checking that the SKILL.md file is still in the repository.
Safely manage multiple GitHub identities (EMU + personal) in agent workflows
Install
npx vskill@latest install kubefleet-dev/kubefleet/gh-auth-isolationSKILL.md
Context
Many developers use GitHub through an Enterprise Managed User (EMU) account at work while maintaining a personal GitHub account for open-source contributions. AI agents spawned by Squad inherit the shell's default gh authentication — which is usually the EMU account. This causes failures when agents try to push to personal repos, create PRs on forks, or interact with resources outside the enterprise org.
This skill teaches agents how to detect the active identity, switch contexts safely, and avoid mixing credentials across operations.
Patterns
Detect Current Identity
Before any GitHub operation, check which account is active:
Look for:
Logged in to github.com as USERNAME— the active accountToken scopes: ...— what permissions are available- Multiple accounts will show separate entries
Extract a Specific Account's Token
When you need to operate as a specific user (not the default):
Use case: Push to a personal fork while the default gh auth is the EMU account.
Push to Personal Repos from EMU Shell
The most common scenario: your shell defaults to the EMU account, but you need to push to a personal GitHub repo.
Why this works: gh auth token --user reads from gh's credential store without switching the active account. The token is used inline for a single operation and never persisted.
Create PRs on Personal Forks
When the default gh context is EMU but you need to create a PR from a personal fork:
Config Directory Isolation (Advanced)
For complete isolation between accounts, use separate gh config directories:
Setup (one-time):
Shell Aliases for Quick Switching
Add to your shell profile for convenience:
Examples
✓ Correct: Agent pushes blog post to personal GitHub Pages
✓ Correct: Agent creates a PR from personal fork to upstream
✗ Incorrect: Blindly pushing with wrong account
✓ Correct: Check before you push
Anti-Patterns
- ❌ Hardcoding tokens in scripts, environment variables, or committed files. Use
gh auth token --userto extract at runtime. - ❌ Assuming the default `gh` auth works for all repos. EMU accounts can't access personal repos and vice versa.
- ❌ Switching `gh auth login` globally mid-session. This changes the default for ALL processes and can break parallel agents.
- ❌ Storing personal tokens in `.env` or
.squad/files. These get committed by Scribe. Usegh's credential store. - ❌ Ignoring token cleanup after inline HTTPS pushes. Always reset the remote URL to avoid persisting tokens.
- ❌ Using `gh auth switch` in multi-agent sessions. One agent switching affects all others sharing the shell.
- ❌ Mixing EMU and personal operations in the same git clone. Use separate clones or explicit remote URLs per operation.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.squad/templates/skills/gh-auth-isolation/SKILL.md
Popularity
- Repository stars
- 151
- Repository forks
- 27
- 7-day trend score
- 25
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kubefleet-dev/kubefleet/gh-auth-isolation)