8-Hour Tokens, No Opt-Out: What GitHub's January 5, 2027 Rule Changes
- Get link
- X
- Other Apps
AI · Analysis
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.
By The Benchmarque Staff · · Updated Dec 6, 2026 · 4 min read
Policy rules and effective dates come from GitHub's December 4, 2026 changelog announcement and official GitHub Docs. Hours, days, and 30-day refresh counts are converted directly from GitHub's published second values.
GitHub's Jan 5, 2027 token rule in 4 cards
Access token life
8 hours
Mandatory 28,800-second ghu_ token expiry for apps registered from Jan 5, 2027.
Refresh token life
184 days
ghr_ refresh tokens live 15,897,600 seconds (~6 months) and rotate on every swap.
Continuous refreshes
3x / day
Always-on agents and CLIs must refresh at least 90 times per 30-day month.
Legacy apps & PATs
Untouched
Pre-Jan 5 apps keep non-expiring tokens indefinitely unless owners opt in and revoke.
Starting January 5, 2027 (31 days from December 5), every newly registered GitHub App and OAuth app on GitHub.com and GHE.com gets mandatory 8-hour user access tokens (28,800 seconds) with zero opt-out at registration. Apps registered earlier and tokens already issued stay completely untouched. Developers shipping new integrations, CLIs, or long-running AI agents must persist both rotating access tokens and 184-day refresh tokens before registering new apps.
What changes on January 5, 2027, and what stays untouched?
Registration date alone determines whether expiring user tokens become mandatory on GitHub.com and GHE.com.
| Item | Until Jan 4, 2027 | From Jan 5, 2027 |
|---|---|---|
| New GitHub App or OAuth app user token expiry | Enabled by default, opt-out at registration | Always on, no opt-out |
| Apps registered before Jan 5 | Current app setting | Unchanged; no forced switch announced |
| Tokens already issued | Valid as issued | Unaffected |
| Covered platforms | GitHub.com and GHE.com | |
How long does each GitHub token type live?
Shortening user access tokens to 8 hours limits leak windows while raising the stakes on securing 184-day refresh tokens.
| Token | Prefix | GitHub value | Plain units |
|---|---|---|---|
| User access token (expiring) | ghu_ | 28,800 s | 8 hours |
| User refresh token | ghr_ | 15,897,600 s | 184 days |
| Non-expiring user token | ghu_ / gho_ | Indefinite | Until revoked |
| GitHub App installation token | ghs_ | 3,600 s | 1 hour |
An active app refreshes at most three times per day (24 / 8). GitHub's OAuth docs describe the 184-day refresh cap as "six months without use," while GitHub App docs state six months flat.
Which HTTP refresh call must new apps implement?
Every refresh call returns a new refresh token alongside the new access token, so both values must be persisted atomically.
| Step | Required detail |
|---|---|
| Endpoint | POST https://github.com/login/oauth/access_token |
| Parameters | client_id, client_secret (omitted for device-flow tokens), grant_type=refresh_token, refresh_token |
| Response fields | New access_token and refresh_token, plus expires_in and refresh_token_expires_in |
| Refresh token expired | User signs in again through web flow or device flow |
| Pre-test before Jan 5 | Request the offline_access scope to trigger expiring access and refresh tokens on an existing app |
Who needs to update code, and who can leave things alone?
Engineering work lands strictly on teams registering new apps after January 4 or opting legacy apps into expiration.
| Scenario | Required action |
|---|---|
| Registering a new app from Jan 5 | Confirm your app or auth SDK handles token refresh before registering (GitHub's direct recommendation) |
| Running a pre-Jan 5 app with non-expiring tokens | No change required; click Opt-in next to "User-to-server token expiration" in app settings to migrate |
| Opting a legacy app in | Existing non-expiring tokens stay live until deleted via DELETE /applications/CLIENT_ID/token or re-login |
| Building CLIs or AI coding agents | Store ghr_ refresh tokens securely and automate 8-hour rotation for unattended jobs |
| Using personal access tokens only | Unchanged; only GitHub Apps and OAuth apps are covered by this notice |
Compare coding agent models on the Benchmarks Leaderboard or build a local dev rig in the PC and Local AI Builder.
The verdict
Developers registering new GitHub integrations, CLIs, or AI agents in 2027: Test refresh-token rotation immediately using the offline_access scope so users and unattended jobs do not break every 8 hours after January 5.
Maintainers of pre-2027 apps: Nothing breaks automatically on January 5, though opting in and revoking old tokens closes indefinite credential exposure.
Personal access token users: Take no action from this notice; PAT policy is unchanged.
The catch: Existing apps keep non-expiring tokens that GitHub itself warns can be abused indefinitely if leaked; security gains only reach legacy apps whose owners opt in and revoke old 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 existing token setting, and tokens already issued stay valid with no forced migration announced.
How long do new GitHub expiring user tokens and refresh tokens last?
Expiring user access tokens (ghu_) last 28,800 seconds (8 hours), and refresh tokens (ghr_) last 15,897,600 seconds (184 days, or about six months).
How can teams test the 8-hour refresh flow before January 5, 2027?
Request the offline_access scope on an existing app to receive expiring tokens immediately, and verify your code stores both the fresh access_token and rotated refresh_token returned by POST https://github.com/login/oauth/access_token.
Does this January 5, 2027 rule change GitHub personal access tokens?
No. GitHub's December 4, 2026 announcement covers newly registered GitHub Apps and OAuth apps on GitHub.com and GHE.com only.
Next steps
See this week's dev hardware prices in the Market
In the app: Benchmarks Leaderboard · Hot Deals · PC and Local AI Builder
Read next: 2027, Not 2035: Anthropic and OpenAI Post-Quantum Deadline · Comfy Agent Desktop token cost analysis · NVIDIA NIM tuning: 2x on Gemma 4 26B, 1.39x across 37 models
Sources
- GitHub Changelog: New GitHub Apps and OAuth apps require expiring user tokens (Dec 4, 2026) blog.github.com
- GitHub Docs: Refreshing user access tokens docs.github.com
- GitHub Docs: Authorizing OAuth apps, expiring access tokens docs.github.com
- GitHub Docs: Generating an installation access token docs.github.com
- GitHub Blog: Behind GitHub's new authentication token formats (token prefixes) blog.github.com
Comments
Post a Comment