cicdsecurity.devSecuring build and deploy pipelines

GitHub Actions permissions: what the workflow token may write, job by job

The permissions key sets what a GitHub Actions job's GITHUB_TOKEN may do, scope by scope, for a whole workflow or one job. Name any scope and every scope you leave out drops to none. New personal repositories start read-only for contents and packages; organization repositories inherit. Set read as the default and grant write only where a job needs it.

Updated December 2, 2026 ยท from GitHub's workflow syntax, GITHUB_TOKEN and settings docs · the 17 scopes as a CSV

How does the GitHub Actions permissions key work?

The GitHub Actions permissions key gives each scope one of three levels, read, write or none, where write includes read. Set it at the top of the workflow for every job, or under one job to override it there (GitHub Docs, read December 1, 2026):

permissions:
  contents: read        # every job: read only

jobs:
  release:
    permissions:
      contents: write   # this job may create a release
      id-token: write   # and request an OIDC token
    runs-on: ubuntu-latest
  • As soon as you name one scope, every scope you didn't name is set to none.
  • permissions: read-all or write-all sets every scope at once; permissions: {} turns them all off.
  • The key only changes the GITHUB_TOKEN. Secrets and personal access tokens are untouched.

Which scopes can the GITHUB_TOKEN have?

The GITHUB_TOKEN has 17 scopes in GitHub's workflow syntax reference, read December 1, 2026. Two take only write or none, and one only read or none:

Scope and levelsGitHub's example
actionsread, write, nonewrite can cancel a workflow run
artifact-metadataread, write, nonewrite can create storage records for a build artifact
attestationsread, write, nonewrite can generate an artifact attestation
checksread, write, nonewrite can create a check run
code-qualityread, write, nonewrite can upload code coverage reports
contentsread, write, noneread lists commits; write can create a release
copilot-requestswrite, nonewrite lets an organization repository's workflow use Copilot CLI
deploymentsread, write, nonewrite can create a deployment
discussionsread, write, nonewrite can close or delete a discussion
id-tokenwrite, nonewrite fetches an OpenID Connect token
issuesread, write, nonewrite can comment on an issue
packagesread, write, nonewrite can publish to GitHub Packages
pagesread, write, nonewrite can request a Pages build
pull-requestsread, write, nonewrite can label a pull request
security-eventsread, write, noneread lists code scanning alerts; write updates them
statusesread, write, noneread lists commit statuses
vulnerability-alertsread, noneread lists Dependabot alerts

Secret scanning alerts can't be read with any of them: GitHub says they need a GitHub App or a personal access token.

What are the default workflow permissions?

Default workflow permissions depend on when and where the repository was made. A new repository in a personal account gives the GITHUB_TOKEN read access to contents and packages only; a new organization repository inherits its organization's setting, and a stricter organization or enterprise default can't be loosened per repository.

GitHub made read-only the default for new enterprises, organizations and repositories on February 2, 2023, and left existing ones as they were. An organization from before then may still hand every job read/write access. To check or change it:

  1. Open the repository's Settings, then Actions, then General.
  2. Under Workflow permissions, pick read access for contents and packages (restricted) instead of read and write for all scopes (permissive).
  3. Leave Allow GitHub Actions to create and approve pull requests off unless a workflow needs it; it is off by default for new personal repositories.
  4. Click Save, then add permissions: to each job that writes.

Fewer than a third of popular projects scope every workflow file. In a scan of the 100 most-starred GitHub repositories with workflows on December 2, 2026, 30 set permissions: at the top of every workflow file and 82 in at least one; 1 set write-all. The scan of the 100 most-starred repositories has the method, and the workflow scan CSV has each repository's counts.

What token do forks, Dependabot and pull_request_target get?

Fork pull requests and Dependabot get a read-only token by default, but pull_request_target gets read/write even from a public fork. For forks, the permissions key can't add write access unless an admin allows it; for Dependabot, it can.

Run triggered byToken and secrets by default
Pull request from a forkRead-only token, no secrets. Write only if an admin turns on "Send write tokens to workflows from pull requests" (private repositories).
Dependabot pull requestRead-only token, which the permissions key can raise; Dependabot secrets only.
pull_request_targetRead/write token, even from a public fork; repository and organization secrets.

That last row is why pull_request_target needs care: see when pull_request_target is safe.

How long does a GITHUB_TOKEN last?

A GITHUB_TOKEN lasts one job. GitHub creates a unique GitHub App installation token before each job starts, and it expires when the job finishes or hits its maximum lifetime: 6 hours on GitHub-hosted runners, where jobs can't run longer, and up to 24 hours of refreshes on self-hosted runners, where jobs can run for 5 days. For a job longer than 24 hours, GitHub points to a personal access token or another method.

How do you find the permissions a job needs?

Find the permissions a job needs by starting from contents: read and adding a scope each time a step fails for lack of one; the examples above show which scope covers what. Two free tools flag tokens that are too broad: OpenSSF Scorecard's Token-Permissions check, and zizmor, which reports "excessive permission scopes and credential grants to runners". Both are among the CI/CD security tools compared; for a review of each pull request that widens a token, see IonRift Security Agent.

  • A deploy with OIDC needs id-token: write; naming it sets every other scope to none, so add contents: read back if the job reads the repository. 54 of the 100 scanned repositories ask for it in at least one workflow.
  • actions/checkout configures the token in the local git config unless the step sets persist-credentials: false (the default is true); 12 of the 98 scanned repositories that use checkout set it on every checkout.
  • A job that labels pull requests needs pull-requests: write, not contents: write.
  • A release job needs contents: write; publishing to GitHub Packages adds packages: write.

How was this page checked?

Every scope, level and default here was read on December 1, 2026 from GitHub's workflow syntax reference, its GITHUB_TOKEN docs, its repository settings docs and the February 2, 2023 changelog. The job examples follow GitHub's scope descriptions; no workflow was run for this page. The scan figures come from the home page's scan of 100 repositories' workflow files on December 2, 2026. Errors: support@winding.ai.

  1. GitHub Docs: Workflow syntax (permissions) (read December 1, 2026)
  2. GitHub Docs: GITHUB_TOKEN (read December 1, 2026)
  3. GitHub Docs: Use GITHUB_TOKEN for authentication in workflows (read December 1, 2026)
  4. GitHub Docs: Managing GitHub Actions settings for a repository (read December 1, 2026)
  5. GitHub Changelog, February 2, 2023: default GITHUB_TOKEN permissions read-only (read December 1, 2026)
  6. GitHub Docs: OpenID Connect (read December 1, 2026)
  7. OpenSSF Scorecard repository (Apache-2.0) (read December 1, 2026)
  8. zizmor repository (MIT) (read December 1, 2026)
  9. actions/checkout action.yml (persist-credentials) (read December 2, 2026)

The 17 scopes, their levels and GitHub's example for each are in github-token-scopes-2026-12-01.csv. To cite them:

cicdsecurity.dev, "GitHub Actions permissions: what the workflow token may write, job by job," read December 1, 2026. https://cicdsecurity.dev/github-actions-permissions/