Back/Engineering/Cursor
AdvancedEngineering

How to Deploy an Autonomous AI Agent for Bug Triage and Prioritization

Set up a long-running AI task in Cursor to autonomously pull error logs from Sentry and Vercel, analyze them, and generate a prioritized bug-fixing plan, including surfacing critical P0 bugs.

How to Deploy an Autonomous AI Agent for Bug Triage and Prioritization

20:57 to 25:23: Claire gives an agent access to Sentry and Vercel, asks it to investigate live failures, and reviews the prioritized repair plan it produces.

Before you start

What you need

  • Read access to the target repository, Sentry project, and Vercel project
  • The production environment and time window to investigate
  • The team definition of P0, P1, and lower priority incidents

What you’ll make

A prioritized bug plan that connects production errors to code, ranks urgency, and proposes specific fixes with evidence.

Tools used

Step by step

The workflow

Follow the sequence once, then adapt the prompts, checks, and handoffs to your own setup.

6 steps

Step01

Configure AI with Tool Access

Configure your AI model in Cursor to use tools. This enables it to make API calls and access data from your Sentry and Vercel projects when prompted.

Example prompt
Configure your AI model in Cursor to use tools. This enables it to make API calls and access data from your Sentry and Vercel projects when prompted.

My actual values:
[insert the files, settings, accounts, or constraints for this step]

Give me the exact commands, settings, or output to use. Finish with a pass or fail check for configure ai with tool access.
Step02

Initiate the Autonomous Task

In Cursor's chat or task interface, write a prompt defining the task's scope. Specify the data sources like Sentry and Vercel, the time frame for the logs, and the desired output, such as a prioritized bug-fixing plan.

Example prompt
Pull the last 72 hours of century errors and versel error logs and build a prioritized plan, a bug fixes based on observed issues.
Step03

Authorize Tool Access

The AI agent will request authentication to connect to your Sentry and Vercel accounts. Follow the prompts in the interface to grant it the necessary access.

Example prompt
The AI agent will request authentication to connect to your Sentry and Vercel accounts. Follow the prompts in the interface to grant it the necessary access.

My actual values:
[insert the files, settings, accounts, or constraints for this step]

Give me the exact commands, settings, or output to use. Finish with a pass or fail check for authorize tool access.
Step04

Monitor the Agent's Progress

Let the agent run the task autonomously in the background. This can take time; the example task took approximately 45 minutes to complete.

Example prompt
Let the agent run the task autonomously in the background. This can take time; the example task took approximately 45 minutes to complete.

My actual values:
[insert the files, settings, accounts, or constraints for this step]

Give me the exact commands, settings, or output to use. Finish with a pass or fail check for monitor the agent's progress.
Step05

Review the Prioritized Plan

When the task finishes, review the AI's output. Expect a detailed plan, such as an HTML canvas, that summarizes the analyzed errors from Sentry and Vercel and provides a prioritized list of fixes.

Example prompt
When the task finishes, review the AI's output. Expect a detailed plan, such as an HTML canvas, that summarizes the analyzed errors from Sentry and Vercel and provides a prioritized list of fixes.

My actual values:
[insert the files, settings, accounts, or constraints for this step]

Give me the exact commands, settings, or output to use. Finish with a pass or fail check for review the prioritized plan.
Step06

Action Critical Bugs

Focus on the highest-priority items in the generated plan. The analysis is designed to surface critical issues, like P0 bugs, that may be impacting users and require immediate attention.

Example prompt
Based on the P0 bug you identified regarding [describe the bug], draft a bug report ticket. Include a summary of the issue, the potential user impact, and the suggested fix you outlined.

What good looks like

  • Each priority item links an error signal to affected code and user impact
  • Critical issues are separated from noisy or duplicate events
  • The plan states the next code change and verification method for every P0 item

Build your next product with ChatPRD

Turn an idea into a PRD, user stories, and a plan.

Try ChatPRD free

After the steps

Runbook notes

How to recover when the loop fails and where human judgment helps.

Recover

If it goes sideways

The agent ranks issues by event count alone
Add user impact, recency, affected surface, and recoverability to the priority rules, then rerank.
The agent proposes a fix without tracing the failure
Require the relevant stack trace, logs, code path, and reproduction evidence before accepting the repair plan.

Start shipping
better products.

Join 100,000+ product managers who use ChatPRD to write better docs, align teams faster, and build products users love.

Free to start
No credit card
SOC 2 certified
Enterprise ready