Agents

Building My First Autonomous Triage Agent for Support Tickets

I wanted to make the leap from AI that assists me to an agent that does real work on the team's behalf, and I picked the support queue as the place to learn. The investigation loop took two evenings. The boundaries took two weeks, and they were the actual product.

The situation

Every engineering team has a queue like ours: a steady trickle of support escalations, each one small, each one pulling someone out of deep work. When something looks off for a customer, the first pass is judgment-heavy and repetitive at the same time. Who is this account, what state is it actually in, is it eligible for the thing it's trying to do, and is this even our team's problem or another pod's? No single ticket is hard. Collectively they pull senior engineers off project work to do detective work that mostly repeats, which is exactly the kind of task that's frustrating to delegate and easy to keep "just handling" between meetings.

I also had a second, quieter motive. I'd been using AI conversationally for months, dashboards I read, analyses I asked for. I wanted to build an agent that acts for the team, and I wanted to learn that pattern on a bounded, low-stakes domain. The support queue was ideal: consistent investigation shape, real value, contained blast radius.

The constraint

I was explicit with myself about what this had to deliver and what it must never become:

  • A real first pass, not a summary. The note it leaves has to contain what an engineer would otherwise spend twenty minutes gathering: actual account state, actual eligibility, a hypothesis grounded in data it retrieved. Not a paraphrase of the ticket.
  • Trustworthy by construction. It runs against production account data, sometimes unattended. Read-only had to be enforced in code, not by convention, and every note it posts is internal-only and clearly marked as AI-generated. I wrote up the read-only guard as its own piece. The short version is a frozen GET-only client, a host allowlist checked per request, and tripwire tests that make loosening the contract a visible, reviewable act instead of a casual edit.
  • An explicit non-goal: resolution. The temptation is to let it fix the easy cases. I drew the line on day one. This system investigates and explains, forever. Acting on findings is a separate system with its own safety story.

What I did

The architecture is two halves with different jobs, and keeping them separate mattered more than either half's internals.

The poller is the boring, deterministic half. On a schedule it pulls recently created tickets and decides which ones the agent should even see. In our domain? Already closed? Already commented on (it must never double-post)? Enough to work with? Only tickets that clear every gate move on, and every ticket it sees, triaged, skipped, or held, is written to an audit record with the reason.

The agent is the judgment half. Given one eligible ticket, it runs the investigation a careful engineer would: the ticket and its prior human comments (passed in as context so it builds on what a person already found), the customer's account and its state, the account's record in our identity provider (login tickets usually come down to two systems disagreeing about one account), the eligibility checks for what the customer is trying to do, and the production logs filtered to that account, to separate real errors from expected noise. It's a plain tool-use loop on the raw model API, deliberately not an agent framework, because I wanted to see the loop rather than have it abstracted away. It drafts an internal note with a one-line hypothesis up top. Posting is opt-in, and dry-run is the default.

One operational detail I'm glad I did early: every request the agent makes carries identifying headers naming the agent and its operator, so its traffic is filterable in our observability tooling. An agent acting on your behalf should never be anonymous in your own logs.

The hardest honest-work problem in the build wasn't the investigation. It was deciding whose problem a ticket is. The first version filtered on the ticket's declared request type, which was wrong in both directions: tickets typed into our category that belong to another team by explicit policy, and tickets genuinely ours arriving under other types. The replacement is a content-based classifier with a deliberate precedence order, and the ordering is where the judgment lives. High-precision signals that only appear in our domain's tickets outrank coincidental keyword matches, so a passing mention of another system can't override strong evidence, and generic phrases that merely sound like our domain can't claim tickets on their own.

What made that fixable rather than vibes-based was a hand-verified ground-truth fixture: real borderline tickets, each with a human verdict and a written reason, that the classifier is diffed against after every change. Several of my own initial verdicts turned out to be wrong when I forced myself to write down the reasons. The fixture corrected me before it corrected the code.

What's happened so far

V1 posted its first genuinely useful triage note within days. The other 95% of the effort, roughly seven evenings over two weeks and plenty since, went into eligibility, guardrails, auditability, and knowledge. The parts that make it something you'd let run without watching.

The lessons that stuck:

  • Automatable means consistent, not easy. These tickets are good agent material because the investigation shape repeats, not because the judgment is trivial. That's the selection test I now apply to every "should an agent do this?" question.
  • Know who you're actually talking to. Midway through, I realized the "customer" on these escalation tickets isn't the end customer at all. It's the internal support agent who filed it. A drafted reply is internal-facing communication, a far smaller blast radius. Scoping risk correctly starts with knowing your audience literally.
  • Knowledge beats retraining. The agent's domain expertise lives in an editable runbook it reads on every run. When it gets something wrong, I fix the runbook, a one-minute edit, and the next run is smarter. That loop became the backbone of everything I've built since.
  • Credentials are the real adoption wall. The first version ran on my own short-lived personal token, manually refreshed. Fine for a prototype, disqualifying for anything unattended. Getting a proper long-lived, narrowly-scoped access path took longer than building the agent.

Two honest flags. The queue was chosen partly because it's low-volume, which made it a safe place to learn but means organic traffic can never prove the agent's quality on its own. The evaluation set has to carry that weight, and building it properly became the next chapter of this project (letting the agent run unattended, which I've written up separately). And one of my original goals, a pattern other leads could copy for their own domains, is still a promise. The pattern is documented, but until a second team adopts it, "replicable" is an aspiration, not a result.

What I'd do differently

  • Budget for credentials up front. The access path was the longest pole and the least anticipated. For any unattended system, I now treat "how does it authenticate, forever?" as a day-one design question, not a deployment detail.
  • Build the ground-truth fixture earlier. The ownership classifier wandered until the fixture pinned it down, and writing reasons next to verdicts caught errors in my own judgment. The fixture is cheap. The wandering wasn't.
  • Skip the framework debate entirely. The plain tool-use loop was the right call and I'd make it faster next time. For a first agent, seeing every step of the loop teaches you more than any abstraction saves you.

Take what helps

I built this to learn what it takes to hand real work to an agent, and the answer turned out to be almost entirely about boundaries: what it may read, what it may claim, what it may never touch, and how to make those limits structural instead of aspirational. The investigation loop, the part that demos well, was the easy two hours. The system around it is the actual work, and it's also the part that transferred. Every agent I've built since started from this one's skeleton: the poller/agent split, the read-only guard, the editable runbook, the audit trail, the AI-signed output. The version of that skeleton that actually ships code kept every one of those pieces and added gates on top.

Take what helps, skip what doesn't.

Get new playbooks by email

One email when a new playbook or guide goes up, nothing else. Unsubscribe anytime.