⚙️

Configuration Reference

Complete frontmatter schema and field reference

Prerequisites

Before creating agentic workflows, ensure you have the following:

✅ Required

  • Inference access for your chosen engine — Copilot access and billing for Copilot, or the provider’s documented authentication for another engine
  • GitHub CLI — gh v2.45.0 or above (cli.github.com)
  • gh-aw extension — gh extension install github/gh-aw
  • Repository admin access — needed to manage secrets and enable workflows

🔑 Tokens & Secrets

  • Copilot inference — use permissions: copilot-requests: write with supported owner-seat or organization billing; COPILOT_GITHUB_TOKEN is an alternative, not a universal requirement (see Authentication)
  • GH_AW_AGENT_TOKEN — optional repo secret; PAT for assign-to-agent safe output
  • Custom PAT or GitHub App — optional, for safe-output writes under a different identity

What gh aw init Does

Running gh aw init in your repository:

  • ✅ Creates .github/workflows/copilot-setup-steps.yml — the environment setup file for the agentic workflow runner
  • ✅ Configures the selected engine with —engine; current initialization is noninteractive, not an engine-selection wizard
  • ✅ Creates dispatcher skill and repository configuration; the exact files depend on the flags
  • ❌ Does not establish inference entitlement or choose an authentication policy for you
# Initialize the repo
gh aw init --engine copilot

# Only for the Copilot PAT alternative (not required with copilot-requests: write)
gh secret set COPILOT_GITHUB_TOKEN -R owner/repo
# (paste your fine-grained PAT when prompted)

Authentication and billing are engine-specific. Current Copilot inference supports the Actions token through copilot-requests: write; when configured, it ignores COPILOT_GITHUB_TOKEN for inference. Check applicable billing and organization policy, plus the official authentication reference, before selecting the PAT alternative.

How Configuration Works

Every agentic workflow is a .md file in .github/workflows/ with two parts:

📋 YAML Frontmatter

Structured config between --- markers — triggers, permissions, tools, engine, and safe outputs. Validated at compile time.

📝 Markdown Body

Natural-language instructions loaded at runtime. Body-only edits do not require recompilation; frontmatter edits do. Review and commit instruction changes as code regardless.

# File: .github/workflows/triage-issues.md
---
on:
  issues:
    types: [opened]
permissions:
  contents: read
  issues: read
  copilot-requests: write
safe-outputs:
  add-labels:
    allowed: [bug, feature, docs]
  add-comment: {}
---

# Issue Triage Agent
Analyze new issues and apply the appropriate label.
Explain your reasoning in a comment.

💡 Run gh aw compile to transform the .md file into a .lock.yml — a security-hardened GitHub Actions workflow. The lock file is what Actions executes.

Authentication & Tokens

Authentication can use the built-in Actions token, configured repository secrets, or supported identity federation. Inference and GitHub API/write operations are separate authentication boundaries; choose each path deliberately.

Copilot inference — choose the appropriate authentication path

For Copilot, permissions: copilot-requests: write selects the built-in Actions token. Current GitHub documentation also supports personally-owned repositories, billed to the owner’s Copilot seat. Organization repositories use organization billing and require the applicable Copilot CLI policy. Verify actual inference access rather than assuming the permission alone grants an entitlement. The alternative is COPILOT_GITHUB_TOKEN, a fine-grained PAT from a user with Copilot inference access. It is not required for every workflow or every engine. The PAT setup below applies only when you choose that alternative.

Creating the Token

  1. Go to github.com/settings/personal-access-tokens
  2. Select Fine-grained token → choose your target repository or Public Repositories
  3. Under Account permissions, grant Copilot Requests: Read-only
  4. Copy the generated token and store it as a repo secret:
gh secret set COPILOT_GITHUB_TOKEN -R owner/repo
# Paste your fine-grained PAT when prompted

COPILOT_GITHUB_TOKEN is a PAT alternative, distinct from the built-in Actions token. With copilot-requests: write, that PAT is ignored for inference. Other engines use their own documented credentials or federation. Do not mix inference authentication with GitHub API/write credentials.

Additional Secrets

Depending on your workflow configuration, you may need additional repository secrets:

SecretWhen NeededPermission
COPILOT_GITHUB_TOKENAlternative Copilot inference authentication; not needed with copilot-requests: writeCopilot Requests: Read
GH_AW_AGENT_TOKENUsing assign-to-agent safe outputIssues: Read & Write
ANTHROPIC_API_KEYUsing engine: claude—
OPENAI_API_KEYUsing engine: codex—
GEMINI_API_KEYUsing engine: gemini—
GH_AW_SECURITY_ALERTS_TOKENSecurity monitoring workflowsDependabot, Code scanning, Secret scanning alerts

💡 All secrets are stored as regular repository secrets (Settings → Secrets and variables → Actions). MCP server secrets referenced in the workflow frontmatter also go here, using the ${{ secrets.NAME }} syntax.

Custom Tokens for Safe Outputs

By default, safe-output write operations use the built-in GITHUB_TOKEN. To use a different identity for writes (e.g., a bot account, a GitHub App), configure github-token: or github-app: in your safe-outputs.

🔑 Fine-Grained PAT

Use a PAT for full control. Supports all safe-output types including assign-to-agent.

safe-outputs:
  github-token:
    secret: MY_BOT_PAT
  create-pull-request:
    draft: true
  assign-to-agent:
    allowed: [copilot]

🤖 GitHub App

Use a GitHub App for scoped, short-lived tokens. Better for orgs — no personal account needed.

safe-outputs:
  github-app:
    app-id: ${{ vars.APP_ID }}
    private-key: ${{ secrets.APP_KEY }}
  create-pull-request:
    draft: true
  add-comment: {}

PAT Required Scopes

ScopeRequired For
contents: writeCreating PRs, pushing code
issues: writeCreating/updating issues, adding labels
pull-requests: writePR reviews, comments
actions: writeDispatching workflows

⚠️ GitHub App limitation: The assign-to-agent safe output requires a fine-grained PAT — GitHub App installation tokens are not supported by the Copilot assignment API. If you use github-app: for other safe outputs, set the GH_AW_AGENT_TOKEN repository secret (a PAT) as a fallback for agent assignment.

Token Summary

ScenarioToken TypeWhere to Configure
Copilot inferenceActions token with copilot-requests: write, or fine-grained PAT alternativeOwner-seat/organization billing and policy, or COPILOT_GITHUB_TOKEN
Third-party engine (Claude, Codex, Gemini)API keyEngine-specific repo secret
MCP server authenticationSecretRepo secret, referenced via ${{ secrets.NAME }}
Safe-output writes (custom identity)PAT or GitHub Appgithub-token: or github-app: in frontmatter
Assign-to-agentFine-grained PAT onlyGH_AW_AGENT_TOKEN repo secret

Complete Frontmatter Schema

35+ fields
FieldTypeRequiredDefaultDescription
namestringNoFilenameDisplay name in GitHub Actions UI
descriptionstringNo—Human-readable workflow description
onstring / objectYes—Trigger events and access controls
permissionsstring / objectNoread-allGitHub token permission scopes
enginestring / objectNocopilotAI engine and model selection
toolsobjectNo—Available tools for the agent
mcp-serversobjectNo—Custom Model Context Protocol servers
mcp-scriptsobjectNo—Inline MCP tools via JS/shell scripts
safe-outputsobjectNo—Permitted write operations
networkstring / objectNodefaultsNetwork access control (AWF)
sandboxstring / objectNoawfSandbox configuration (AWF + MCP gateway)
strictbooleanNotrueEnhanced security validation
importsstring[] / object[]No—Import shared config from other .md files
sourcestringNo—Origin tracking (owner/repo/path@ref)
secretsobjectNo—Secret values for workflow execution
environmentstring / objectNo—Deployment protection rules
containerstring / objectNo—Container image for job steps
servicesobjectNo—Service containers (databases, caches)
stepsarrayNo—Custom steps before agentic execution
post-stepsarrayNo—Custom steps after agentic execution
jobsobjectNo—Custom jobs alongside agentic execution
envobjectNo—Workflow-level environment variables
cacheobject / arrayNo—GitHub Actions cache configuration
concurrencystring / objectNo—Workflow concurrency control
runs-onstring / arrayNoubuntu-latestRunner label for main job
timeout-minutesintegerNo20Maximum execution time
ifstringNo—Conditional execution expression
run-namestringNoWorkflow nameCustom run display name
privatebooleanNofalsePrevent external installation
labelsstring[]No—Workflow categorization tags
metadataobjectNo—Custom key-value pairs
resourcesstring[]No—Companion files for gh aw add
runtimesobjectNo—Override default runtime versions
featuresobjectNo—Experimental feature flags

Trigger Events (on:)

30+ triggers

The on: field uses standard GitHub Actions trigger syntax, extended with gh-aw-specific controls.

Standard Triggers

TriggerKeyCommon TypesUse Case
Issuesissuesopened, edited, labeledReact to issue lifecycle
Pull Requestpull_requestopened, synchronizeReact to PR events
Issue Commentissue_commentcreatedChatOps, respond to comments
Pushpush—React to code pushes
Scheduleschedule—Recurring automation
Workflow Dispatchworkflow_dispatch—Manual trigger with inputs
Workflow Runworkflow_run—Chain after another workflow
Discussiondiscussioncreated, editedReact to discussions
ReleasereleasepublishedAuto-generate changelogs

🕐 Fuzzy Schedule Syntax

Human-friendly schedules. The compiler assigns deterministic scattered times based on file path.

on:
  schedule: daily                              # Scattered daily
  schedule: daily around 14:00                 # ±1 hour of 14:00
  schedule: daily between 9:00 and 17:00       # Business hours
  schedule: weekly on friday around 5pm        # Weekly on Fridays
  schedule: hourly                             # Every hour
  schedule: every 10 minutes                   # Minimum 5 minutes

⚡ Slash & Label Commands

# Slash command — users type /review in comments
on:
  slash_command: "review"

# Label command — fires when label is added
on:
  label_command: "deploy"

🔧 gh-aw Trigger Extensions

FieldTypeDescription
reactionstringEmoji reaction on trigger (eyes, rocket, none)
status-commentbooleanPost started/completed comments
stop-afterstringAuto-disable deadline (+90d, 2024-12-31)
manual-approvalstringEnvironment name for human approval gate
rolesstring[]Required repo roles (admin, maintainer, write)
skip-botsstring[]Skip for listed bot actors
lock-for-agentbooleanLock issue during execution
skip-if-matchstring / objectSkip if GitHub search query matches
skip-if-check-failingboolean / objectSkip if CI checks are failing

Permissions

⚠️ Read-only by default. In strict mode (enabled by default), write permissions are refused — you must use safe-outputs for all write operations.

# Shorthand
permissions: read-all

# Granular
permissions:
  contents: read
  issues: read
  pull-requests: read
  models: read        # Required for Copilot AI model access
ScopeValuesNotes
contentsread / write / noneRepository file access
issuesread / write / noneIssue API access
pull-requestsread / write / nonePR API access
actionsread / write / noneWorkflow and run access
checksread / write / noneCheck runs and suites
discussionsread / write / noneDiscussion API
modelsread / noneGitHub Copilot AI model access
security-eventsread / write / noneCode scanning, Dependabot
packagesread / write / nonePackage registry
statusesread / write / noneCommit status API
id-tokenwrite / noneOIDC JWT tokens

Engine Configuration

4 engines

🤖 Copilot default

GitHub’s own coding agent. Uses Copilot premium requests.

engine: copilot

🧠 Claude

Anthropic’s coding agent. Requires ANTHROPIC_API_KEY.

engine: claude

💻 Codex

OpenAI’s coding agent. Requires OPENAI_API_KEY.

engine: codex

✨ Gemini

Google’s coding agent. Requires GEMINI_API_KEY.

engine: gemini

Extended Engine Configuration

engine:
  id: copilot
  version: "0.0.422"            # Pin specific CLI version
  model: gpt-5                  # Override default model
  agent: technical-doc-writer   # Custom agent (.github/agents/<name>.agent.md)
  max-continuations: 3          # Autopilot mode (Copilot only)
  max-turns: 50                 # Max chat iterations (Claude only)
  env:
    DEBUG_MODE: "true"

Tools Configuration

12 built-in tools
ToolKeyDescription
GitHubgithub:GitHub API operations via MCP server
Bashbash:Shell command execution (sandboxed)
Editedit:File editing in workspace
Web Fetchweb-fetch:Fetch web content
Web Searchweb-search:Search the web
Playwrightplaywright:Browser automation and testing
Cache Memorycache-memory:Persistent memory across runs
Repo Memoryrepo-memory:Git-based context storage
Agentic Workflowsagentic-workflows:Workflow introspection
Serenaserena:AI-powered code intelligence (LSP)
QMDqmd:Documentation vector search

GitHub Tool — Toolsets

tools:
  github:
    toolsets: [repos, issues, pull_requests, labels, code_search]
    read-only: true
    lockdown: true

Bash — Command Allowlisting

tools:
  bash:                              # Default safe commands only
  bash: true                         # All commands
  bash: ["echo", "git:*", "npm"]     # Specific commands

Complete Example

tools:
  edit:
  bash: ["gh", "git:*", "npm", "node"]
  github:
    toolsets: [issues, pull_requests, labels]
  web-fetch:
  web-search:
  cache-memory:
    key: "project-context"
  playwright:
  serena: ["typescript", "python"]
  timeout: 120

Safe Outputs

30+ types

Safe outputs are the security boundary between read-only AI execution and write operations. The agent produces structured output; separate permission-controlled jobs execute the writes.

Issues & Discussions

TypeKeyMaxDescription
Create Issuecreate-issue1Create GitHub issues with labels, assignees
Update Issueupdate-issue1Update issue status, title, body
Close Issueclose-issue1Close issues with comment
Create Discussioncreate-discussion1Create GitHub discussions

Pull Requests

TypeKeyMaxDescription
Create PRcreate-pull-request1Create PRs with code changes
Push to PRpush-to-pull-request-branch1Push changes to existing PR branch
Review Commentscreate-pull-request-review-comment10Line-specific review comments
Submit Reviewsubmit-pull-request-review1APPROVE / REQUEST_CHANGES / COMMENT

Labels, Assignments & Comments

TypeKeyMaxDescription
Add Commentadd-comment1Post comments on issues/PRs/discussions
Add Labelsadd-labels3Add labels (with allowlist)
Remove Labelsremove-labels3Remove labels
Add Revieweradd-reviewer3Add reviewers to PRs
Assign to Agentassign-to-agent1Assign Copilot to issues/PRs

Workflows & Security

TypeKeyMaxDescription
Dispatch Workflowdispatch-workflow1Trigger other agentic workflows
Call Workflowcall-workflow1Call reusable workflows (fan-out)
Code Scanningcreate-code-scanning-alert∞Generate SARIF security advisories
Upload Assetupload-asset10Publish files to orphaned git branch

Examples

safe-outputs:
  create-issue:
    title-prefix: "[ai] "
    labels: [automation, agentic]
    assignees: [copilot]
    max: 5
    expires: 7

  create-pull-request:
    title-prefix: "[ai] "
    draft: true
    reviewers: [copilot]
    auto-merge: true
    protected-files: "blocked"

  add-labels:
    allowed: [bug, enhancement, docs]
    max: 5

  add-comment:
    max: 3
    hide-older-comments: true

Custom MCP Servers

Three connection modes for external tools:

📡 Process (stdio)

mcp-servers:
  slack:
    command: "npx"
    args: ["-y", "@slack/mcp-server"]
    env:
      SLACK_BOT_TOKEN: "${{ secrets.SLACK_TOKEN }}"

🐳 Container (Docker)

mcp-servers:
  custom-db:
    container: "ghcr.io/org/db-mcp:latest"
    env:
      DATABASE_URL: "${{ secrets.DB_URL }}"

🌐 HTTP Endpoint

mcp-servers:
  remote-api:
    url: "https://api.example.com/mcp"
    headers:
      Authorization: "Bearer ${{ secrets.TOKEN }}"

Network Configuration

Controlled by the Agent Workflow Firewall (AWF). Only whitelisted domains are accessible.

network: defaults                   # Basic infrastructure only

network:
  allowed:
    - defaults                      # Basic infra
    - python                        # PyPI ecosystem
    - node                          # NPM ecosystem
    - github                        # GitHub domains
    - "api.example.com"             # Custom domain
  blocked:
    - "cdn.tracker.com"             # Block specific (takes precedence)

Ecosystem Identifiers

IDCovers
defaultsCertificates, JSON schema, Ubuntu mirrors
githubGitHub and adjacent domains
pythonPyPI, pip
nodenpm, yarn, pnpm
goproxy.golang.org
rustcrates.io
javaMaven Central, Gradle
dotnetNuGet
containersDocker Hub, GHCR, Quay
terraformHashiCorp domains
playwrightBrowser downloads
linux-distrosDebian, Alpine repos

Advanced Configuration

Imports — Shared Configuration

imports:
  - "./shared/base-config.md"                          # Local file
  - "githubnext/agentics/shared/security.md@main"      # Remote

Concurrency

concurrency:
  group: "gh-aw-${{ github.workflow }}"
  cancel-in-progress: true

Custom Steps

steps:                             # Run BEFORE agent
  - uses: actions/setup-node@v4
    with:
      node-version: "20"

post-steps:                        # Run AFTER agent
  - run: echo "Agent completed"

Complete Workflow Example

---
name: "CI Failure Investigator"
description: "Investigates CI failures and proposes fixes"

on:
  workflow_run:
    workflows: ["CI"]
    types: [completed]
  roles: [admin, maintainer]
  stop-after: "+90d"

permissions:
  contents: read
  actions: read
  issues: read

engine:
  id: copilot
  max-continuations: 3

tools:
  edit:
  bash: ["gh", "git:*", "npm"]
  github:
    toolsets: [repos, issues, pull_requests]

safe-outputs:
  create-pull-request:
    title-prefix: "[ci-fix] "
    labels: [ci-fix, automation]
    draft: true
  add-comment:
    max: 2

network:
  allowed:
    - defaults
    - node
    - github

timeout-minutes: 15
---

# CI Failure Investigator

When a CI workflow fails, investigate the failure:

1. Read the failed workflow logs
2. Identify the root cause
3. Search the codebase for the relevant code
4. Propose a fix as a pull request
5. Comment on the triggering issue with your analysis