answered from live GitHub & Hugging Face data

How do I revoke a fine-grained PAT used by my AI coding agent like Codex?

Revoke the token in GitHub settings, then replace it. Do not rely on the agent to stop using it. A revoked token stops working for all Git and API requests, and it cannot be restored.

Steps

Option A: Revoke a token you own (personal account)

  1. Open GitHub. Click your profile picture, then click Settings.
  2. In the left sidebar, click Developer settings.
  3. Click Personal access tokens, then click Fine-grained tokens.
  4. Find the token that Codex uses. Click its name, then revoke or delete it.

I could not confirm the exact delete button label from the docs I read. The page text was cut off before the section on deleting a single token. Check the page in your browser.

Option B: Revoke a token used on an organization (org owners only)

  1. Click your profile picture, then click Your organizations. Select the organization.
  2. Click Settings. If you cannot see it, use the ⋯ menu, then click Settings.
  3. In the left sidebar, under Personal access tokens, click Active tokens.
  4. Click the token name, then click Revoke. To revoke several, select them and click Revoke....

The docs say the token creator receives an email when a token is revoked. (Reviewing and revoking personal access tokens in your organization)

Emergency option: revoke all credentials

Use this only if you think your account is compromised. Go to Settings, then Credentials, then Revoke all. This removes SSO access to enterprise resources. It does not delete tokens. (Revoking your credentials)

What happens after you revoke

Check for a leak

If the token may have been pushed to a public repository or gist, GitHub revokes it automatically. Check your security log anyway. (Token expiration and revocation)

Replace the token

I did not verify how Codex authenticates to GitHub. Check the Codex settings for the place where it stores the token.

If you run more than one agent, use a separate identity for each. githug gives each agent its own key. That key mints GitHub tokens that last one hour and work on one repository. Revoking one agent then does not affect the others.

docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokensdocs.github.com/en/organizations/managing-programmatic-access-to-your-organization/reviewing-and-revoking-personal-access-tokens-in-your-organizationdocs.github.com/en/rest/orgs/personal-access-tokensdocs.github.com/en/authentication/keeping-your-account-and-data-secure/revoking-your-credentialsdocs.github.com/en/authentication/keeping-your-account-and-data-secure/token-expiration-and-revocation
Answered live from GitHub & Hugging Face · anthropic/claude-haiku-5.5 · 11/4/2026

Ask your own open-source question →