Safeguard
Security Guides•

Who can read your GitHub Actions secrets?

Anyone with write access to a repository can read its Actions secrets through a workflow. Here is who that covers and how to shrink the group.

Safeguard Security Team
4 min read

Anyone with write access to your repository effectively has read access to all secrets configured there. GitHub's security guidance says so directly. They cannot see the values in the settings page, but they can write a workflow that uses them. So the real question is who has write access.

Definition

A GitHub Actions secret is an encrypted value that workflows can use. The settings page never shows the value again after you save it. That sounds like a vault, but the protection ends at the interface. A workflow that runs in the repository receives the value as input, and workflow files are code that people with write access can change.

GitHub's secure use guidance states: "Any user with write access to your repository has read access to all secrets configured in your repository." The practical lesson is to treat write access as secret access.

Who needs what

ActionAccess GitHub requires
Create repository secrets, organization repositoriesWrite access
Create repository secrets, personal repositoriesCollaborator
Create environment secrets, organization repositoriesAdmin access
Create organization secretsOrganization owner, with an access policy per secret

One more detail: organization level secrets are not accessible by private repositories on GitHub Free.

Why this surprises teams

Teams grant write access freely because it feels like "can push code". But in a repository with Actions, pushing a branch can mean running code with secrets. Branch protection limits what gets merged, not what runs on a branch in the same repository. Workflows triggered by pushes to a branch can use repository secrets unless something withholds them.

Forks are different. GitHub's docs say secrets are not passed to the runner when a workflow is triggered from a forked repository, except GITHUB_TOKEN. And secrets are not available to workflows triggered by Dependabot events; Dependabot has its own secrets store.

How to shrink the group

  1. List who has write or higher access. Remove people who only need to read or file issues.
  2. Move production credentials into environments. GitHub says environment secrets are only available to jobs that use the environment, and only after the configured rules, such as required reviewers, pass.
  3. Add a deployment branch or tag rule to those environments so only chosen refs can use them.
  4. Use organization secrets with a policy that names the repositories allowed to use them, rather than all repositories.
  5. Replace stored cloud keys with OIDC, which GitHub notes lets you stop keeping long-lived credentials as secrets.
  6. Review the list of secrets and delete ones nobody uses.
  7. Rotate any secret a departing person could have read through a workflow.

What about the secret's name versus its value

Listing secrets shows names and metadata. The command line tool's list command exposes fields such as name, visibility, and updated time, not values, so inventory work does not itself leak anything. Treat the inventory as sensitive anyway; it maps your attack surface.

Quick check

Can a collaborator with write access print a secret in a log?

They can try. GitHub redacts known secret values in logs, but redaction depends on exact matches, so encoded or transformed values can slip through. Do not rely on masking as protection against an insider.

Do environment secrets fix this?

They narrow it. Jobs only reach them after rules pass, so combine them with reviewers and branch rules.

Safeguard policies and gates can flag pull requests that change workflow files, and asset discovery helps map which repositories hold credentials. A free scan is at gold.safeguard.sh/scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.