Autonomous and background agents should not borrow a person's credentials. Give them a dedicated identity, such as a GitHub App, a cloud service account, or an agent identity in your identity provider, with permissions sized to the task. A dedicated identity makes actions attributable and revocation clean.
Read in this order
- OfficialGitHub: Deciding when to build a GitHub AppStart here: when a GitHub App beats a personal token for automation.
- OfficialGoogle Cloud: Best practices for using service accounts securelyPractical rules for sizing and protecting cloud service accounts.
- OfficialRisks and mitigations for GitHub Copilot cloud agentAn example of limits on a real agent identity with repository access.