

- A classic personal access token functions like a master key for every resource the token owner can access.
- They are simple and powerful, but if leaked they can expose all repositories and resources visible to the user.

- When a developer grants the
reposcope to a classic PAT, that token is authorized for all repositories the user can see across the enterprise — you cannot limit it to a single project. - Classic PATs can also be created with “No expiration”. If compromised, they remain valid until explicitly revoked.

- Actions executed with a classic PAT are recorded in audit logs as if the user performed them directly. This can obscure whether an action was performed by the user or by code running with the user’s token, complicating investigations.

- Fine-grained personal access tokens are designed to minimize risk with explicit repository targeting and per-repository permissions. They are closer to role-scoped credentials than master keys.
- When you create a fine-grained PAT you must select which repositories it can access — there is no implicit global repo access.

- Fine-grained tokens let you set specific permissions per repository (for example: Issues = read-only, Pull requests = write). This supports the principle of least privilege.

- Fine-grained PATs require an expiration date; they cannot live forever. This limits the window of exposure if a token is compromised.

Organization owners can enforce policies that require administrator approval for fine-grained personal access tokens, ensuring tokens undergo review before accessing organization resources.
Best practices and recommendations
- Prefer fine-grained personal access tokens for new integrations and automations to minimize blast radius through scoped access and mandatory expiration.
- Enforce admin approval and organization-level policies where possible for tokens that access org resources.
- Rotate tokens regularly and treat tokens like secrets: store them in a secrets manager and avoid hard-coding them in source.
- Use audit logs to detect anomalous token activity and revoke compromised tokens immediately.
Tokens with no expiry or overly broad scopes are high-risk. Revoke or rotate any unmonitored classic tokens and migrate integrations to fine-grained personal access tokens where feasible.
- Classic PATs provide broad, user-scoped access and can be non-expiring — they behave like master keys.
- Fine-grained PATs restrict access to specific repositories, allow per-repo permissions, mandate expiration, and can be subject to admin approval — they enable least-privilege, auditable access.