より優れたバグボットの構築
Cursor はコードレビューエージェント「Bugbot」の構築プロセスと、並列実行・多数決投票などの手法による精度向上の詳細を公開し、解決率を 52% から 70% 以上に引き上げた成果を発表した。
キーポイント
定性的評価から定量最適化への転換
初期の試行錯誤を経て、カスタム AI ドライブメトリクスを用いた「ヒルクライミング」手法により、品質を体系的に向上させるアプローチへ移行した。
並列実行と多数決投票による精度向上
差分の順序を変えた 8 つの並列パスを実行し、複数パスで合致した事象のみを信頼する「多数決投票」を採用することで、偽陽性を大幅に削減した。
生産環境向けインフラの再構築
GitHub の制約内での運用を実現するため、Git 統合を Rust で再構築し、レート制限監視やバッチ処理などの基盤システムを整備した。
解決率指標の導入と活用
PR マージ時に AI が実際に修正されたバグを判定する「解決率 (resolution rate)」という指標を導入し、定量的な改善評価とモデルの最適化(ヒルクライミング)を実現しました。
エージェント型アーキテクチャへの移行
固定された処理パスから脱却し、差分を推論してツールを呼び出す自律的なエージェント設計へ変更したことで、最大の性能向上を達成しました。
プロンプトとコンテキスト戦略の転換
誤検知を防ぐための慎重なアプローチから、疑わしいパターンを徹底的に調査する積極的なプロンプトへ切り替え、静的コンテキストから動的コンテキストへのシフトも可能になりました。
ツールの設計がモデルの振る舞いに与える影響
ツールセットの小さな変更や利用可能性の変化が、モデルの行動に大きな影響を与え、インターフェースを反復して調整することで期待通りの結果を得られるようになった。
影響分析・編集コメントを表示
影響分析
この記事は、AI エージェントが単なるコード生成ツールを超え、複雑なロジックやセキュリティ脆弱性を検出する「レビューエージェント」として実用化されるための具体的な手法とデータを示しています。特に、並列処理による多数決投票というアプローチは、LLM の確率的性質を克服し信頼性を高めるための標準的なベストプラクティスとして業界に広く影響を与える可能性があります。
編集コメント
Cursor の Bugbot は、AI を活用した QA プロセスの効率化において、単なるモデル性能だけでなく「プロセス設計」がいかに重要かを示す優れた事例です。
コーディングエージェントの能力が高まるにつれ、私たちはレビューに費やす時間が増えていることに気づきました。これを解決するために、Bugbot を構築しました。これは、本番環境に到達する前にプルリクエスト内のロジックバグ、パフォーマンスの問題、セキュリティの脆弱性を分析するコードレビューエージェントです。昨年の夏までにはその成果が非常に良好だったため、ユーザー向けに公開することを決定しました。
Bugbot の構築プロセスは定性的な評価から始まり、徐々に品質を高めるためにカスタム AI ドライブ型の指標を用いたより体系的なアプローチへと進化していきました。
リリース以降、40 件の主要な実験を実施し、Bugbot の解決率は 52% から 70% を超えるまでに向上しました。一方、1 回の実行あたりでフラグされるバグの平均数は 0.4 から 0.7 に引き上げられました。これは、プルリクエストあたりの解決済みバグ数が約 0.2 から約 0.5 と、ほぼ倍増したことを意味します。
バージョン 1 は 2025 年 7 月に、バージョン 11 は 2026 年 1 月にリリースされました。新しいバージョンでは、偽陽性の顕著な増加を伴わずに、より多くのバグを検出できるようになりました。
#Humble beginnings(謙虚な始まり)
コードレビューエージェントの構築を試みた当初は、モデルがレビューを有益なものにするには十分ではありませんでした。しかし、ベースラインモデルが改善されるにつれ、バグ報告の品質を高めるためのさまざまな方法があることに気づきました。
私たちは、モデル、パイプライン、フィルタ、そして巧妙なコンテキスト管理戦略の異なる構成を実験し、その過程で社内のエンジニアに意見を求めました。ある構成の方が偽陽性が少ないように見える場合、それを採用しました。
私たちが初期に見つけた最も効果的な品質向上策の一つは、複数のバグ発見パスを並列実行し、その結果を多数決投票で統合することでした。各パスには異なる差分の順序が割り当てられ、モデルが異なる推論経路へと誘導されるようにしました。複数のパスが独立して同じ問題を指摘した場合、それはバグが実際に存在するというより強いシナルとみなしました。
内部での定性的な試行錯誤を数週間行った後、私たちは市場にある他のコードレビューツールよりも優れた性能を発揮し、リリースへの自信を持たせる Bugbot のバージョンにたどり着きました。そのフローは以下の通りでした:
ランダム化された差分順序で 8 つの並列パスを実行
類似するバグを一つのバケットに統合
一度だけのパスで見つかったバグをフィルタリングするための多数決投票
各バケットを単一の明確な記述にマージ
不要なカテゴリ(コンパイラー警告やドキュメントエラーなど)をフィルタリング
偽陽性を検出するために結果を検証モデルに通す
過去のランで投稿されたバグとの重複排除
#プロトタイプから本番環境へ
Bugbot を実用可能にするために、コアとなるレビューロジックに加えて、一連の基盤システムへの投資が必要でした。これには、Rust で Git 統合を再構築してデータ取得量を最小化し、GitHub の制約内で運用するためにレート制限モニタリング、リクエストバッチ処理、プロキシベースのインフラストラクチャを追加することが含まれていました。
採用が進むにつれ、チームは、不安全なマイグレーションや内部 API の誤った使用など、コードベース固有の不変条件をエンコードする手段も必要としていました。これに対応するため、システムにハードコーディングすることなく、これらのチェックをサポートする Bugbot ルールを追加しました。
これら一連の機能により、Bugbot は実行可能で現実のコードベースに適応可能なものとなりました。しかし、それだけでは品質が実際に向上しているかどうかは示されませんでした。進捗を測定する指標がないため、現場における Bugbot のパフォーマンスを定量的に評価できず、これが Bugbot をさらに推し進める際の上限となっていました。
重要なのは測ること
この問題を解決するため、「解決率」と呼ばれる指標を考案しました。これは AI を用いて、PR マージの時点で、最終コードにおいて著者が実際に解決したバグがどれであったかを判定するものです。この指標を開発する際、内部で PR 著者と共にサンプル事例をすべてスポットチェックしましたが、LLM はほぼすべての事例を「解決済み」または「未解決」として正しく分類していました。
チームからは、Bugbot が自分たちに与えている影響をどう評価すべきかという質問をよく受けます。そのため、この指標をダッシュボードで目立つように表示しています。効果性を評価するチームにとって、これは逸話的なフィードバックやコメントへの反応よりもはるかに明確なシグナルです。解決率とは、Bugbot がエンジニアが修正する実際の課題を見つけているかどうかを直接的に示すものです。
チームの時間経過に伴う解決率とその他の主要指標を示す Bugbot ダッシュボード。
解決率の定義変更により、Bugbot の構築方法が変わりました。初めて、単なる感覚ではなく、実際の信号に基づいてヒルクライムを行うことが可能になりました。私たちは、オンラインでは実際の解決率を用い、オフラインでは人間が注釈をつけたバグを含む実コードの差分を厳選したベンチマークである BugBench を用いて変更を検証し始めました。
モデル、プロンプト、反復回数、バリデータ、コンテキスト管理、カテゴリフィルタリング、そしてエージェント型設計にわたって数十回の実験を行いました。驚くべきことに、多くの変更が指標を悪化させました。その結果、初期の定性的分析から得た私たちの多くの判断は正しかったことが明らかになりました。
エージェント型アーキテクチャ
今秋、Bugbot を完全にエージェント型の設計に切り替えた際、最も大きな改善が見られました。このエージェントは差分を推論し、ツールを呼び出し、固定されたパスの列順に従うのではなく、どこをさらに深く掘り下げるかを判断できます。
エージェント型のアプローチにより、プロンプトの再考を迫られました。以前の Bugbot のバージョンでは、偽陽性を最小限に抑えるためにモデルを抑制する必要がありました。しかし、エージェント型のアプローチでは逆の問題が発生しました:あまりにも慎重すぎるのです。私たちは、疑わしいパターンをすべて調査し、潜在的な問題がある場合にフラグを立てる側に誤りを犯すよう促す、攻撃的なプロンプトへとシフトしました。
さらに、エージェント型アーキテクチャは実験のためのより豊かな表面領域を開拓しました。私たちは、静的コンテキストから動的コンテキストへ情報をより多くシフトさせることが可能になり、モデルが事前に受け取る初期コンテキストの量を調整し、それに応じてどのように適応するかを観察することができました。モデルは、すべてを事前に入力する必要なく、実行時に必要な追加コンテキストを自動的に取り込んでいます。
同じセットアップにより、ツールセット自体に対して直接イテレーションを行うことも可能になりました。モデルの振る舞いは、呼び出せるツールによって形成されるため、ツールの設計や利用可能性における小さな変化でも、結果に大きな影響を与えます。複数のイテレーションラウンドを通じて、私たちはそのインターフェースを調整・洗練させ、最終的にモデルの振る舞いが一貫して私たちの期待と一致するようにしました。
現在、Bugbot は Rippling、Discord、Samsara、Airtable、Sierra AI などの顧客に対して、月間 200 万件以上のプルリクエスト(PR)レビューを行っています。また、Cursor の社内コード全体においても Bugbot を稼働させています。
今後、他のプロバイダーや私たちの独自のトレーニング努力によって、異なる強みと弱みを持つ新しいモデルが定期的に登場すると予想されます。継続的な進展には、適切なモデルの組み合わせ、ハッチ(harness)設計、およびレビュー構造を見出すことが不可欠です。現在の Bugbot は、ローンチ時の数倍の性能を誇ります。数ヶ月後には、さらに大幅に改善されることを期待しています。
私たちはすでにその未来に向けて構築を進めています。このほど、PR レビュー中に発見されたバグを自動的に修正するために Cloud Agent を起動する「Bugbot Autofix」のベータ版をリリースしました。今後の主要な機能としては、Bugbot が自身のバグ報告を検証するためにコードを実行できるようにすることや、複雑な問題に直面した際に深い調査を行えるようにすることが含まれます。また、プルリクエストを待たずに継続的にコードベースをスキャンする常時稼働バージョンの実験も行っています。
これまでに大きな進歩を遂げてきましたが、Lee Danilek、Vincent Marti、Rohan Varma、Yuri Volkov、Jack Pertschuk、Michiel De Jong、Federico Cassano、Ravi Rahman、Josh Ma といった重要なチームメンバーの貢献がなければ実現できなかったことです。私たちの共通の目標は、AI 開発ワークフローがスケールするにつれて、あなたのチームがコード品質を維持できるよう支援し続けることです。
ドキュメントを読むか、今日から Bugbot をお試しください。


原文を表示
As coding agents became more capable, we found ourselves spending more time on review. To solve this, we built Bugbot, a code review agent that analyzes pull requests for logic bugs, performance issues, and security vulnerabilities before they reach production. By last summer, it was working so well that we decided to release it to users.
The process of building Bugbot began with qualitative assessments and gradually evolved into a more systematic approach, using a custom AI-driven metric to hill-climb on quality.
Since launch, we have run 40 major experiments that have increased Bugbot's resolution rate from 52% to over 70%, while lifting the average number of bugs flagged per run from 0.4 to 0.7. This means that the number of resolved bugs per PR has more than doubled, from roughly 0.2 to about 0.5.
We released Version 1 in July 2025 and Version 11 in January 2026. Newer versions caught more bugs without a comparable rise in false positives.
#Humble beginnings
When we first tried to build a code review agent, the models weren't capable enough for the reviews to be helpful. But as the baseline models improved, we realized we had a number of ways to increase the quality of bug reporting.
We experimented with different configurations of models, pipelines, filters, and clever context management strategies, polling engineers internally along the way. If it seemed one configuration had fewer false positives, we adopted it.
One of the most effective quality improvements we found early on was running multiple bug-finding passes in parallel and combining their results with majority voting. Each pass received a different ordering of the diff, which nudged the model toward different lines of reasoning. When several passes independently flagged the same issue, we treated it as a stronger signal that the bug was real.
After weeks of internal qualitative iterations, we landed on a version of Bugbot that outperformed other code review tools on the market and gave us confidence to launch. It used this flow:
Run eight parallel passes with randomized diff order
Combine similar bugs into one bucket
Majority voting to filter out bugs found during only one pass
Merge each bucket into a single clear description
Filter out unwanted categories (like compiler warnings or documentation errors)
Run results through a validator model to catch false positives
Dedupe against bugs posted from previous runs
#From prototype to production
To make Bugbot usable in practice, we had to invest in a set of foundational systems alongside the core review logic. That included making repository access fast and reliable by rebuilding our Git integration in Rust and minimizing how much data we fetched, as well as adding rate-limit monitoring, request batching, and proxy-based infrastructure to operate within GitHub's constraints.
As adoption grew, teams also needed a way to encode codebase-specific invariants like unsafe migrations or incorrect use of internal APIs. In response, we added Bugbot rules to support those checks without hardcoding them into the system.
Together, these pieces made Bugbot practical to run and adaptable to real codebases. But they didn't tell us whether quality was actually improving. Without a metric to measure progress, we couldn't quantitatively assess Bugbot's performance in the wild, and that put a ceiling on how far we could push it.
#Measuring what matters
To solve this problem, we devised a metric called the resolution rate. It uses AI to determine, at PR merge time, which bugs were actually resolved by the author in the final code. When developing this metric, we spot-checked every example internally with the PR author and we found that the LLM correctly classified nearly all of them as resolved or not.
Teams often ask us how to assess the impact Bugbot is having for them, so we surface this metric prominently in the dashboard. For teams evaluating effectiveness, it's a much clearer signal than anecdotal feedback or reactions on comments. Resolution rate directly answers whether Bugbot is finding real issues that engineers fix.
The Bugbot dashboard showing a team's resolution rate over time and other key metrics.
Defining resolution rate changed how we built Bugbot. For the first time, we could hill-climb on the basis of real signal, rather than just feel. We began evaluating changes online using actual resolution rates and offline using BugBench, a curated benchmark of real code diffs with human annotated bugs.
We ran dozens of experiments across models, prompts, iteration counts, validators, context management, category filtering, and agentic designs. Many changes, surprisingly, regressed our metrics. It turned out that a lot of our initial judgments from the early qualitative analyses were correct.
#Agentic architecture
We saw the largest gains when, this fall, we switched Bugbot to a fully agentic design. The agent could reason over the diff, call tools, and decide where to dig deeper instead of following a fixed sequence of passes.
The agentic loop forced us to rethink prompting. With earlier versions of Bugbot we needed to restrain the models to minimize false positives. But with the agentic approach we encountered the opposite problem: it was too cautious. We shifted to aggressive prompts that encouraged the agent to investigate every suspicious pattern and err on the side of flagging potential issues.
In addition, the agentic architecture opened up a richer surface for experimentation. We were able to shift more information out of static context and into dynamic context, varying how much upfront context the model received and observing how it adapted. The model consistently pulled in the additional context it needed at runtime, without requiring everything to be provided ahead of time.
The same setup lets us iterate directly on the toolset itself. Because the model's behavior is shaped by the tools it can call, even small changes in tool design or availability had an outsized impact on outcomes. Through multiple rounds of iteration, we adjusted and refined that interface until the model's behavior consistently aligned with our expectations.
Today, Bugbot reviews more than two million PRs per month for customers like Rippling, Discord, Samsara, Airtable, and Sierra AI. We also run Bugbot on all internal code at Cursor.
Looking forward, we expect new models to arrive on a regular basis with different strengths and weaknesses, both from other providers and from our own training efforts. Continued progress requires finding the right combination of models, harness design, and review structure. Bugbot today is multiples better than Bugbot at launch. In a few months we expect it will be significantly better again.
We're already building toward that future. We just launched Bugbot Autofix in Beta, which automatically spawns a Cloud Agent to fix bugs found during PR reviews. The next major capabilities include letting Bugbot run code to verify its own bug reports and enabling deep research when it encounters complex issues. We're also experimenting with an always-on version that continuously scans your codebase rather than waiting for pull requests.
We've made great strides so far that would not be possible without the contributions of some key teammates including Lee Danilek, Vincent Marti, Rohan Varma, Yuri Volkov, Jack Pertschuk, Michiel De Jong, Federico Cassano, Ravi Rahman, and Josh Ma. Together, our goal continues to be to help your teams maintain code quality as your AI development workflows scale.
Read the docs or try Bugbot today.


関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み