Use case
Give an agent its own Git identity
Create a dedicated role for an agent, give it its own SSH key and GitHub host alias, and use gitrole to keep automated commits and pushes separate from human identities.
When to use this
Use this page when you want an agent to work with its own Git identity instead of acting as your personal or work account.
This is useful when you want:
- automated commits to be clearly separate from human commits
- a dedicated GitHub account for an agent
- a repeatable repository setup for automation
- to avoid mixing your own account with machine-driven work
How it works
A dedicated agent role gives the automation its own:
- commit name
- commit email
- SSH key
- GitHub account
- GitHub SSH host alias
That means the repository can clearly distinguish:
- human-authored work
- agent-authored work
Create the agent role
Start by creating a role for the agent:
gitrole add agent \
--name "Acme Build Agent" \
--email "build-agent@acme.example" \
--ssh ~/.ssh/id_ed25519_agent \
--github-user acme-build-agent \
--github-host github.com-acme-build-agent
Switch the repo to the agent role
Use the role locally when this repository should use the agent identity:
gitrole use agent --local
If the remote should also use the agent's SSH host alias, update it too:
gitrole remote set agent
Check that it worked
Run:
gitrole status
Use status for the fast daily check.
If something looks wrong, run:
gitrole doctor
Use doctor when you need the full explanation for the repository, remote, or SSH auth setup.
Why this is useful
This setup makes automation easier to reason about:
- agent commits are visibly separate from human commits
- SSH pushes use the agent account instead of your personal account
- repository-local overrides keep the agent identity contained to the repositories that need it
That gives you a cleaner boundary between human work and machine-driven work.