Build guide
How to Build a Bug Triage Agent With Linear and GitHub
A bug triage agent should read the report, search related issues, inspect recent code, suggest a severity and draft a scoped engineering task. It should cut intake work without claiming it reproduced the bug unless it ran the steps. Write each ticket as the agent's brief, because the ticket sets the quality of the result.

On this page
How do you build a bug triage agent?
A bug triage agent starts from a clear trigger and ends with a handoff a person can check. The steps below cover that path, and the code shape after them lists the fields one run needs.
- 1Define the trigger: issue, PR, failed CI job, docs change or support ticket.
- 2Limit tool access to the files and systems the agent needs.
- 3Add a plan step before writes.
- 4Run checks and produce a short reviewer handoff.
- 5Log the prompt, changed files, commands and result.
type AgentJob = { task: string; context: string[]; allowedTools: string[]; checks: string[]; handoff: "diff" | "comment" | "pull_request"; };
Decide allowedTools first. While you build, broad access is tempting, because narrowing it is fiddly and everything works when you are watching. An agent that runs unattended with write access to the whole repo and a shell is a different kind of risk from one that can edit three paths and run a single command. You find out which one you built on the run where something goes wrong.
handoff decides whether people will trust the agent. For an agent that changes code, returning a diff keeps a person in front of every change before it lands, which is the right default while you learn how the agent behaves on your codebase. A pull request keeps the same gate with less friction once you have more confidence in the agent.
A comment is the lightest handoff and suits agents that only diagnose. Whichever you choose, don't let the agent merge until the commands in checks are ones you would have run yourself.
Interactive widget. Tab through its controls; the result updates in the panel below as you change them.
A good build keeps the trigger, context, tools, patch and handoff visible.
This is covered hands-on in Agent Mode Foundations — 6 short Units, free to read.
Rather do it than read about it? Run 11 interactive Cursor walkthroughs in a simulated editor. Free, no account needed.
What can go wrong?
Most failures here are ordinary. The agent gets too much room, or someone trusts a "done" that no test proved.
The agent touches files outside the task.
The handoff says done without test or review proof.
The agent gets broad access when narrow access would work.
Scope problems show up first. Give an agent a vague task and it will find related work to do, which looks like initiative until you face a diff across twenty files and can't tell which changes were the point. Narrow the task instead: name the files, name the behavior that should change and say what is out of bounds. A stronger model won't solve a scope problem.
Weak checks show up last and do the most damage. An agent reports success from its own reading of its own work, and nothing outside it says otherwise. If the agent's summary is the only thing between its work and your main branch, you have no review step. Give it a command whose exit code you trust, and fail the run when that command fails.
How should I write a ticket for an agent?
Write it as the agent's brief, because a detailed Linear or GitHub ticket now does that job as well as recording the bug for people. The ticket sets the quality of the agent's output. Describe the what: the user story, requirements, data model and expected UI. Leave out the implementation steps, and let the agent reason about how.
Pull the ticket into the agent through an MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition. server, such as Linear's or Atlassian's. Point the agent at the issue, and it recognizes the source, fetches the full details, plans and builds, so you don't paste the body in by hand.
The board-column trigger
Add a dedicated column, such as In Progress Cursor next to In Progress Human, so agent work is visible. Dragging a ticket into that column then starts a cloud agent that reads the ticket, implements it and returns a pull request with artifacts. In Linear, an automation's Status changed trigger can run when an issue moves into a status you pick, which covers this without custom code. For other trackers, send the column change to a webhook trigger. Free and Plus plans include neither cloud agents nor Automations.
- 1
- Move the ticket to In Progress.
- 2
- Copy the issue content.
- 3
- Paste it into the agent.
- 4
- Wait for the run.
- 5
- Manually test.
- 6
- Open a PR.
- 7
- Get review, then merge.
With a board-column trigger, steps 1 to 6 become a single drag. Dragging several tickets at once starts parallel agents, and each one opens its own pull request.
How does the agent reach Linear and prune a backlog?
Through the Linear MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition. server. An MCP server lets a Cursor agent work with an outside system, and Linear's lets it read tickets, comment on them and create tickets and projects. PMs use Cursor as a front end for Linear and hand it bulk triage that nobody would finish by hand.
Point the agent at a project: "go to this project, look at all the tickets, mark all the ones that are solved as done."
For each ticket it pulls the context, jumps to the code, checks git history for relevant commits, decides whether the problem still exists, updates the comments, and surfaces open questions back to you.
At the time of the talk, Cursor's own team ran an internal auto-run feature that started a background agent on incoming bug reports above a confidence bar. The agent worked on its own, and a person then merged a high-confidence fix or iterated on it. The feature was built around Linear's schema, with Jira and other connectors said to follow. Cursor's docs now describe starting cloud agents from both: delegate a Linear issue to Cursor or mention @Cursor in a comment, or assign a Jira work item to Cursor.
The biggest learnings... aren't that the background agent is actually really effective with the data it's given but we found that we need to iterate on our bug reporting process a little bit to make the right data available.
Can I investigate a bug just by pasting a Slack thread?
Yes, and you don't need to know the codebase. A finance teammate flagged a self-serve team with 10 unpaid invoices stacked up, when the product should have blocked it after the first. The presenter opened a new agent, pasted the raw Slack thread and started the run without adding anything else.
The agent was connected to the GitHub repo, to Databricks through MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition., and to Slack and Notion, and Cursor reasoned across all of them. It built its own to-do list, found the function causing the bug and checked it against that customer. It then summarized every affected team, with open invoice counts, total exposure and the top 10 customers by open value, and proposed both a fix and a Linear bug report. The agent found the relevant files on its own, without anyone pointing it at them.
Typically, this sort of investigation might take you a day... And so, we've been able to do all of that in the space of, 5 to 10 minutes.
Frequently asked questions
Who is this guide for?
AI engineers, support engineers and developer experience teams who want bug reports to arrive as tasks an agent or an engineer can start on.
What should I do next?
Point one Linear or GitHub trigger at the agent with read access to the tracker and the repo, and have it hand back a drafted engineering task. Let it open pull requests only after its drafts hold up in review.
Can one drag start several agents at once?
Yes. Drag several tickets into the trigger column together, and each one starts its own cloud agent in parallel and opens its own pull request. This works best for small, well-defined fixes that an agent can finish in one pass.
Can I start a Cursor cloud agent from Linear or Jira?
Yes. In Linear, delegate an issue to Cursor or mention @Cursor in a comment. In Jira, assign a work item to Cursor or mention @Cursor. The Jira integration needs Jira Commercial Cloud with Rovo enabled and a Cursor Teams or Enterprise plan.
What should a bug ticket contain when an agent will work on it?
Describe what should happen: the user story, requirements, data model and expected UI. Leave out implementation steps and let the agent reason about them, because the ticket sets the quality of the agent's output.
Sources & last verified
- Cursor agent best practices
- Cursor Learn: working with agents
- Cursor Learn: context
- Cursor docs: prompting agents
- Cursor docs: Automations
- Cursor docs: Linear integration
- Cursor docs: Jira integration
- Cursor docs: Models and pricing
Cursor ships frequently. Facts verified against primary sources on October 28, 2026.