Skip to content

Guides

How to harden workflow permissions

Every workflow runs with write access it does not need.

4 min read

Every workflow runs with write access it does not need.

Why it happens

The repository default grants broad GITHUB_TOKEN scopes unless explicitly narrowed.

How to fix it

  1. Set the organisation default to read-only
  2. Add a permissions block per job granting only what that job needs
  3. Audit workflows using pull_request_target — it is the highest-risk trigger

Your next build could be twice as fast, at half the price

Start free. Migrating away is the same one line, and we publish that diff too.