How to Turn On GitHub Secret Scanning for Actions Workflow Logs (2026)
GitHub's new log scanning is in public preview. Here is how to enable it, where it falls short, and how to respond to an alert.
On this page 7 sections
To turn on GitHub secret scanning for Actions workflow logs, an enterprise owner opens enterprise settings, selects Policies, then Advanced Security, and sets the Actions workflow log policy to Enabled for all repositories. The feature is a public preview on GitHub Enterprise Cloud. It scans only runs that finish after you enable it and sends no notifications.
GitHub announced the feature on November 9, 2026. Backtrace covers developer tooling that changes how teams ship, and this change matters because build logs are where secrets leak by accident. This guide is for DevOps engineers and security leads who run Actions on an enterprise plan and want the setting on without surprises.
What Does Secret Scanning for Actions Logs Cover?
When a workflow run completes, GitHub scans its logs for known provider token patterns. Findings land in the repository's secret scanning alert list, next to alerts from code, issues and pull requests, with a link back to the log that leaked the value.
The scan runs after the job ends, not while it runs. That detail shapes how you should think about it. A secret printed in a log is already visible to anyone who can read that run while the job is still going. The scan gives you a record and an alert. It does not stop the print.
Supported secret types also get a validity check, so the alert tells you whether the leaked token still works. According to the GitHub changelog entry for the preview, alerts stay available even after the logs are deleted. That makes the alert list a durable audit trail rather than a pointer to a log that may expire.
Who Can Use It and What You Need First
The preview is limited to enterprises on GitHub Enterprise Cloud that have GitHub Secret Protection or GitHub Advanced Security. That includes enterprises with data residency on GHE.com. If your organization sits on a free or Team plan, you cannot turn this on yet.
Before you change the policy, check three things. Confirm which enterprise owner can edit policies, because a repository admin cannot do it. Confirm that secret scanning is already enabled on the repositories you care about. The policy applies only to repositories that have secret scanning turned on under one of those two licenses.
Also decide who will read the alerts. The preview sends no notifications for log findings. If nobody owns the alert list, the feature produces records that nobody reads. Name a person or a rotation before you flip the switch.
Teams that already run a scanner in CI should keep it. The comparison in our guide to secrets scanning tools shows that each tool catches a different set of patterns, and the log scan has its own gaps, covered below.
How to Enable Secret Scanning for Actions Workflow Logs
The setting lives in enterprise policies, not in a single repository. Follow these steps in order.
- Sign in as an enterprise owner and open your enterprise settings.
- Select Policies, then Advanced Security.
- Find the option named Secret scanning for Actions workflow logs.
- Open the All repositories dropdown and select Enabled.
- Open a repository with secret scanning on and confirm the alert list loads.
The policy is disabled by default, so nothing changes until an owner does this. It also applies to all repositories at once. There is no per-repository opt-in in the steps GitHub documents, so plan for the whole enterprise.
After you enable it, run a test. Add a throwaway workflow to a sandbox repository that prints a fake token in the format of a supported provider. Let the run finish, then look at the alert list. Use a dummy value that matches a provider pattern but was never issued, so you test detection without leaking anything real.
Expect a delay. The scan starts when the run completes, so an alert will not appear while the job is still going. If the test alert does not show up after the run ends, check that secret scanning is enabled on that repository and that the run finished after you changed the policy.
What Does the Preview Miss?
The preview misses several kinds of secrets, and it never looks at runs that finished before you enabled it. GitHub lists the gaps plainly, and they are worth reading before you tell leadership that logs are covered.
| Case | Scanned in the preview? |
|---|---|
| Provider token patterns in new runs | Yes |
| Logs from runs that finished before you enabled it | No, nothing is backfilled |
| Generic secret patterns | No |
| Custom patterns your team defined | No |
| AI-detected secrets | No |
| Secrets already masked by Actions | No |
The custom pattern gap hurts most for internal systems. If your company issues its own API keys with a house prefix, the log scan will not see them. Keep a separate control for those values.
The masked-secret gap is less worrying than it looks. A value that Actions already masked shows up as asterisks in the log, so there is nothing readable to find. The risk sits in values that were transformed before printing, which masking can miss.
The backfill gap means old logs stay unscanned. If you suspect a past leak, you still need to read those logs yourself or search them with your own tooling. Our write-up on checking repositories for the GhostAction workflow shows what a manual review of workflows and logs involves.
How to Handle an Alert From a Workflow Log
Treat a log alert as a live credential leak until proven otherwise. The first move is to rotate the secret, not to hunt for who printed it. Rotation closes the hole, and the investigation can happen afterward.
Work through the alert in this order. Check the validity result on the alert to see whether the token still works. Revoke or rotate the credential at the provider. Then read the linked log to find which step printed it. Delete the log once the credential is dead, because the alert survives log deletion.
GitHub's own secure use reference for Actions gives the same advice. It says that if an unredacted secret reaches a run log, you should delete the log and rotate the secret. The reference also notes that automatic redaction is not guaranteed, because a secret can be transformed in several ways before it is printed.
Deleting the log alone is not a fix. Anyone who could read that run may already have copied the value, and a deleted log does nothing about a copy. Rotation is the only step that makes the leaked value worthless. Our API key rotation guide covers how to make that step routine so it does not become a fire drill.
Record each alert in your incident tracker with the step that leaked it. Patterns show up quickly. Most leaks trace to a handful of habits, such as a debug flag that prints the environment or a script that echoes a connection string.
Fix the Leak Source With Masking and Workflow Hygiene
Scanning finds leaks after the fact. Masking and workflow design prevent them. The two work together, and neither replaces the other.
GitHub's secure use reference tells teams to mask sensitive values that are not stored as GitHub secrets by using the ::add-mask::VALUE workflow command. That command makes the runner treat the value as a secret and redact it from logs. Use it for anything derived at runtime, such as a short-lived token fetched from a cloud provider in a step.
The same reference warns against wrapping a secret inside structured data. Redaction depends on finding an exact match for the secret value, so a JSON, XML or YAML blob that contains a secret makes redaction far less reliable. Store each sensitive value as its own secret instead.
Apply a short checklist to every workflow your team owns.
- Never print the full environment in a debug step.
- Keep one secret per value, never a JSON blob.
- Mask any token you fetch or derive during the run.
- Give each job the smallest token scope it needs.
- Pin third-party actions so a changed dependency cannot read your secrets.
The last item deserves attention. A compromised action runs with the access your workflow gives it, and it can print anything it can read. Pinning limits that risk, and our guide to GitHub Actions workflow lockfiles walks through how to do it for every dependency.
Backtrace editors tend to rank least privilege first. The secure use reference notes that any user with write access to a repository can read all of its secrets. A token with narrow scope turns a log leak from an incident into a nuisance.
Conclusion
Log scanning closes a real gap, because build output is a common place for credentials to end up. The preview has limits, so treat it as one layer. Turn it on at the enterprise level, assign someone to read the alert list, rotate first when an alert fires, and fix the workflow step that printed the secret.
Your next step is small. Open enterprise policies this week, enable the setting, and run the dummy-token test in a sandbox repository. Then schedule a recurring check of the alert list until GitHub adds notifications. Backtrace will update this guide when the preview changes.