AI Engines
GitHub Agentic Workflows support multiple AI engines (coding agents) to interpret and execute natural language instructions. Each engine has unique capabilities and configuration options.
GitHub Copilot CLI
Section titled “GitHub Copilot CLI”GitHub Copilot is the default and recommended AI engine for most workflows. The GitHub Copilot CLI provides MCP server support and is designed for conversational AI workflows.
engine: copilotExtended Configuration
Section titled “Extended Configuration”engine: id: copilot version: latest # Optional: defaults to latest model: gpt-5 # Optional: defaults to claude-sonnet-4 args: ["--add-dir", "/workspace"] # Optional: custom CLI argumentsConfiguration Options
Section titled “Configuration Options”model: AI model (gpt-5orclaude-sonnet-4)version: CLI version to installargs: Custom command-line arguments (supported by all engines)
Environment Variables
Section titled “Environment Variables”COPILOT_MODEL: Alternative way to set the model
Required Secrets
Section titled “Required Secrets”COPILOT_GITHUB_TOKEN: GitHub Personal Access Token (PAT) with “Copilot Requests” permissionGH_AW_GITHUB_TOKEN(optional): Required for GitHub Tools Remote Mode
Authenticating with a Personal Access Token (PAT)
Section titled “Authenticating with a Personal Access Token (PAT)”To use the Copilot engine, you need a fine-grained Personal Access Token with the “Copilot Requests” permission enabled:
- Visit https://github.com/settings/personal-access-tokens/new
- Under “Resource owner”, select your user account (not an organization, see note below).
- Under “Repository access,” select “Public repositories”
- Under “Permissions,” click “Add permissions” and select “Copilot Requests”. If you are not finding this option, review steps 2 and 3.
- Generate your token
- Add the token to your repository secrets as
COPILOT_GITHUB_TOKEN:
gh aw secrets set COPILOT_GITHUB_TOKEN --value "<your-github-pat>"For GitHub Tools Remote Mode, also configure:
gh aw secrets set GH_AW_GITHUB_TOKEN --value "<your-github-pat>"For more information about GitHub Copilot CLI authentication, see the official documentation.
Network Permissions
Section titled “Network Permissions”The Copilot engine supports network access control through the network: configuration at the workflow level. When network permissions are configured, you can enable AWF (Agent Workflow Firewall) to enforce domain-based access controls. AWF is sourced from github.com/githubnext/gh-aw-firewall.
Enable network permissions and firewall in your workflow:
engine: copilot
network: firewall: true # Enable AWF enforcement allowed: - defaults # Basic infrastructure domains - python # Python ecosystem - "api.example.com" # Custom domainWhen enabled, AWF wraps the Copilot CLI execution and enforces the configured domain allowlist, logging all network activity for audit purposes. This provides network egress control and an additional layer of security for workflows that need strict network access control.
Advanced Firewall Configuration:
Additional AWF settings can be configured through the network configuration:
network: allowed: - defaults - python firewall: version: "v1.0.0" # Optional: AWF version (defaults to latest) log-level: debug # Optional: debug, info (default), warn, error args: ["--custom-arg", "value"] # Optional: additional AWF argumentsFirewall Configuration Formats:
The firewall field supports multiple formats:
# Enable with defaultsnetwork: firewall: true
# Enable with empty object (same as true)network: firewall:
# Configure log levelnetwork: firewall: log-level: info # Options: debug, info (default), warn, error
# Disable firewall using booleannetwork: firewall: false
# Disable firewall using string (equivalent to false)network: firewall: "disable"
# Custom configuration with version and argumentsnetwork: firewall: version: "v0.1.0" log-level: debug args: ["--verbose"]Disabling the Firewall
Section titled “Disabling the Firewall”To disable the firewall for any engine that supports it, use sandbox.agent: false:
engine: copilotnetwork: allowed: - defaults - python - "api.example.com"sandbox: agent: falseLegacy approach (deprecated):
strict: falsenetwork: allowed: - defaults - python - "api.example.com" firewall: falseWhen the firewall is disabled:
- Network permissions still apply for content sanitization
- The agent can make network requests without firewall enforcement
- This is useful during development or when the firewall is incompatible with your workflow
See the Network Permissions documentation for details on configuring allowed domains and ecosystem identifiers.
Custom Engine
Section titled “Custom Engine”Define custom GitHub Actions steps without AI interpretation for deterministic workflows.
engine: customExtended Configuration
Section titled “Extended Configuration”engine: id: custom steps: - name: Install dependencies run: npm ciCustom Agent Files
Section titled “Custom Agent Files”All AI engines support custom agent files that provide specialized instructions and behavior. See the Custom Agent Files reference for complete documentation on creating and using custom agents.
Engine Environment Variables
Section titled “Engine Environment Variables”All engines support custom environment variables through the env field:
engine: id: copilot env: DEBUG_MODE: "true" AWS_REGION: us-west-2 CUSTOM_API_ENDPOINT: https://api.example.comEnvironment variables can also be defined at workflow, job, step, and other scopes. See Environment Variables for complete documentation on precedence and all 13 env scopes.
Engine Command-Line Arguments
Section titled “Engine Command-Line Arguments”All engines support custom command-line arguments through the args field, injected before the prompt:
engine: id: copilot args: ["--add-dir", "/workspace", "--verbose"]Arguments are added in order and placed before the --prompt flag. Common uses include adding directories (--add-dir), enabling verbose logging (--verbose, --debug), and passing engine-specific flags. Consult the specific engine’s CLI documentation for available flags.
Engine Error Patterns
Section titled “Engine Error Patterns”All engines support custom error pattern recognition for enhanced log validation:
engine: id: copilot error_patterns: - pattern: "\\[(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2})\\]\\s+(ERROR):\\s+(.+)" level_group: 2 message_group: 3 description: "Custom error format with timestamp"Migration Between Engines
Section titled “Migration Between Engines”Switch engines by changing the engine field in your frontmatter:
# Simple switchengine: copilot
# With configurationengine: id: copilot model: gpt-5 # Optional; defaults to claude-sonnet-4 version: latestEngine-specific features may not be available when switching engines.
Related Documentation
Section titled “Related Documentation”- Frontmatter - Complete configuration reference
- Tools - Available tools and MCP servers
- Security Guide - Security considerations for AI engines
- MCPs - Model Context Protocol setup and configuration