For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/cicd-github-unspecified-workflows-permissions.md.
A documentation index is available at /llms.txt.
Workflows or jobs that do not explicitly define the GitHub Actions permissions mapping leave the GITHUB_TOKEN with repository default scopes, increasing the blast radius if the token is compromised and enabling unintended access. The permissions property must be set either at the workflow root or per job to declare least-privilege scopes for the GITHUB_TOKEN. This rule flags workflows missing the top-level permissions when all jobs also omit permissions, and it flags individual jobs that lack permissions when other jobs in the same workflow do define them. Define only the scopes required by the workflow or job, for example contents: read and packages: read, to minimize access.