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.

GitHub App installation tokens: the lifetime is short by design.

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.

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.

docs.github.com/en/authentication/keeping-your-account-and-data-secure/token-expiration-and-revocationdocs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-appdocs.github.com/en/organizations/managing-programmatic-access-to-your-organization/reviewing-and-revoking-personal-access-tokens-in-your-organizationdocs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokensdocs.github.com/en/rest/apps/installationsdocs.github.com/en/rest/credentials/revoke
Answered live from GitHub & Hugging Face · anthropic/claude-haiku-5.5 · 11/16/2026

Ask your own open-source question →