Analysis GitHub

4 min read · Dec 5, 2026

8-Hour Tokens, No Opt-Out: What GitHub's January 5, 2027 Rule Changes

Any GitHub App or OAuth app registered on or after January 5, 2027 receives user access tokens that expire after 8 hours with no registration opt-out. Pre-existing apps and already-issued tokens stay untouched, placing refresh-flow work squarely on new integrations.

4 min read Checked Dec 5, 2026 5 primary sources

Policy rules and effective dates come from GitHub's December 4, 2026 changelog notice and official GitHub Docs. Hours, days, and monthly refresh counts are converted directly from GitHub's documented second values.

GitHub changelog banner for mandatory expiring user access tokens on new GitHub Apps and OAuth apps
Image: GitHub PRIMARY VISUAL

The short version

VERDICT // SUMMARY

GitHub's January 5, 2027 rule has a crisp boundary: zero opt-out and zero grace period for GitHub Apps or OAuth apps registered on or after that date (GitHub.com and GHE.com), and zero forced changes for pre-existing apps, legacy issued tokens, or personal access tokens. Teams launching new CLIs, AI agents, or web integrations must persist both rotating access tokens (8-hour lifetime) and refresh tokens (184-day lifetime), and should test the flow now using the offline_access scope.

KEY NUMBERS // VERIFIED READOUT 4 METRICS AUDITED
  • Access token life

    8 hours

    Mandatory 28,800-second ghu_ token expiry for apps registered from Jan 5, 2027.

    GitHub Changelog, Dec 4

  • Refresh token life

    184 days

    ghr_ refresh tokens live 15,897,600 seconds (~6 months) and rotate on every swap.

    GitHub Docs

  • Continuous refreshes

    3x / day

    Always-on agents and CLIs must refresh at least 90 times per 30-day month.

    24h / 8h calculation

  • Legacy apps & PATs

    Untouched

    Pre-Jan 5 apps keep non-expiring tokens indefinitely unless owners opt in and revoke.

    GitHub Changelog, Dec 4

What changes on January 5, 2027, and what stays untouched?

GitHub’s December 4, 2026 notice draws a hard line at registration date across both GitHub.com and GHE.com, leaving existing apps unaffected.

Policy item Through January 4, 2027 Starting January 5, 2027
New GitHub App or OAuth app user token expiry Enabled by default with registration opt-out Always enforced, zero opt-out
Apps registered before January 5, 2027 Retain existing app setting Unchanged; no forced migration announced
Previously issued user tokens Valid under original terms Unaffected
Platform coverage GitHub.com and GHE.com GitHub.com and GHE.com

How do GitHub’s token lifetimes compare in seconds and plain units?

Token type Prefix Documented lifetime Plain units Continuous 30-day refreshes
GitHub App installation token ghs_ 3,600 seconds 1 hour 720 refreshes
Expiring user access token ghu_ 28,800 seconds 8 hours 90 refreshes
User refresh token ghr_ 15,897,600 seconds 184 days (“six months”) Rotated every access refresh
Legacy non-expiring user token ghu_ or gho_ Indefinite Valid until revoked 0 refreshes

An always-on daemon or autonomous coding agent refreshes an expiring user token up to three times per day (24 / 8 = 3). Limiting ghu_ access tokens to 8 hours caps blast radius after a leak, yet shifts high-value security protection onto ghr_ refresh tokens that can mint fresh access tokens for up to 184 days. Note one wording split in GitHub’s documentation: OAuth docs describe the refresh ceiling as “six months without use,” while GitHub App docs state six months flat.

What exact HTTP refresh flow must new apps implement?

Implementation detail Required behavior
Endpoint POST https://github.com/login/oauth/access_token
Request parameters client_id, client_secret (omitted for device-flow tokens), grant_type=refresh_token, refresh_token
Response payload Fresh access_token, fresh refresh_token, expires_in, and refresh_token_expires_in
When refresh token expires Prompt user to sign in again through web flow or device flow
Pre-testing before Jan 5 Request the offline_access scope on an existing app to receive expiring access and refresh tokens immediately

Every refresh response rotates the refresh token itself. Integrations must atomically store both the new access_token and the new refresh_token, never overwriting only the access token.

Who needs to take action before January 5, 2027?

Developer scenario Required next step
Registering a new app on or after Jan 5 Verify auth code and SDK libraries handle token refresh before registration (GitHub’s explicit guidance)
Maintaining an existing non-expiring app No mandatory work; opt in voluntarily via “User-to-server token expiration” in app settings
Opting an existing app in Old non-expiring tokens remain live until revoked via DELETE /applications/CLIENT_ID/token or user re-login
Running long-lived CLIs or AI coding agents Encrypt refresh-token storage and automate 8-hour token rotation for unattended runs
Using personal access tokens (PATs) only Unaffected; GitHub’s announcement covers GitHub Apps and OAuth apps strictly

Developer teams auditing agent workflows and local tooling can compare coding model speeds on the Benchmarks Leaderboard, track dev hardware prices on Hot Deals, or configure a local AI workstation in the PC and Local AI Builder.

The verdict

  • Teams launching new GitHub Apps, OAuth apps, CLIs, or AI agents in 2027: Test refresh-token persistence now using offline_access so users and unattended jobs do not hit sudden 8-hour sign-outs starting January 5.
  • Maintainers of pre-2027 integrations: Nothing breaks automatically on January 5, though opting in and revoking old gho_/ghu_ tokens removes indefinite credential exposure.
  • Personal access token users: No change required from this policy update.

The catch: Legacy apps retain non-expiring user tokens that GitHub itself warns remain exploitable indefinitely if leaked; the security upgrade only reaches existing apps whose owners manually opt in and revoke legacy tokens.

Quick answers

Does GitHub’s January 5, 2027 rule break existing GitHub Apps or OAuth apps?

No. Apps registered before January 5, 2027 keep their current token expiration setting, and already-issued tokens remain valid with no forced switch announced.

How long do new GitHub user access tokens and refresh tokens last?

Expiring user access tokens (ghu_) live 28,800 seconds (8 hours), and refresh tokens (ghr_) live 15,897,600 seconds (184 days, described by GitHub as six months).

How can developers test the 8-hour token refresh flow before January 5, 2027?

Request the offline_access scope from an existing app to receive expiring access and refresh tokens, then confirm the app persists both the new access_token and rotated refresh_token returned by POST https://github.com/login/oauth/access_token.

Are GitHub personal access tokens affected by the January 5, 2027 rule?

No. GitHub’s December 4, 2026 changelog notice applies strictly to newly registered GitHub Apps and OAuth apps on GitHub.com and GHE.com.

LIVE DESK // BENCHMARQUE TOOLS

Track live street prices in the Hardware Market, check Hot Deals, or compare configurations in the PC and Local AI Builder and Benchmarks Leaderboard.

Sources & Primary Filings

5 cited
  1. GitHub Changelog: New GitHub Apps and OAuth apps require expiring user tokens (Dec 4, 2026) blog.github.com
  2. GitHub Docs: Refreshing user access tokens docs.github.com
  3. GitHub Docs: Authorizing OAuth apps, expiring access tokens docs.github.com
  4. GitHub Docs: Generating an installation access token for a GitHub App docs.github.com
  5. GitHub Blog: Behind GitHub's new authentication token formats (token prefixes) blog.github.com

The Monday Hardware & AI Briefing

Verified street-price drops, buy-or-wait signals, and reproducible benchmark tables every Monday morning. Zero popups, one-click unsubscribe.

Reader focus

Sponsor a benchmark series or hardware briefing on The Benchmarque. View media kit and sponsorship options.