# GitHub App tokens are now 520 characters - check your redaction rules

> A regex written for the old 40 character format may log the whole new token.

Source: https://fullbytedeveloper.com/blog/token520
Published here: 2026-11-14

If your app creates GitHub App installation tokens, a redaction rule written for the old format may be writing the whole new token to your logs.

GitHub's changelog (Oct 2, 2026): new installation tokens still start with `ghs_` but are now about 520 characters long instead of 40. Tokens still expire after one hour, so old 40 character tokens are already gone, unless your app sends `X-GitHub-Stateless-S2S-Token: disabled`, which GitHub stops honoring on Nov 30, 2026.

## The fix block

1. Find every rule, check and fixture that knows the prefix:

```bash
rg -n 'ghs_' .
```

2. Widen what it finds. A pattern that does not guess the new character set:

```text
ghs_[^\s"']+
```

3. Token columns, secret stores and env vars: no small fixed limit (TEXT is safest).

4. Proxies, gateways and middleware: make sure they do not cut or reject long Authorization headers.

5. Remove the `X-GitHub-Stateless-S2S-Token` header from production code before Nov 30, 2026.

## Example

Python 3.9.6, a fake 520 character token shaped `ghs_<app id>_<JWT>`, app id 000000: the legacy pattern `ghs_[A-Za-z0-9]{36}` matched nothing, so the whole token stayed in the log line. A `ghs_\w{36}` rule was worse: it blanked the first 40 characters and left 480 in the log. `ghs_[^\s"']+` replaced the whole token.

GitHub does not publish the new character set; the fake token shape is an assumption. Secret scanners with a 36 character rule may miss these tokens too. This is about GitHub App installation tokens (`ghs_`); the changelog does not mention personal access tokens or Actions' GITHUB_TOKEN.

Send this to the teammate whose log redaction regex was written for 40 character GitHub tokens.

## Sources

1. [GitHub changelog: stateless installation tokens](https://github.blog/changelog/2026-10-02-stateless-github-app-installation-tokens-rolled-out/)
2. [GitHub changelog: per-request override header](https://github.blog/changelog/2026-05-15-github-app-installation-tokens-per-request-override-header/)
