Writing · Tutorial

Build an issue-triage agent on GitHub

A rulebook that routes issues, a confidence gate that decides when an agent should read the code, and the flywheel that turns human corrections into better rules. All on stock GitHub.

Most issue queues have the same shape. A few kinds of report make up most of the volume, someone senior reads every one of them anyway, and the interesting ones wait behind the routine ones. Triage is the part worth automating first, and it doesn’t need a platform. It needs a few things GitHub already has: Actions, issues, labels, one Python script, and, if you want it, the Copilot coding agent.

The github-triage-agent-tutorial repository builds that agent step by step. You write the code; the tests tell you when each chapter is right.

Two phases

Phase one is a rulebook. It is deterministic: each rule matches something in the issue and bids a severity, a destination and a confidence. Destinations are an internal service, an outside vendor or a human. It runs in an Action on every new issue and labels it in seconds.

Phase two is an investigation, and a confidence gate decides when it runs. When the rulebook is sure, the labels stand. When it isn’t, an agent reads the code that the error points to, writes up a hypothesis with its evidence, and leaves the decision to a person. The gate is what keeps the agent’s work on the issues that need it.

The wall is the point

The demo company is Jane’s Jeans, a fictional online jeans store with four services and two years of issue history. You train the rulebook on year one and watch it climb from about 31% correct routing to about 83%. Then year two arrives: a payment vendor deprecates an API, the reports change shape, severity accuracy drops to about 72% and the gate starts sending 40% of issues to people.

That drift is the lesson. A rulebook trained once decays, so the last chapters build the flywheel: when a person corrects a label, the correction is recorded, the misses are grouped, and the tutorial proposes the rule that would have caught them. Applying those rules brings routing back to about 89%, with under a quarter of issues gated.

How the tutorial works

Terminal
gh repo fork nhunsaker/github-triage-agent-tutorial --clonecd github-triage-agent-tutorialpython -m pytest tests/ -q# 27 passed, 38 skipped   <- the skips tick down as you build

Where it came from

The tutorial is the second half of “Automate the Queue”, a talk I gave at the Applied AI Conference in Saint Paul on November 2, 2026. The first half covered what an AI triage agent gets right on a real queue and where it hits the wall. This is the version you can build yourself.