gh-auth-isolation

Isolate GitHub identities by checking active accounts and retrieving per-user tokens.

Updated Apr 3, 2026
One-click install
npx skills add https://github.com/sachinnair90/gitgloss --skill gh-auth-isolation-sachinnair90
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gh-auth-isolation
Source: https://github.com/sachinnair90/gitgloss/tree/main/.copilot/skills/gh-auth-isolation
Command: npx skills add https://github.com/sachinnair90/gitgloss --skill gh-auth-isolation-sachinnair90

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents GitHub identity mix-ups when an agent works with both enterprise managed and personal accounts, avoiding failed pushes, broken pull requests, and accidental credential leakage.

Core Features & Use Cases

  • Identity Detection: Checks which GitHub account is currently active before any authenticated action.
  • Safe Token Selection: Retrieves a per-user token at runtime so the agent can act as the intended identity without switching global auth.
  • Scoped GitHub Operations: Supports pushing to personal repositories, creating pull requests from forks, and cloning or managing repos under the correct account.
  • Isolation Strategies: Uses temporary environment variables or separate GH_CONFIG_DIR values to keep EMU and personal workflows independent.
  • Use Case: A developer with a work EMU account needs an agent to push to a personal repository and open a PR from a fork without disrupting the default enterprise login.

Quick Start

Ask the skill to verify your active GitHub account and then perform the requested repository action using the correct identity without persisting credentials.

Frequently Asked Questions about gh-auth-isolation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stop GitHub CLI from using my enterprise account for personal repository pushes?

To stop GitHub CLI from using your enterprise account, you need GitHub identity isolation. This Skill enforces active identity checks and uses isolated GH_CONFIG_DIR values to keep enterprise managed user and personal credentials separate during pushes.

What is the best way to manage multiple GitHub accounts when automating pull requests from forks?

The best way to manage multiple GitHub accounts for pull requests is through per-user token retrieval. This Skill fetches the correct token at runtime and applies temporary environment variables so the agent acts as the intended identity without switching global auth.

Does this approach require switching my global GitHub CLI configuration to open a pull request?

No, this approach does not require switching your global GitHub CLI configuration. It uses temporary environment variables and isolated configuration directories to perform actions like opening pull requests without persisting credentials or disrupting your default enterprise login.

Why do my automated GitHub pushes fail when I have both EMU and personal tokens configured?

Automated GitHub pushes fail due to account mix-ups when both EMU and personal tokens are configured. This Skill prevents these failures by verifying the active GitHub account before any action and safely selecting the correct per-user token.

Can I use this to isolate credentials for cloning repositories under a specific GitHub identity?

Yes, you can use this to isolate credentials for cloning repositories. It supports scoped GitHub operations by applying isolation strategies like separate configuration directories, ensuring repositories are managed under the correct account without credential leakage.