Creuto is now an OpenAI Select Partner Read More
GitHub token theft is reportedly behind SAP's incident. The four org PAT policy settings GitHub leaves permissive by default, and what changing each breaks.

If the insider account of SAP's incident is accurate, the way in was not an exploit but stolen employee authentication tokens. GitHub token theft is only as damaging as your organisation's token policy allows, and GitHub ships that policy permissive: classic tokens allowed, no expiry required. By the end of this post you will know which four settings to change first, and what each one will break.
SAP has confirmed very little. Its statement to BleepingComputer says it "has identified suspicious activity and promptly implemented the necessary measures to protect its customers," and that "based on our investigation to date, we have found no evidence of unauthorized access to customer business data." Everything about tokens comes from insiders quoted by Der Spiegel.
| Claim | Status | Source |
|---|---|---|
| Suspicious activity detected, measures taken | Confirmed by SAP | SecurityWeek |
| No evidence of access to customer business data | SAP statement | SecurityWeek, BleepingComputer |
| Employee tokens stolen, code copied and altered on GitHub | Alleged by an insider | Der Spiegel, via SecurityWeek |
| Agentic AI used in the attack | Alleged; not confirmed | heise |
| GitHub access restricted, automated development halted, signing keys replaced | Reported | Handelsblatt, via heise |
SecurityWeek notes that "none of the reports indicate that tampered code was incorporated into software delivered to SAP customers," and that it is unclear whether proprietary code was accessed at all. We treat the token account as a plausible scenario, not a finding. The controls below are worth having either way.
A stolen GitHub token grants whatever its owner could reach, for as long as the token lives. For a classic token that reach is wide: GitHub's own documentation says a personal access token (classic) "can access every repository that you can access", across every organisation you belong to.
Fine-grained personal access tokens narrow that. Each one is limited to a single user or organisation, can be restricted to specific repositories, and carries specific permissions rather than broad scopes. The blast radius of GitHub token theft is therefore set before the theft, by which token types your organisation accepts and how long they may live.
GitHub's organisation PAT policy page states that by default both classic and fine-grained personal access tokens are enabled. As of November 2026, the defaults and the changes we would make look like this.
| Setting | GitHub default | What to change |
|---|---|---|
| Classic PAT access to org resources | Allowed | Restrict |
| Classic PAT maximum lifetime | No expiration requirement | Set a maximum |
| Fine-grained PAT maximum lifetime | 366 days | Shorten to match your rotation cycle |
| Fine-grained PAT approval | Require administrator approval | Keep it; owner tokens are exempt |
Restricting classic personal access tokens is the single setting with the largest effect. Under "Restrict personal access tokens (classic) from accessing your organizations," choosing the restrict option means classic tokens cannot access resources the organisation owns. They can still read its public resources, so this is not a confidentiality control for open-source repositories.
A maximum lifetime caps how long any stolen token stays useful. The detail most teams miss: GitHub says tokens with non-compliant lifetimes "will be blocked from accessing your organization," and that the policy "does not revoke or disable these tokens." A blocked token is not dead: it can still be used anywhere else that accepts it.
"Require administrator approval" is already the default, which means an owner approves each fine-grained token that can reach the organisation. Two gaps remain. Fine-grained tokens created by organisation owners need no approval, and only fine-grained tokens are subject to approval at all, which is another reason to restrict classic ones.
The strongest objection is that classic tokens still do things fine-grained tokens cannot. GitHub lists the gaps: a fine-grained token cannot span multiple organisations, access Packages, call the Checks API, or reach user-owned Projects, and "a few REST API endpoints are only available with a personal access tokens (classic)." Flip the switch on a Friday and a release job that publishes packages with a classic token will fail.
The answer is that most of those jobs should not use a personal token at all. GitHub's own guidance is that "to access resources on behalf of an organization, or for long-lived integrations, you should use a GitHub App." An installation access token expires after 1 hour and can be narrowed to listed repositories and permissions. The GITHUB_TOKEN in GitHub Actions is created per job and expires when the job finishes. For cloud deployments, OpenID Connect lets workflows exchange short-lived tokens with AWS, Azure or GCP, so you "won't need to duplicate your cloud credentials as long-lived GitHub secrets."
This is the wrong order of work if you have no inventory. Restricting classic tokens before you know which pipelines depend on them is how an outage gets blamed on security. Inventory first, migrate the bots, then restrict. It is also the order we would follow in any DevOps and cloud engineering engagement that touches CI credentials.
Revoking a leaked GitHub token takes minutes; establishing what it touched takes longer. The order matters.
ghp_, github_pat_, gho_, ghu_ and ghr_. It is limited to 60 requests an hour, and the owner is notified.echo -n TOKEN | openssl dgst -sha256 -binary | base64 and search hashed_token:"VALUE", per GitHub's audit log guide. Git events are not returned by search; you need an audit log export.Note what owners cannot do: the organisation UI only lets owners view and revoke fine-grained tokens. A classic token keeps reaching organisation resources until it expires, unless the organisation restricts classic access. GitHub does revoke some tokens automatically, including any personal access token pushed to a public repository or gist and any token unused for one year, according to its token expiration and revocation page. Tokens sitting in private repositories, on laptops or in CI logs are not covered by that automatic revocation; we traced one way passwords reached GitHub in an earlier post.
A token rotation plan that works starts by listing every credential your pipelines hold, with its owner, type and expiry. Fine-grained tokens surface in the organisation settings with filters by owner, repository and permission; classic tokens do not, so start with repository and organisation secrets. Replace each bot PAT with a GitHub App installation token or OIDC, set a maximum lifetime, then restrict classic access. Pair it with step-up controls such as GitHub proof of presence for the actions a stolen session could abuse.
If the SAP allegations hold, the lesson is not that GitHub failed. It is that defaults chosen for compatibility decided how far stolen credentials could travel. If you are weighing whether to restrict classic tokens this quarter and need the bots migrated first, our CI/CD implementation team can inventory your pipeline credentials, move them to GitHub Apps and OIDC, and switch the policy on once nothing depends on classic tokens.
A stolen GitHub token gives the thief whatever its owner could reach until it expires or is revoked. A classic personal access token can access every repository its owner can, across all their organisations, while a fine-grained token is limited to one owner, chosen repositories and specific permissions.
A leaked GitHub token can be revoked by submitting it to GitHub's credential revocation API, which accepts up to 1,000 credentials per unauthenticated request and notifies the owner. Afterwards, check for SSH keys the token created, because those keep working after the token is revoked, and search the audit log by hashed token.
Restricting classic personal access tokens is worth doing, but only after an inventory. Classic tokens still cover cases fine-grained tokens cannot, such as Packages and the Checks API, so migrate CI bots to GitHub App installation tokens or OIDC first, then restrict classic access for the organisation.
GitHub tokens should last no longer than your rotation process can support. GitHub's organisation policy defaults fine-grained tokens to a 366-day maximum and sets no expiration requirement for classic tokens, while GitHub App installation tokens expire after one hour and the Actions GITHUB_TOKEN expires when the job finishes.
A GitHub maximum lifetime policy does not revoke existing tokens. According to GitHub's documentation, tokens with non-compliant lifetimes are blocked from accessing the organisation, but the policy does not revoke or disable them, so they can still be used anywhere else that accepts them.
Ready to take the first step towards unlocking opportunities, realizing goals, and embracing innovation? We're here and eager to connect.