Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk5 min

How to Set Up GitHub Actions Permissions and Concurrency for Coding Agents

Limit a coding agent’s GitHub Actions token to the access each job needs, then choose concurrency groups and cancellation rules that protect the work that must run.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use GitHub Actions permissions to limit what a coding-agent workflow can do with its GITHUB_TOKEN; use concurrency to decide which matching runs may proceed and whether older work is canceled. These are separate controls: a narrow token does not prevent overlapping runs, and a concurrency group does not limit token access.

Set permissions around each job’s actual work

GitHub lets you configure GITHUB_TOKEN access with the permissions key at workflow or job level. Grant only what the work requires. If you specify permissions, unspecified permissions are set to none; check the required scopes for every action and operation in the job. An action can access the token through the github.token context even when you do not explicitly pass a token input, so omitting an explicit token input is not a substitute for restricting permissions.

As an Amazon Associate I earn from qualifying purchases.

For a job that checks out and reads source, contents: read is a reasonable starting point. Add a write permission only for the job that needs it. GitHub’s tutorial, for example, combines contents: read with issues: write for a job that creates an issue; that is an illustration, not a default agent configuration. See GitHub’s automatic token authentication guidance and the GITHUB_TOKEN tutorial.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Workflow-level and job-level permissions

Workflow-level permissions are convenient when every job needs the same access. Prefer job-level permissions when jobs have meaningfully different responsibilities—for example, a read-only test job and a separate job that publishes a result. This makes the trust boundary easier to inspect and limits the effects of a compromised step or action to the token access available to its job.

Permissions alone do not make untrusted code safe. Keep privileged operations separate from jobs that execute untrusted pull-request code or arbitrary user-supplied content. Review the code and actions that run in a privileged job, and avoid giving a job broad write access merely because another job needs it. GitHub’s secure-use guidance discusses least privilege and the risks associated with access to repository write permissions and secrets.

When the job needs to write

Identify the exact operation before adding access. Creating an issue needs an appropriate issues permission; other operations, such as pushing a commit or creating a pull request, require their corresponding access and may need a different token mechanism depending on repository policy. If GITHUB_TOKEN cannot provide the required access, GitHub documents alternatives such as a GitHub App installation token or a personal access token. Choose credentials with the narrowest suitable scope and protect them as secrets; do not assume an agent needs write access simply because it is an agent.

Choose a concurrency group that matches the resource

A concurrency group allows only one matching job or workflow to run at a time. By default, a group can have one running and one pending run; when another run becomes pending, GitHub cancels the previously pending run. That means a concurrency setting can discard work even when cancel-in-progress is not enabled. Read GitHub’s concurrency documentation before relying on a group for work that must not be skipped.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Isolate runs by workflow and ref

For branch checks that should supersede only other runs of the same workflow on the same ref, GitHub gives this group-name pattern:

group: ${{ github.workflow }}-${{ github.ref }}

The workflow name and ref distinguish separate workflows and branches. This avoids unintentionally making unrelated branch checks compete for one group.

Serialize workflows against a shared resource

If several workflows must not use the same deployment target or other shared resource simultaneously, use a deliberately shared group name for that resource. Be aware that workflows with the same group can affect one another: their pending runs compete, and cancellation settings can stop in-progress work. Choose this only when that cross-workflow coordination is intentional.

Decide whether a newer run may cancel older work

Set cancel-in-progress: true when a newer run makes an older check obsolete—for example, repeated validation of successive commits on the same branch. Avoid it for release or deployment work that should finish, or where every run must execute. GitHub also supports conditional cancellation, so cancellation can be limited to the cases where superseding work is safe. If every run must be processed, use a queuing approach supported by the current concurrency syntax and verify its behavior; do not assume runs are guaranteed to execute in strict first-in, first-out order.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Example: a read-only agent check workflow

This is a starting pattern, not a universal or tested agent configuration. It runs checks on pull requests and pushes to main, gives the check job read-only contents access, isolates concurrency by workflow and ref, and cancels an older in-progress run in that group.

name: Agent checks
on:
  pull_request:
  push:
    branches: [main]

permissions:
  contents: read

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  checks:
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@v4
      - run: ./run-agent-checks.sh

Before adopting it, verify the actions and versions, whether the agent needs to write, whether pull-request code is trusted in this workflow, and whether canceling a run is acceptable. Change the triggers, group, and cancellation behavior to match repository policy and the work being protected.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Account for GITHUB_TOKEN-triggered workflow behavior

GitHub creates a unique GITHUB_TOKEN for each job. It is a GitHub App installation access token limited to the repository that contains the workflow. GitHub-hosted runners have a maximum job duration of six hours; self-hosted runners have a maximum of five days. For self-hosted runs, the installation token can be refreshed only up to 24 hours. These are platform limits, not recommended job durations. Details are in GitHub’s token documentation.

Most events generated with GITHUB_TOKEN do not trigger another workflow run. This helps prevent accidental recursive automation, but it matters if an agent pushes a commit or updates a pull request and the design expects a downstream workflow to start. GitHub documents exceptions including workflow_dispatch and repository_dispatch, as well as approval behavior for certain pull-request events. Check the event and authentication design rather than assuming a token-authenticated push will trigger follow-up automation. See the documented behavior and exceptions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use repository and organization protections where needed

YAML permissions and concurrency govern a workflow’s token access and run coordination. Administrators can also configure workflow execution protections to restrict which actors and events may run specified workflows. GitHub describes these controls at repository, organization, or enterprise levels, subject to the account’s available settings and plan. The documented how-to covers public repositories and private repositories on GitHub Team or Enterprise. Administrators can use policy insights to evaluate blocked or would-be-blocked runs. See GitHub’s workflow execution protections guide.

GitHub’s Actions policy overview announced that a default policy blocking pull_request_target in public repositories would be enforced on November 2, 2026. That is an announced future date relative to October 4, 2026; check the current policy documentation and repository settings for its status before relying on it. The overview is at GitHub’s secure-use policy reference.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.