
Cap What Copilot Spends, Not What It Ships
On February 13, 2026, GitHub shipped something that makes traditional CI/CD look quaint. GitHub Agentic Workflows (gh-aw) bring AI coding agents into GitHub Actions. Instead of writing deterministic YAML that checks whether a test passed or failed, you write plain-English instructions that tell an agent what you want done. The agent reads your repo, reasons about it, and produces artifacts like issues, pull requests, or reports.
GitHub calls the broader pattern Continuous AI: background agents that run on your repository the same way CI jobs do, but for tasks that require judgment instead of rules. Think issue triage, documentation drift, test coverage gaps, and performance regressions. Work that was too fuzzy for a linter, too tedious for a human to do daily, and too important to ignore.
This tutorial walks you through setting up two working agentic workflows from scratch. You'll have both running in well under an hour.
Traditional GitHub Actions are deterministic. A workflow file says "run these commands, check these exit codes, pass or fail." That works brilliantly for builds, tests, and deploys. But a huge amount of engineering work resists that kind of automation: triaging incoming issues, keeping docs accurate after code changes, spotting subtle performance regressions, or reviewing whether new code matches the project's style conventions.
Agentic workflows fill that gap. You describe outcomes in a Markdown file with a YAML frontmatter block, and a coding agent (Copilot, Claude, or Codex) executes the instructions inside a sandboxed GitHub Actions runner. The agent has read access to your repository by default. Write operations happen through a controlled mechanism called safe outputs, which constrain the agent to pre-approved GitHub operations like opening a PR or creating an issue.
Each workflow consists of two files in .github/workflows/:
.md file with your intent (YAML frontmatter for triggers, permissions, and safe outputs; Markdown body for instructions).lock.yml file (generated by the CLI) that GitHub Actions actually executesThe Markdown is human-readable intent. The lock file is the machine-readable execution plan. You review both before pushing.
Before you start, you'll need:
gh --version.Install the gh-aw extension:
gh extension install github/gh-awIf you hit authentication issues, you can also install via the bootstrap script:
curl -sL https://raw.githubusercontent.com/github/gh-aw/main/install-gh-aw.sh | bashNext, configure your AI engine secret. For Copilot, you'll set a COPILOT_GITHUB_TOKEN (a separate token with Copilot access, distinct from the default GITHUB_TOKEN). For Claude or Codex, set ANTHROPIC_API_KEY or OPENAI_API_KEY as a repository secret.
Let's start with something immediately useful: an agent that triages new issues by summarizing them, applying labels, and adding a comment with suggested next steps. This is exactly the kind of judgment-heavy chore that CI was never designed for.
Create a file at .github/workflows/issue-triage.md:
---
on:
issues:
types: [opened]
permissions:
contents: read
issues: read
safe-outputs:
add-comment:
issue-number: "${{ github.event.issue.number }}"
add-labels:
issue-number: "${{ github.event.issue.number }}"
labels: [bug, enhancement, question, documentation, good-first-issue]
tools:
github:
---
# Issue Triage Agent
You are a repository maintainer triaging a newly opened issue.
## Steps
1. Read the issue title and body carefully.
2. Review the repository README, recent issues, and labels to understand project context.
3. Determine the most appropriate label(s) from the allowed set.
4. Add the label(s) to the issue.
5. Write a brief, helpful comment that:
- Acknowledges the issue
- Summarizes your understanding of the problem or request
- Suggests concrete next steps (e.g., "Could you share your OS and Node version?")
- Tags related issues if any exist
Be concise. Don't repeat the issue text back verbatim.Let's break this down. The frontmatter tells GitHub Actions:
The Markdown body below the frontmatter is the agent's instruction set. Write it the way you'd brief a new team member.
Now compile and push:
# Generate the lock file
gh aw compile
# Commit both files
git add .github/workflows/issue-triage.md .github/workflows/issue-triage.lock.yml
git commit -m "feat: add issue triage agentic workflow"
git push
# Optionally trigger a manual run
gh aw run issue-triageOpen a test issue in your repository. Within two to three minutes, the agent will read the issue, apply labels, and leave a comment. Check the Actions tab to see the full execution log, including what the agent read, what it reasoned about, and what outputs it produced.
Documentation rot is one of those problems every team knows about and nobody solves. A function's behavior changes, the docstring doesn't, and three months later someone wastes half a day debugging the mismatch. Agentic workflows can catch this automatically.
Create .github/workflows/docs-sync.md:
---
on:
push:
branches: [main]
permissions:
contents: read
pull-requests: read
safe-outputs:
create-pull-request:
title-prefix: "docs: "
branch-prefix: "agentic/docs-sync-"
labels: [documentation, automated]
tools:
github:
---
# Documentation Sync
After each push to main, check whether documentation still matches the code.
## What to check
- README.md: Do setup instructions, API examples, and feature descriptions
reflect the current code?
- Docstrings and inline comments: Do they accurately describe what functions
and classes actually do?
- CHANGELOG: Are recent changes reflected?
## Rules
- Only flag genuine mismatches. Don't rewrite docs for style.
- If everything is in sync, do nothing. Don't create empty PRs.
- When you find a mismatch, fix the documentation (not the code) and open
a pull request with a clear description of what changed and why.This workflow triggers on every push to main. The agent reads the diff, compares documentation to the current implementation, and if something's out of sync, opens a PR with the fix. The safe outputs section constrains it: it can only create PRs with a docs: title prefix on branches matching agentic/docs-sync-*. Pull requests are never auto-merged. A human always reviews.
Compile and push:
gh aw compile
git add .github/workflows/docs-sync.md .github/workflows/docs-sync.lock.yml
git commit -m "feat: add continuous docs sync workflow"
git pushThe push itself will trigger the workflow. If your most recent commits changed any code that's referenced in docs, you should see a PR appear within a few minutes.
The security model here deserves attention, because it's what makes agentic workflows practical rather than terrifying.
When you run gh aw compile, the CLI reads your .md workflow and generates a .lock.yml file. This lock file is a standard GitHub Actions YAML workflow with all the agent configuration baked in. GitHub Actions executes the lock file, not the Markdown directly. The key safety mechanisms:
This defense-in-depth approach is what separates gh-aw from "just run Claude in a GitHub Action." Running a coding agent CLI directly in a standard YAML workflow often grants more permissions than any single task requires. Agentic workflows constrain the blast radius by design.
Agentic workflows add a new class of CI load. Each run involves an LLM call, which means agent runs typically take two to three minutes even for simple tasks. If you're running triage on every new issue, docs-sync on every push, and maybe a daily test coverage agent, that's a meaningful increase in runner utilization.
A few things to consider:
If you're already hitting runner limits or paying for GitHub-hosted minutes, adding agentic workflows is a good reason to look at faster alternatives. Tenki's bare-metal runners plug directly into your existing GitHub Actions setup and run 35-67% faster than GitHub-hosted runners at roughly half the cost. For agentic workloads specifically, the near-zero startup latency means your agent starts reasoning immediately instead of waiting for a VM to provision.
When using Copilot as your agent engine, each workflow run typically incurs two premium requests: one for the agentic work and one for a guardrail check through safe outputs. Keep this in mind when planning your workflow frequency.
If writing Markdown workflows from scratch feels like too much for a first try, the CLI includes an interactive wizard that handles prerequisites, engine selection, secrets, and deployment in one go:
gh aw add-wizard githubnext/agentics/daily-repo-statusThis pulls a pre-baked daily status report workflow from GitHub's template library, walks you through configuration, and triggers the first run. It's the fastest way to see an agentic workflow in action before writing your own.
You can also let AI write workflows for you. Point your favorite coding agent at the creation instructions and describe what you want automated. The agent will generate the Markdown file, validate it, and prompt you to review before committing.
Once you've got the basics working, the gh-aw documentation describes several patterns for structuring agentic automation at scale:
The mental model that works best: not one omniscient agent per repo, but many small, focused agents, each responsible for one chore. The same way you'd structure microservices.
GitHub Agentic Workflows are still in technical preview, but the trajectory is clear. The teams behind gh-aw at GitHub Next and Microsoft Research are actively expanding the pattern into areas like continuous test improvement (in one experiment, test coverage went from ~5% to near 100% over 45 days with ~$80 in token costs), continuous security hygiene, and automated interaction testing.
The practical takeaway: start small. Pick one recurring task that drains your attention, something you'd love to never do manually again. Write a workflow for it. If it works, add another. If it doesn't, check the troubleshooting guide, tweak the instructions, and try again.
CI automated rule-based work over the past decade. Continuous AI is poised to do the same for judgment-based work. The tooling's here. The guardrails are solid. The only question is what you'll automate first.
Tags
Recommended for you
What's next in your stack.