gh-auth-isolation

Detect and isolate the active gh CLI identity to prevent cross-account actions.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Many developers operate with an Enterprise Managed User (EMU) work account while also needing personal GitHub access for open-source contributions. AI agents 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.

Core Features & Use Cases

  • Detect active GitHub identity in the shell and report mismatches to prevent accidental cross-account actions.
  • Safely extract and switch to a personal account's credentials for operations on personal forks, repos, and PRs.
  • Isolate configurations by using separate gh config directories and provide shell aliases for quick switching.
  • Use cases include automated PRs from forks, pushing to personal repos from an EMU session, and maintaining isolation across parallel agents.

Quick Start

Login to your personal GitHub account and switch gh to a dedicated config directory before performing personal-repo operations.

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 AI agents from using my GitHub EMU account for personal repositories?

To stop AI agents from using your GitHub EMU account for personal repositories, you can use identity-aware checks to detect the active gh CLI identity and switch to isolated per-account configurations before executing personal operations.

What is the best way to manage multiple GitHub accounts with gh CLI?

The best way to manage multiple GitHub accounts with gh CLI is to isolate configurations using separate GH_CONFIG_DIRs, applying identity-aware checks to detect the active user and prevent cross-account actions in automated workflows.

Why do automated agent workflows fail when pushing to personal forks from an EMU session?

Automated agent workflows fail when pushing to personal forks from an EMU session because agents inherit the shell's default EMU authentication, lacking the permissions required for external personal repositories.

Does gh-auth-isolation support parallel agents with different GitHub identities?

Yes, isolating GitHub identities supports parallel agents by using separate gh config directories for each account, ensuring robust isolation and preventing cross-account actions across concurrent automated workflows.

How do I safely switch GitHub accounts in the shell for personal repo operations?

You can safely switch GitHub accounts in the shell for personal repo operations by extracting personal account credentials and pointing the gh CLI to a dedicated config directory via optional shell aliases.