close
GitHub Agentic Workflows

GitHub Agentic Workflows

Intelligent automation for GitHub. Run the coding agents you know and love, with strong guardrails and cost controls, in GitHub Actions.
Loading slides...

Wake up to ready-to-review repository improvements — automated triage, CI insights, docs updates, and test enhancements. Use event-triggered and scheduled jobs to augment your existing, deterministic CI/CD with AI-powered intelligence.

GitHub Agentic Workflows deliver repository automation: simple markdown workflows running the coding agents you know and love, in GitHub Actions, with strong guardrails and security-first design principles. Supported AI engines include GitHub Copilot, Claude Code, Google Gemini and OpenAI Codex.

Developed by GitHub, GitHub Agentic Workflows run with strong guardrails, using safe outputs and sandboxed execution to help keep your repository safe.

AI agents can be manipulated by prompt injection or malicious content. GitHub Agentic Workflows uses layered controls: sandboxing, scoped permissions, gated outputs and threat detection. See the Security Architecture for a full breakdown of the layered defense-in-depth model.

flowchart LR
    INPUT["Repository + Prompt Input"] --> TOKENS["Read-only Token, No Secrets in Agent"]
    TOKENS --> SANDBOX["Sandbox + Network Controls"]
    SANDBOX --> SAFE["Safe Outputs"]
    SAFE --> DETECT["Threat Detection"]
    DETECT --> APPLY["Scoped Write Job"]

Cost control starts with visibility. Use gh aw logs and gh aw audit to find runs consuming the most time, tokens, and AI Credits (AIC), then tighten prompts, triggers, and model choices before spend drifts upward.

max-ai-credits gives each run a hard budget, while OpenTelemetry exports traces and token data to OTLP backends for dashboards, alerting, and cost analysis. For optimization over time, compare cost with outcomes so lower spend still produces useful accepted results.

Here’s a simple workflow that runs daily to create an upbeat status report:

---
on:
schedule: daily
permissions:
contents: read
issues: read
pull-requests: read
safe-outputs:
create-issue:
title-prefix: "[team-status] "
labels: [report, daily-status]
close-older-issues: true
---
## Daily Issues Report
Create an upbeat daily status report for the team as a GitHub issue.
## What to include
- Recent repository activity (issues, PRs, discussions, releases, code changes)
- Progress tracking, goal reminders and highlights
- Project status and recommendations
- Actionable next steps for maintainers

The gh aw compile command turns this source into a hardened .lock.yml GitHub Actions workflow. GitHub Actions then runs the selected AI engine in the configured agent environment on the declared trigger. The AI agent reads allowed repository context and requests only the tools and outputs configured in frontmatter.

Browse the gallery by repository task to find a starting point and learn when to use each workflow.

Issue Triage

Automatically classify new issues, identify duplicates, apply bounded labels, and ask for missing information.

Pull Request Review

Automatically inspect diffs for concrete defects and post review feedback through controlled safe outputs.

Documentation Maintenance

Automatically detect drift between code and documentation and propose reviewable updates.

CI Failure Investigation

Automatically analyze failed GitHub Actions runs, correlate logs, and open diagnostic issues with likely causes.

Code Improvement

Automatically find unnecessary complexity or duplicated logic and propose focused changes for human review.

Dependency Analysis

Automatically research dependency usage and upstream changes before creating prioritized follow-up work.

Metrics and Analytics

Automatically collect workflow activity and store structured snapshots for health and performance analysis.

Repository Reporting

Automatically summarize repository or release activity on an event or schedule.

Repository Maintenance

Automatically review a backlog, perform bounded maintenance tasks, and propose controlled changes on a schedule.

Security Review

Automatically combine repository evidence with AI interpretation to report suspicious changes through code scanning.

Triage from Side Repo

Automatically triage a main repository from an isolated side repository through a slash-command bridge.

Code Quality Monitoring

Automatically analyze code quality across repositories and create focused, actionable issues.

Feature Synchronization

Automatically synchronize code and configuration across repositories through reviewable pull requests.

Cross-Repository Issue Tracking

Automatically aggregate and synchronize issue status in a central repository.

Dependabot Rollout

Automatically roll out tailored Dependabot configuration across multiple repositories.

GitHub Agentic Workflows provides five stable built-in AI engines. Engine changes may also require a different authentication method or tool configuration; use the linked guide for each engine.

The engine import model can integrate other coding-agent CLIs through Markdown definitions. The following in-repository definitions are unsupported samples, not built-in or officially supported gh-aw engines.

See Configuring a custom AI engine and the Engines reference for how to import and pin an engine definition.

Install the extension, add a sample workflow, and trigger your first run - all from the command line in minutes.

Create custom agentic workflows directly from the GitHub web interface using natural language.

Interactive workshop

New

Choose a terminal, browser, or Copilot path and work through the workshop directly in the docs with saved progress.