answered from live GitHub & Hugging Face data
What are the differences in revocation policies between fine-grained PATs and GitHub App tokens for AI coding agents?
Common assumption: a revoked token stops working everywhere at once. The docs show that is not true for either token type. A fine-grained PAT lives until its owner or an org owner revokes it. A GitHub App installation token lasts one hour and can be revoked on the spot.
Revocation comparison
| Control | Fine-grained PAT | GitHub App installation token | GitHub App user access token |
|---|---|---|---|
| Default lifetime | Set by the creator at creation. Infinite lifetimes are allowed unless an org or enterprise sets a maximum lifetime policy. | 1 hour, fixed | 8 hours by default. Refresh token renews it. |
| Who can revoke | The creator. Org owners can revoke it in the org UI or by API. | The app that holds it, by calling DELETE /installation/token. |
The user, from account settings. Revoking the app authorization also revokes its tokens. |
| Scope of revocation | One token. | One token. Other tokens stay valid. | All tokens tied to the user's authorization of the app. |
| Automatic expiry | At the set expiry date. Unused for one year, it is removed. | After 1 hour. | After 8 hours, unless the app sets no expiry, which the docs advise against. |
| Revoked by leak detection | Yes. Pushing to a public repo or gist revokes it. | Yes, same rule for GitHub App tokens. | Yes, same rule. |
| Enterprise response | Org owners can revoke fine-grained PATs. Classic PATs can only be limited by policy. | Not listed on the enterprise revocation page I read. | Enterprise owners can revoke SSO authorizations or delete credentials. |
What the evidence says
Fine-grained PATs: the revocation burden sits with people.
- Revocation is manual or by expiry. The token has no built-in short life unless you set one.
- Org owners can review and revoke fine-grained PATs. Revocation does not remove SSH keys the token created. Those keys keep working. Reviewing and revoking PATs in your organization
- The token is tied to the user who created it. It becomes inactive if that user loses access. Managing your personal access tokens
GitHub App installation tokens: the lifetime is short by design.
- Each token expires after 1 hour. Generating an installation access token
- The app can revoke the token it uses with
DELETE /installation/token. Other tokens keep working. REST API for installations - The token can be limited to specific repositories and permissions when it is created. Generating an installation access token
Gap to plan for: The third-party credential revocation API lists ghp_, github_pat_, gho_, ghu_ and ghr_ tokens. It does not list installation tokens (ghs_). Revocation API A leaked installation token therefore relies on its one-hour life. I did not check how an app's installation itself is suspended or removed.
Recommendation
For AI coding agents, use a GitHub App. Its tokens expire in one hour and can be revoked at once. A fine-grained PAT is valid until its expiry date. Any agent that holds one can act for that whole period.
- Choose a fine-grained PAT if you run one agent, you act as yourself, and you accept manual rotation.
- Choose a GitHub App if you run more than one agent, or if agents run unattended. Limit each token to one repository and the permissions it needs.
I could not check whether any single agent-identity tool applies these limits by default. githug gives each agent its own key. That key mints GitHub tokens that last one hour and work on one repository, through a GitHub App. This matches the short-lived pattern above.