GitHub Tokens
GitHub Agentic Workflows authenticate using multiple tokens depending on the operation. This reference explains which token to use, when it’s required, and how precedence works across different operations.
Quick start: tokens you actually configure
Section titled “Quick start: tokens you actually configure”GitHub Actions always provides GITHUB_TOKEN for you automatically.
For GitHub Agentic Workflows, you only need to create a few optional secrets in your own repo:
| When you need this… | Secret to create | Notes |
|---|---|---|
| Copilot workflows (CLI, engine, agent sessions, etc.) | COPILOT_GITHUB_TOKEN | Needs Copilot Requests permission. For org-owned repos, needs org permissions: Members (read-only), GitHub Copilot Business (read-only). |
| Cross-repo Project Ops / remote GitHub tools | GH_AW_GITHUB_TOKEN | PAT or app token with cross-repo access. |
| Assigning agents/bots to issues or pull requests | GH_AW_AGENT_TOKEN | Used by assign-to-agent and Copilot assignee/reviewer flows. |
| Any GitHub Projects v2 operations | GH_AW_PROJECT_GITHUB_TOKEN | Required for project new CLI command, create-project, and update-project. Default GITHUB_TOKEN cannot access Projects v2 API. |
| Isolating Model Context Protocol (MCP) server permissions (advanced optional) | GH_AW_GITHUB_MCP_SERVER_TOKEN | Only if you want MCP to use a different token than other jobs. |
Create these as repository secrets in your repo. The easiest way is to use the GitHub Agentic Workflows CLI:
# Current repositorygh aw secrets set COPILOT_GITHUB_TOKEN --value "YOUR_COPILOT_PAT"gh aw secrets set GH_AW_GITHUB_TOKEN --value "YOUR_PAT"gh aw secrets set GH_AW_AGENT_TOKEN --value "YOUR_AGENT_PAT"gh aw secrets set GH_AW_PROJECT_GITHUB_TOKEN --value "YOUR_PROJECT_PAT"After these are set, gh-aw will automatically pick the right token for each operation; you should not need per-workflow PATs in most cases.
CLI helpers for tokens and secrets
Section titled “CLI helpers for tokens and secrets”gh aw secrets bootstrap– checks which recommended token secrets (likeGH_AW_GITHUB_TOKEN,COPILOT_GITHUB_TOKEN) exist in a repository and prints suggested scopes plus copy‑pasteablegh aw secrets setcommands.gh aw init --tokens --engine <engine>– runs token checks as part of repository initialization for a specific engine (copilot,claude,codex).gh aw secrets set <NAME>– creates or updates a repository secret. Values can come from--value,--value-from-env, or stdin (for example,echo "PAT" | gh aw secrets set NAME).
Security and scopes (least privilege)
Section titled “Security and scopes (least privilege)”- Use
permissions:at the workflow or job level soGITHUB_TOKENonly has what that workflow needs (for example, read contents and write PRs, but nothing else):
permissions: contents: read pull-requests: write- When creating each PAT/App token above, grant access only to the repos and scopes required for its scenario (cross-repo Project Ops, Copilot, agents, or MCP) and nothing more.
- Only expose powerful secrets to the jobs that need them by scoping them to
env:at the job or step level, not globally:
jobs: project-ops: env: GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}- For very sensitive tokens, prefer GitHub Environments or organization-level secrets with required reviewers so only trusted workflows can use them.
Token Overview
Section titled “Token Overview”| Token | Type | Purpose | User Configurable |
|---|---|---|---|
GITHUB_TOKEN | Auto-provided | Default Actions token for current repository | No (auto-provided) |
COPILOT_GITHUB_TOKEN | PAT | Copilot authentication (recommended) | Yes (required for Copilot) |
GH_AW_GITHUB_TOKEN | PAT | Enhanced token for cross-repo and remote GitHub tools | Yes (required for cross-repo) |
GH_AW_AGENT_TOKEN | PAT | Agent assignment operations | Yes (required for agent ops) |
GH_AW_PROJECT_GITHUB_TOKEN | PAT | Required token for GitHub Projects v2 operations | Yes (required for Projects v2) |
GH_AW_GITHUB_MCP_SERVER_TOKEN | PAT | Custom token specifically for GitHub MCP server | Yes (optional override) |
GITHUB_MCP_SERVER_TOKEN | Auto-set | Automatically configured by compiler | No (auto-configured) |
GITHUB_TOKEN (Default)
Section titled “GITHUB_TOKEN (Default)”Type: Automatically provided by GitHub Actions
GitHub Actions automatically provides this token with scoped access to the current repository. It’s used as a fallback when no custom token is configured.
Capabilities:
- Read and write access to current repository
- Default permissions based on workflow
permissions:configuration - No cost or setup required
Limitations:
- Cannot access other repositories
- Cannot trigger workflows via GitHub API
- Cannot assign bots (Copilot) to issues or PRs
- Cannot authenticate with Copilot engine
- Not supported for remote GitHub MCP server mode
When to use: Simple workflows that only need to interact with the current repository (comments, labels, issues in the same repo).
GH_AW_GITHUB_TOKEN (Enhanced PAT)
Section titled “GH_AW_GITHUB_TOKEN (Enhanced PAT)”Type: Personal Access Token (user must configure)
A fine-grained or classic Personal Access Token providing enhanced capabilities beyond GITHUB_TOKEN. This is the primary token for workflows that need cross-repository access or remote GitHub tools.
Required for:
- Cross-repository operations (accessing other repos)
- Remote GitHub tools mode (faster startup without Docker)
- Codex engine operations with GitHub MCP
- Any operation that needs to access multiple repositories
Setup:
-
Create a fine-grained PAT with:
- Repository access: Select specific repos or “All repositories”
- Permissions:
- Contents: Read (minimum) or Read+Write (for PRs)
- Issues: Read+Write (for issue operations)
- Pull requests: Read+Write (for PR operations)
-
Add to repository secrets:
gh aw secrets set GH_AW_GITHUB_TOKEN --value "YOUR_PAT"Token precedence: per-output → global safe-outputs → workflow-level → default fallback (GH_AW_GITHUB_MCP_SERVER_TOKEN → GH_AW_GITHUB_TOKEN → GITHUB_TOKEN)
GH_AW_GITHUB_MCP_SERVER_TOKEN (GitHub MCP Server)
Section titled “GH_AW_GITHUB_MCP_SERVER_TOKEN (GitHub MCP Server)”Type: Personal Access Token (optional override)
A specialized token for the GitHub MCP server that takes precedence over the standard token fallback chain. Use this when you want to provide different permissions specifically for GitHub MCP server operations versus other workflow operations.
When to use:
- You need different permission levels for MCP server vs. other operations
- You want to isolate MCP server authentication from general workflow authentication
- You’re using remote GitHub MCP mode and need a token with specific scopes
Setup:
gh aw secrets set GH_AW_GITHUB_MCP_SERVER_TOKEN --value "YOUR_PAT"Token precedence: tool-level → workflow-level → GH_AW_GITHUB_MCP_SERVER_TOKEN → GH_AW_GITHUB_TOKEN → GITHUB_TOKEN
The compiler automatically sets GITHUB_MCP_SERVER_TOKEN and passes it as GITHUB_PERSONAL_ACCESS_TOKEN (local/Docker) or Authorization: Bearer header (remote).
GH_AW_PROJECT_GITHUB_TOKEN (GitHub Projects v2)
Section titled “GH_AW_PROJECT_GITHUB_TOKEN (GitHub Projects v2)”Type: Personal Access Token (required for Projects v2 operations)
A specialized token for GitHub Projects v2 operations used by:
- The
project newCLI command for creating projects - The
update-projectsafe output for updating projects
Required because the default GITHUB_TOKEN cannot access the GitHub Projects v2 GraphQL API.
When to use:
- Always required for any Projects v2 operations (creating, updating, or reading project boards)
- The default
GITHUB_TOKENcannot create or manage ProjectV2 objects via GraphQL - You want to isolate Projects permissions from other workflow operations
Setup:
The required token type depends on whether you’re working with user-owned or organization-owned Projects:
For User-owned Projects (v2):
You must use a classic PAT with the project scope. Fine-grained PATs do not work with user-owned Projects.
- Create a classic PAT with scopes:
project(required for user Projects)repo(required if accessing private repositories)
For Organization-owned Projects (v2):
You can use either a classic PAT or a fine-grained PAT:
-
Option A: Create a classic PAT with
projectandread:orgscopes:project(required)read:org(required for org Projects)repo(required if accessing private repositories)
-
Option B (recommended): Create a fine-grained PAT with:
- Repository access: Select specific repos that will use the workflow
- Repository permissions:
- Contents: Read
- Issues: Read (if needed for issue-triggered workflows)
- Pull requests: Read (if needed for PR-triggered workflows)
- Organization permissions (must be explicitly granted):
- Projects: Read & Write (required for updating org Projects)
- Important: You must explicitly grant organization access during token creation
-
Option C: Use a GitHub App with Projects: Read+Write permission
After creating your token, add it to repository secrets:
gh aw secrets set GH_AW_PROJECT_GITHUB_TOKEN --value "YOUR_PROJECT_PAT"Token precedence: per-output → workflow-level → GH_AW_PROJECT_GITHUB_TOKEN → GITHUB_TOKEN
Example configuration:
---# Option 1: Use GH_AW_PROJECT_GITHUB_TOKEN secret (recommended for org Projects)# Just create the secret - no workflow config needed---
# Option 2: Explicitly configure at safe-output levelsafe-outputs: update-project: github-token: ${{ secrets.CUSTOM_PROJECT_TOKEN }}
# Option 3: Organization projects with GitHub tools integrationtools: github: toolsets: [default, projects] github-token: ${{ secrets.ORG_PROJECT_WRITE }}safe-outputs: update-project: github-token: ${{ secrets.ORG_PROJECT_WRITE }}For organization-owned projects, the complete configuration should include both the GitHub tools and safe outputs using the same token with appropriate permissions.
COPILOT_GITHUB_TOKEN (Copilot Authentication)
Section titled “COPILOT_GITHUB_TOKEN (Copilot Authentication)”Type: Personal Access Token (user must configure)
The recommended token for all Copilot-related operations including the Copilot engine, agent session creation, and bot assignments.
Required for:
engine: copilotworkflowscreate-agent-session:safe outputs- Assigning
copilotas issue assignee - Adding
copilotas PR reviewer
Setup:
The required token type depends on whether you own the repository or an organization owns it:
For User-owned Repositories:
- Create a fine-grained PAT with:
- Resource owner: Your user account
- Repository access: “Public repositories” or select specific repos
- Note: You should leave “Public repositories” enabled; otherwise, you will not have access to the Copilot Requests permission option.
- Permissions:
- Copilot Requests: Read-only (required)
For Organization-owned Repositories:
When an organization owns the repository, you need a fine-grained PAT with organization-level permissions:
-
Create a fine-grained PAT with:
- Resource owner: The organization that owns the repository
- Repository access: Select the specific repositories that will use the workflow
- Repository permissions:
- Contents: Read (if needed for repository access)
- Issues: Read (if needed for issue-triggered workflows)
- Pull requests: Read (if needed for PR-triggered workflows)
- Organization permissions (must be explicitly granted):
- Members: Read-only (required)
- GitHub Copilot Business: Read-only (required)
- Important: You must explicitly grant organization access during token creation
-
Add to repository secrets:
gh aw secrets set COPILOT_GITHUB_TOKEN --value "YOUR_COPILOT_PAT"Token precedence: per-output → global safe-outputs → workflow-level → COPILOT_GITHUB_TOKEN → GH_AW_GITHUB_TOKEN (legacy, deprecated)
GH_AW_AGENT_TOKEN (Agent Assignment)
Section titled “GH_AW_AGENT_TOKEN (Agent Assignment)”Type: Personal Access Token (user must configure)
Specialized token for assign-to-agent: safe outputs that programmatically assign GitHub Copilot agents to issues or pull requests. This is distinct from the standard GitHub UI workflow for assigning issues to Copilot—this token is used for automated agent assignment through workflow safe outputs.
Required for:
assign-to-agent:safe outputs- Programmatic agent assignment operations
Setup:
The required token type and permissions depend on whether you own the repository or an organization owns it:
For User-owned Repositories:
- Create a fine-grained PAT with:
- Resource owner: Your user account
- Repository access: “Public repositories” or select specific repos
- Repository permissions:
- Actions: Write
- Contents: Write
- Issues: Write
- Pull requests: Write
For Organization-owned Repositories:
When an organization owns the repository, you need a fine-grained PAT with the resource owner set to the organization:
-
Create a fine-grained PAT with:
- Resource owner: The organization that owns the repository
- Repository access: Select the specific repositories that will use the workflow
- Repository permissions:
- Actions: Write
- Contents: Write
- Issues: Write
- Pull requests: Write
- Important: You must set the resource owner to the organization during token creation
-
Add to repository secrets:
gh aw secrets set GH_AW_AGENT_TOKEN --value "YOUR_AGENT_PAT"Token precedence: per-output → global safe-outputs → workflow-level → GH_AW_AGENT_TOKEN (no further fallback - must be explicitly configured)
GITHUB_MCP_SERVER_TOKEN (Auto-configured)
Section titled “GITHUB_MCP_SERVER_TOKEN (Auto-configured)”Type: Automatically set by the compiler (do not configure manually)
This environment variable is automatically set by gh-aw based on your GitHub tools configuration. Configure tokens using GH_AW_GITHUB_TOKEN, GH_AW_GITHUB_MCP_SERVER_TOKEN, or workflow-level github-token instead.
Token Configuration Patterns
Section titled “Token Configuration Patterns”Per-Output vs Global vs Workflow-Level
Section titled “Per-Output vs Global vs Workflow-Level”You can configure tokens at three levels with different precedence:
# Workflow-level (applies to all operations by default)github-token: ${{ secrets.GH_AW_GITHUB_TOKEN }}
safe-outputs: # Global safe-outputs level (overrides workflow-level for all outputs) github-token: ${{ secrets.GLOBAL_PAT }}
create-issue: # Per-output level (highest priority) github-token: ${{ secrets.ISSUE_PAT }} target-repo: "org/other-repo"
create-pull-request: # Automatically uses Copilot token chain when copilot is reviewer reviewers: copilotCross-Repository Operations
Section titled “Cross-Repository Operations”Cross-repository operations always require GH_AW_GITHUB_TOKEN or a custom PAT with access to the target repositories:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN }}
safe-outputs: create-issue: target-repo: "org/tracking-repo" # Requires PAT with access to org/tracking-repo
add-comment: target-repo: "org/another-repo" # Requires PAT with access to org/another-repoRemote GitHub Tools Mode
Section titled “Remote GitHub Tools Mode”Remote mode requires a PAT because the default GITHUB_TOKEN is not supported:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN }} # Required for remote mode
tools: github: mode: remote # Faster startup, no Docker required toolsets: [default]Copilot Operations
Section titled “Copilot Operations”Copilot operations require a PAT with “Copilot Requests” permission:
engine: copilot
# Option 1: Configure COPILOT_GITHUB_TOKEN secret (recommended)# No workflow configuration needed - automatically used
# Option 2: Explicitly configure in workflowgithub-token: ${{ secrets.COPILOT_GITHUB_TOKEN }}GitHub App Tokens
Section titled “GitHub App Tokens”GitHub App installation tokens provide enhanced security with short-lived, automatically-revoked credentials. This is the recommended approach for production workflows.
Benefits:
- On-demand minting: Tokens created at job start, minimizing exposure window
- Short-lived: Tokens automatically revoked at job end (even on failure)
- Automatic permissions: Compiler calculates required permissions based on safe outputs
- Audit trail: All actions logged under the GitHub App identity
- No PAT rotation: Eliminates need for manual token rotation
Setup:
safe-outputs: app: app-id: ${{ vars.APP_ID }} private-key: ${{ secrets.APP_PRIVATE_KEY }} owner: "my-org" # Optional: defaults to current repo owner repositories: ["repo1", "repo2"] # Optional: defaults to current repo only
create-issue: # No github-token needed - uses App token automatically
create-pull-request: # Permissions computed based on safe output typesPermission mapping:
create-issue:→ Issues: Writecreate-pull-request:→ Contents: Write, Pull requests: Writeadd-comment:→ Issues: Writeadd-labels:→ Issues: Writeupdate-issue:→ Issues: Writecreate-agent-session:→ Actions: Write, Contents: Write
Configuration inheritance: App configuration can be imported from shared workflows. Local configuration takes precedence:
imports: - shared/common-app.md # Defines app: config
safe-outputs: app: repositories: ["repo3"] # Overrides imported config create-issue:GitHub App Tokens for GitHub MCP Server
Section titled “GitHub App Tokens for GitHub MCP Server”GitHub App tokens can also be used to authenticate the GitHub MCP server, providing the same security benefits as safe-outputs while isolating MCP server permissions.
Benefits:
- Isolated permissions: GitHub MCP server uses separate token from safe-outputs
- On-demand minting: Token created at workflow start, minimized exposure
- Automatic revocation: Token invalidated at workflow end (even on failure)
- Permission mapping: Automatically computed from agent job
permissionsfield - Dual mode support: Works with both local (Docker) and remote (hosted) modes
Setup:
Configure the GitHub App directly in the tools configuration:
permissions: contents: read issues: write pull-requests: read
tools: github: mode: remote # or "local" for Docker-based toolsets: [repos, issues, pull_requests] app: app-id: ${{ vars.APP_ID }} private-key: ${{ secrets.APP_PRIVATE_KEY }} owner: "my-org" # Optional: defaults to current repo owner repositories: ["repo1", "repo2"] # Optional: defaults to current repo onlyShared workflow pattern (recommended):
Use the provided shared workflow for centralized configuration:
imports: - shared/github-mcp-app.md # Provides APP_ID and APP_PRIVATE_KEY configuration
permissions: contents: read issues: write
tools: github: toolsets: [repos, issues, pull_requests]The shared workflow (shared/github-mcp-app.md) expects:
- Repository Variable:
APP_ID- Your GitHub App ID - Repository Secret:
APP_PRIVATE_KEY- Your GitHub App private key
How it works:
- At workflow start, a token minting step (
github-mcp-app-token) is automatically inserted before MCP server setup - The token is minted with permissions matching the agent job’s
permissionsfield - Token is passed to the GitHub MCP server as
GITHUB_MCP_SERVER_TOKEN - At workflow end, the token is automatically invalidated (even on failure)
Token precedence:
When a GitHub App is configured for the GitHub MCP server:
- GitHub App token (highest priority)
tools.github.github-token(custom token)GH_AW_GITHUB_MCP_SERVER_TOKEN(dedicated MCP token)GH_AW_GITHUB_TOKEN(general enhanced token)GITHUB_TOKEN(default Actions token - not supported in remote mode)
Setup repository variables:
# Set GitHub App ID as repository variablegh variable set APP_ID --body "123456"
# Set GitHub App private key as repository secretgh aw secrets set APP_PRIVATE_KEY --value "$(cat path/to/private-key.pem)"Token Selection Guide
Section titled “Token Selection Guide”Use this guide to choose the right token for your workflow:
| Scenario | Recommended Token | Alternative |
|---|---|---|
| Single repository, basic operations | GITHUB_TOKEN (default) | None needed |
| Cross-repository operations | GH_AW_GITHUB_TOKEN | GitHub App |
| Copilot engine workflows | COPILOT_GITHUB_TOKEN | None |
| Remote GitHub MCP mode | GH_AW_GITHUB_TOKEN | GitHub App via tools.github.app |
| GitHub MCP server (isolated permissions) | GitHub App via tools.github.app | GH_AW_GITHUB_MCP_SERVER_TOKEN |
| Agent assignments | GH_AW_AGENT_TOKEN | GH_AW_GITHUB_TOKEN with elevated permissions |
| GitHub Projects v2 operations | GH_AW_PROJECT_GITHUB_TOKEN | GH_AW_GITHUB_TOKEN with Projects permissions |
| Production workflows | GitHub App (safe-outputs and MCP) | GH_AW_GITHUB_TOKEN with fine-grained PAT |
Security Best Practices
Section titled “Security Best Practices”Principle of Least Privilege
Section titled “Principle of Least Privilege”Always use the minimal permissions: in your workflow and let safe outputs handle API access with tokens:
permissions: contents: read # Minimal workflow permissions
safe-outputs: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN }} create-issue: # Token handles API authentication, not workflow permissionsToken Scoping
Section titled “Token Scoping”Scope different operations with different tokens when they need different permission levels:
safe-outputs: create-issue: github-token: ${{ secrets.READ_WRITE_PAT }} target-repo: "org/public-issues"
create-pull-request: github-token: ${{ secrets.LIMITED_PAT }} target-repo: "org/code-repo"Prefer GitHub Apps
Section titled “Prefer GitHub Apps”Use GitHub Apps for production workflows whenever possible:
- Better security (short-lived tokens)
- Better auditability (app identity in logs)
- No credential rotation needed
- Automatic permission management
PAT Best Practices
Section titled “PAT Best Practices”When using Personal Access Tokens:
- Use fine-grained PATs over classic PATs
- Set short expiration periods (90 days or less)
- Implement rotation schedules before expiration
- Limit repository access to only what’s needed
- Use separate tokens for different permission levels
- Monitor token usage in organization audit logs
Avoid Common Pitfalls
Section titled “Avoid Common Pitfalls”Don’t: Hardcode tokens in workflows
github-token: "ghp_xxxxxxxxxxxx" # ❌ Never do thisDo: Use secrets
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN }} # ✅ CorrectDon’t: Use overly permissive tokens
# ❌ Classic PAT with full repo access for simple issue creationgithub-token: ${{ secrets.ADMIN_TOKEN }}Do: Use appropriately scoped tokens
# ✅ Fine-grained PAT with Issues: Write onlygithub-token: ${{ secrets.ISSUE_TOKEN }}Common Workflow Examples
Section titled “Common Workflow Examples”Basic (single repository): Uses default GITHUB_TOKEN - no configuration needed
Cross-repository: Set github-token: ${{ secrets.GH_AW_GITHUB_TOKEN }} at workflow level
Copilot operations: Automatically uses COPILOT_GITHUB_TOKEN when configured
Different permissions per output: Override at per-output level with different PATs
Production (most secure): Configure GitHub App with app-id and private-key in safe-outputs and/or tools.github
GitHub MCP with App: Import shared/github-mcp-app.md and configure APP_ID + APP_PRIVATE_KEY repository variables
Troubleshooting
Section titled “Troubleshooting””Resource not accessible by integration”
Section titled “”Resource not accessible by integration””Token lacks required permissions. Configure the appropriate token:
- Cross-repository:
gh aw secrets set GH_AW_GITHUB_TOKEN --value "YOUR_PAT" - Copilot operations:
gh aw secrets set COPILOT_GITHUB_TOKEN --value "YOUR_COPILOT_PAT" - Agent assignments:
gh aw secrets set GH_AW_AGENT_TOKEN --value "YOUR_AGENT_PAT"
Required PAT scopes: Issues (Read+Write), Pull requests (Read+Write), Contents (Read+Write), Copilot Requests (for Copilot)
Token not being used
Section titled “Token not being used”Check token precedence configuration. Tokens are resolved in order: per-output → global safe-outputs → workflow-level → default fallback. Set at the appropriate level based on your needs.
Remote GitHub Tools requires authentication
Section titled “Remote GitHub Tools requires authentication”Remote mode does not support GITHUB_TOKEN. Either set GH_AW_GITHUB_TOKEN or switch to mode: local in tools configuration.
Token expiration
Section titled “Token expiration”PATs expire. Check expiration in GitHub settings, regenerate, and update secret. Consider implementing rotation schedules.
Organization policies restrict PATs
Section titled “Organization policies restrict PATs”Work with organization admin to request exemption, use organization-wide GitHub App, or request pre-approved fine-grained PAT.
Quick Reference
Section titled “Quick Reference”Token Setup Commands
Section titled “Token Setup Commands”# Copilot operationsgh aw secrets set COPILOT_GITHUB_TOKEN --value "YOUR_COPILOT_PAT"
# Enhanced GitHub token (most common, current repository)gh aw secrets set GH_AW_GITHUB_TOKEN --value "YOUR_PAT"
# Agent assignmentsgh aw secrets set GH_AW_AGENT_TOKEN --value "YOUR_AGENT_PAT"
# GitHub Projects v2 operations (optional)gh aw secrets set GH_AW_PROJECT_GITHUB_TOKEN --value "YOUR_PROJECT_PAT"
# Custom MCP server token (optional)gh aw secrets set GH_AW_GITHUB_MCP_SERVER_TOKEN --value "YOUR_PAT"
# List configured secrets (GitHub CLI)gh secret list -a actionsToken Precedence Summary
Section titled “Token Precedence Summary”All operations follow the same general pattern: per-output → global safe-outputs → workflow-level → specific secret → fallback
Specific fallback chains are documented in each token’s section above. Note: Copilot operations use COPILOT_GITHUB_TOKEN (not GITHUB_TOKEN), and agent assignments use GH_AW_AGENT_TOKEN with no further fallback.
Required PAT Permissions
Section titled “Required PAT Permissions”| Operation Type | Required Permissions |
|---|---|
| Cross-repository read | Contents: Read |
| Cross-repository issues | Issues: Read+Write, Contents: Read |
| Cross-repository PRs | Pull requests: Read+Write, Contents: Read+Write |
| Copilot operations (user-owned repos) | Copilot Requests: Read-only |
| Copilot operations (org-owned repos) | Copilot Requests: Read-only + Organization permissions: Members (read-only), GitHub Copilot Business (read-only) |
| Agent assignments | Actions: Write, Contents: Write, Issues: Write, Pull requests: Write |
| GitHub Projects v2 | Projects: Read+Write (org-level for org Projects) |
| Remote GitHub MCP | Contents: Read (minimum), adjust based on toolsets |
Migration from Legacy Tokens
Section titled “Migration from Legacy Tokens”COPILOT_CLI_TOKEN and GH_AW_COPILOT_TOKEN are no longer supported (removed in v0.26+). Migrate to COPILOT_GITHUB_TOKEN:
gh aw secrets set COPILOT_GITHUB_TOKEN --value "YOUR_PAT"Related Documentation
Section titled “Related Documentation”- Engines - Engine-specific authentication
- Safe Outputs - Safe output token configuration
- Tools - Tool authentication and modes
- Permissions - Permission model overview