GitHub Actions Permissions Hardening Checklist Builder
Review GitHub Actions workflow permissions, tokens, secrets, environments, third-party actions, and pull request risks with a hardening checklist.
Prompt Template
You are a DevSecOps engineer reviewing GitHub Actions permissions. Build a hardening checklist for the repository below. Repository type: [open source, private SaaS app, monorepo, library, mobile app, infrastructure repo] Workflow files: [list workflows or paste YAML snippets] Triggers used: [push, pull_request, pull_request_target, workflow_dispatch, schedule, release, deployment] Jobs and actions: [build, test, deploy, publish package, upload artifact, comment on PR, label issues] Default token permissions: [repository default, workflow-level permissions, job-level permissions, unknown] Secrets and variables: [cloud keys, npm token, Docker token, Slack webhook, signing cert, environment secrets] Third-party actions: [pinned SHA, version tag, marketplace action, internal action, unknown] Deployment environments: [production, staging, preview, protected branches, required reviewers] Fork and PR policy: [external contributors, Dependabot, private forks, self-hosted runners] Runner types: [GitHub-hosted, self-hosted, macOS, Windows, Linux, privileged Docker] Known concerns: [overbroad write-all, pull_request_target, secret exposure, unpinned actions, artifact tampering] Compliance needs: [SOC 2, ISO 27001, supply chain security, internal policy] Produce: 1. Workflow inventory with trigger, token scope, secrets used, runner, and risk level. 2. Least-privilege permissions recommendations at workflow and job level. 3. Pull request and fork safety checklist, especially for pull_request_target. 4. Secrets exposure review covering logs, artifacts, caches, scripts, and environment protection. 5. Third-party action pinning and trust checklist. 6. Self-hosted runner isolation and cleanup guidance if applicable. 7. Deployment environment protections for staging and production. 8. Example YAML snippets for safer permissions blocks. 9. Prioritized remediation plan with quick wins, medium work, and policy changes. 10. Regression test plan to confirm workflows still run after hardening. Be specific and explain why each permission is needed or should be removed.
Example Output
Risk Finding
| Workflow | Trigger | Current Permission | Risk | Recommendation |
|---|---|---|---|---|
| ci.yml | pull_request | contents: write | PR job can write when read is enough | Set contents: read |
| release.yml | release | write-all | Broad token for package publish | Use contents: read, packages: write, id-token: write only if OIDC is used |
Safer Default
permissions:
contents: read
Job-Specific Escalation
permissions:
contents: read
pull-requests: write
Use the broader pull-requests permission only for the job that comments on the PR, not for build and test jobs.
Tips for Best Results
- 💡Start with repository and workflow default permissions before editing individual jobs.
- 💡Treat pull_request_target as high risk because it can combine untrusted code paths with privileged context.
- 💡Pin sensitive third-party actions to a commit SHA when practical.
- 💡After reducing permissions, rerun workflows that publish, comment, deploy, or upload artifacts.
Frequently Asked Questions
What is the GitHub Actions Permissions Hardening Checklist Builder prompt?
Review GitHub Actions workflow permissions, tokens, secrets, environments, third-party actions, and pull request risks with a hardening checklist. It's a free ChatGPT prompt template from our Coding collection — copy it, fill in the bracketed variables, and paste it into your AI tool.
Which AI tools work with this prompt?
It's written and tested for ChatGPT, Claude and Gemini. Any AI assistant that accepts free-form text prompts will handle it well.
How do I customize this ChatGPT prompt?
Replace the bracketed variables — such as [list workflows or paste YAML snippets] — with your own details before running it. Start with repository and workflow default permissions before editing individual jobs.
Is this prompt free to use?
Yes. Every prompt on PromptAtlas is free to copy, customize, and use — no signup required.
Related Prompts
Python FileNotFoundError Debugging Prompt
Debug Python FileNotFoundError from the exact traceback, resolved path, working directory, filesystem context, deployment environment, and failing operation.
Python ZeroDivisionError Debugging Prompt
Debug Python ZeroDivisionError from the exact traceback, operand values and types, data path, numeric semantics, runtime context, and failing input.
Python IndentationError Debugging Prompt
Debug Python IndentationError from the exact parser message, whitespace, block structure, source bytes, formatter settings, and runtime version.
Python SyntaxError: Invalid Syntax Debugging Prompt
Debug Python SyntaxError invalid syntax from the exact parser location, surrounding tokens, Python version, generated code, execution context, and minimal reproduction.
Python AttributeError: Object Has No Attribute Debugging Prompt
Debug Python AttributeError from the exact traceback, runtime object type, attribute contract, construction path, version, imports, and minimal reproduction.
Python UnboundLocalError Debugging Prompt
Debug Python UnboundLocalError from the exact traceback, binding scope, assignments, branches, closures, imports, runtime path, and minimal reproduction.