- Clear attribution
- Preventing (accidental) destructive actions
- Enforcing review flow, e.g. preventing AI from merging into
mainwhile allowing humans

Setup Overview
- Create a GitHub account for your agent (e.g.,
username-agent) - Generate a Classic GitHub token
- Configure Git to use the agent identity
- Configure Git credentials to use the token
Step 1: Create Agent GitHub Account
Create a separate GitHub account for your agent:- Sign up at github.com/signup
- Use a distinctive username (e.g.,
yourname-agent,yourname-ai) - Use a separate email (GitHub allows plus-addressing:
yourname+ai@example.com)
This is optional but recommended. You can also use your main account with a different email/name.
Step 2: Generate Classic GitHub Token
Classic tokens are easier to configure than fine-grained tokens for repository access.- Log into your agent GitHub account
- Go to Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click “Generate new token (classic)”
- Configure the token:
- Note: “mux agent token” (or similar)
- Expiration: Choose based on your security preferences
- Scopes: Select
repo(Full control of private repositories)
- Click “Generate token”
- Copy the token immediately - you won’t see it again
Step 3: Configure Git Identity
Add the Git identity environment variables as Project Secrets in mux:- Open mux and find your project in the sidebar
- Click the 🔑 key icon to open the secrets modal
- Add the following four secrets:
GIT_AUTHOR_NAME=Your Name (Agent)GIT_AUTHOR_EMAIL=yourname+ai@example.comGIT_COMMITTER_NAME=Your Name (Agent)GIT_COMMITTER_EMAIL=yourname+ai@example.com
- Click “Save”
If you need the agent identity outside of mux, you can alternatively set these as global
environment variables in your shell configuration (
~/.zshrc, ~/.bashrc, etc.)Step 4: Configure GitHub Authentication
Install GitHub CLI
If you don’t have it:Configure Git Credential Helper
Set up Git to use the GitHub CLI for authentication. The recommended approach is to usegh auth setup-git, which scopes the credential helper to GitHub only:
gh for GitHub authentication while preserving your existing credential helpers for other Git hosts.
Alternative: Manual configuration (for advanced users)
If you need more control or want to completely replace existing credential helpers:
Alternative: Co-Author Attribution
If you prefer to keep using your personal GitHub account but still want clear attribution for AI-generated commits, you can add aCo-authored-by trailer to commits.
The simplest approach is to ask the agent via system prompt to include a Co-authored-by: AI Assistant <ai@example.com> trailer in commit messages. This works well in practice since agents generally follow formatting instructions reliably.
For guaranteed attribution, you can use Git’s built-in hooks instead:
Using a Git Hook
Create aprepare-commit-msg hook that adds co-author attribution only when running inside mux:
This approach uses your normal Git identity for commits, but adds a trailer indicating AI
involvement. The hook only activates inside mux workspaces (detected via
MUX_RUNTIME).Comparison
| Approach | Pros | Cons |
|---|---|---|
| Separate account | Full separation, branch protection rules | Requires second GitHub account |
| Co-authored-by hook | Single account, clear attribution | Less separation, hook per-repo |